Logo

Question preview

What's suspect?

What this preview is

About this preview

What's suspect? is a easy quant interview question on concurrency in Cpp.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

Identifying concurrency issues in C++ code

This easy concurrency question tests whether you can spot a common pitfall in multi-threaded C++ programs. Rather than asking you to write thread-safe code from scratch, it presents a realistic snippet and asks you to reason about what could go wrong when multiple threads access or modify shared state.

Questions of this type are common in systems interviews at trading firms and infrastructure teams. They reward clarity of thinking about execution ordering, visibility across threads, and the guarantees (or lack thereof) that the C++ memory model provides. A good answer identifies the specific issue, explains why it matters, and sketches what would be required to fix it.

  • Memory visibility and the happens-before relation
  • Data races and undefined behaviour
  • Synchronisation primitives and their scope
  • Compiler and hardware reordering