Skip to content
Sharp

Architecture · interview question

What does a strong engineer do when reasoning through caching code?

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. Narrate the data shape, the state changes, and the exact rule order step by step.

Why

Interviewers often use simple code to test whether you can reason through execution without bluffing.

Test yourself on Architecture

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

Start free test
All Architecture questions →