Code RoomAuthorization cache with revocation
MediumPrep Room Coding #3180

Authorization cache with revocation

System designDistributed systemsMid–Senior~35 min

Design caching for an authorization/permissions service that answers 'can user U do action A on resource R?' It's called on nearly every API request (read-heavy, 50k qps), permissions change rarely but a revocation must take effect within ~5s, and a cache miss is expensive (a graph traversal). Also, lots of queries are for principals that don't exist or have no grant. Design the cache, including how you handle negative results and revocations.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.