Put a least-recently-used cache in front of Quickcart's slow product service, with O(1) operations, statistics and live resizing.
Least recently used
A fixed-capacity cache that evicts the least recently used entry, with O(1) get and put.
Statistics and resizing
Count hits, misses and evictions, peek without touching recency, and change capacity at runtime.
Expiring entries
Prices change. Make entries expire after a time-to-live, with an injectable clock.
Coding puzzles train one skill. Here's what else the job needs, how to practise it, and how to balance interview prep with real project work.
What a design document is for, a half-page template (components, data structures, trade-offs, open questions) and a worked example, before you write any code.
What Big-O tells you on the job: the costs of common operations, amortised O(1), inputs that trigger the worst case, memory as a cost, and when to measure instead of guessing.
What a hash function does, how hash sets give fast lookups, why hash mod n reshuffles everything when servers change, and how a consistent hash ring with virtual nodes fixes it.