Logo

Question preview

Relaxing roulette

What this preview is

About this preview

Relaxing roulette is a easy quant interview question on concurrency in Rust.

Unlock full access to getcracked

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

What this Rust concurrency question tests

This is an easy Rust concurrency question that probes your understanding of how memory safety and thread synchronization work together. The question asks you to reason about the observable output of a multi-threaded program—a skill that separates candidates who can reason about concurrent code from those who memorize Rust syntax.

To answer correctly, you need to think carefully about how Rust's ownership model and synchronization primitives (like Mutex or atomic operations) constrain what values can be printed, and what guarantee the type system gives you about data races. The "lowest number" framing pushes you to consider all possible interleavings and find the tightest bound.

  • Rust's memory safety guarantees under concurrency
  • Mutual exclusion and critical sections
  • Happens-before relationships and visibility
  • Thread spawning and join semantics