Tell me about a time you worked through a difficult bug or exception
cs-jun-003
Your answer
Answer as you would in a real interview — explain your thinking, not just the conclusion.
Model answer
I was debugging a NullReferenceException that appeared only in production under load. I added structured logging with Serilog to capture the full object state at the failure point and reproduced it in staging. The root cause was a race condition: two async tasks were initialising the same shared cache concurrently, and one overwrote the result with null. I fixed it with Lazy<T> for thread-safe single initialisation. The lesson was never assume concurrency is 'not my problem' in web APIs — I now review every shared mutable field for thread safety during code review.
Follow-up
What tools do you routinely use to make production debugging easier — structured logging, APM, distributed tracing?