← Questions

Two threads updating a shared counter with different stop conditions

0
TeslaCodingLast asked Aug 2026

A coding interview question asked in Tesla's second technical round, last asked Aug 2026. It tests concurrency, threads and synchronization.

Write a small program with two threads that share one counter, starting at 0. Both threads increment the counter in a loop.

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 · threads · synchronization

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