Fix a Concurrency Bug with AI
Hard · AI-Assisted Coding · about 60 minutes
Asked at Meta, Coinbase, Microsoft.
A small inventory service sometimes oversells items under load: two concurrent orders can both reserve the last unit. The bug doesn't show up in the unit tests. Using an AI assistant, reproduce the bug reliably, find the root cause, fix it and add a test that would have caught it.