What this C++ threading question tests
This is an easy foundational question on thread lifecycle management. Interviewers ask it to confirm you understand how to safely synchronize threads and prevent undefined behaviour in multi-threaded programs.
The question probes whether you know the difference between starting a thread and waiting for its completion, and why the latter matters. Strong answers explain the practical consequences of not synchronizing properly—such as resource leaks or accessing destructed objects—and when and how to use the synchronization primitive correctly.
- Thread lifecycle: creation, execution, and termination
- Blocking vs. non-blocking operations
- Race conditions and resource safety
- Deadlock and exception safety considerations