Deadlock Scenario Analysis - Quant Trader Interview Question
Difficulty: Hard
Category: Code Analysis
Practice quant interview questions from top firms including Jane Street, Citadel, Two Sigma, DE Shaw, and other leading quantitative finance companies.
Topics: concurrency, deadlock, mutex, threading
Problem Description
Consider a multi-threaded trading system. Two threads, A and B, execute concurrently. Thread A first attempts to acquire a lock on mutex mutex1 and then, if successful, attempts to acquire a lock on mutex mutex2. Thread B attempts to acquire locks in the reverse order: first mutex2, then mutex1.
What is the most likely outcome if both threads attempt to acquire these locks simultaneously?
Practice this hard trader interview question on MyntBit - the all-in-one quant learning platform with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.