← Questions

Find and fix the races in a bank account class

0
SpaceXAICodingLast asked Sep 2026

A coding interview question asked in SpaceXAI's technical phone screen, last asked Sep 2026. It tests concurrency, debugging and locks.

Several threads call deposit on the same account object at the same time, and the balance comes out wrong. Find every concurrency bug, make deposits thread-safe, and explain why the fix is correct and what it costs.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

concurrency · debugging · locks

Your code and the AI tutor open when you unlock this question.