Skip to content
Sharp

Architecture · interview question

A bug appears around caching. What is the strongest first debugging move?

Multiple choiceMediumchapter-18-curatedpremiumarchitecturecaching
python
cached = cache.get(order_id)
if cached is None:
    cached = repo.by_id(order_id)
    cache[order_id] = cached
Choose one answer
Answer and explanation

Correct answer

A. Trace one concrete example, inspect the state transitions, and compare them to the intended rule before rewriting anything.

Why

That approach is reliable because it creates evidence. Blind caching can create correctness bugs that are harder to debug than the latency it was meant to solve.

Test yourself on Architecture

A free test with instant, explained results. No account needed.

Start free test
All Architecture questions →