Propose a scalable entitlement architecture for complex rules

Tests separation of hot-path reads from async policy work. Great answers: edge-cache plan tokens; stream quota usage async; isolate rules in a microservice. Red flag: doing a DB lookup or sync quota check per request.
What's really being asked
The interviewer wants to see if you can separate a user-facing hot path that must stay fast from a background policy layer that tolerates slightly stale data. They are looking for mastery of caching hierarchies, async event-driven architectures, and horizontal scaling rather than simply upgrading a database.
The full answer
First, an edge-cached token strategy where the entitlement service issues signed JWTs or capability tokens encoding the current plan, features, and add-ons, letting API gateways validate access locally in under five milliseconds without hitting the core service. Second, an async quota pipeline that ingests usage events into a stream and updates counters in a separate store, so the hot path only reads a cached limit rather than writing to a shared row on every request. Third, a rules microservice that evaluates complex business logic such as geographic restrictions or promotional bundles offline and publishes updated token schemas to the edge cache. Fourth, horizontal scaling of the token issuer and rules engine behind load balancers with no session affinity, plus regional deployment to keep latency under fifty milliseconds globally.
The mistakes people make
Proposing to shard a single relational database and still query it synchronously on every request. Suggesting a distributed two-phase commit across the entitlement service and a billing database to enforce quotas in real time. Recommending a monolithic rules engine that evaluates all add-ons and quotas inline inside the request thread. Ignoring cache invalidation entirely or assuming a five-second TTL is acceptable for premium features without a push-based refresh mechanism.
What usually comes next
How do you handle cache invalidation when a user upgrades mid-session? What happens if the async quota pipeline lags and a user briefly exceeds their limit? How would you model entitlements for a B2B tenant with thousands of seats and custom add-ons? Walk me through the fallback path if the edge cache is unreachable.
A concrete example
A video streaming platform checks entitlements on every play button click. Instead of querying a subscription database, the API gateway verifies a signed edge token that lists the plan tier and available codecs. Usage minutes are streamed to Kafka; a consumer updates a Redis counter every few seconds. When the user buys a 4K add-on, the rules microservice revokes the old token and pushes a new one to the edge POPs within two hundred milliseconds, keeping the play path fast while still enforcing complex upsell logic.
Interview question
When designing a low-latency entitlement system, how should the hot path handle plan validation and quota checks?
- a.Perform a synchronous database lookup for plan details and write quota increments to a shared row per request
- b.Use a distributed two-phase commit across the entitlement service and billing database for every request
- c.Issue signed edge tokens for plan validation and stream quota usage to an async pipelineCorrect
- d.Evaluate all complex business rules, including geographic restrictions, directly inside the API gateway thread
Why? this is the answer
The correct approach separates the user-facing hot path from background policy work by validating signed edge tokens locally and streaming quota events asynchronously, keeping latency under five milliseconds. A synchronous database lookup per request is a common red flag because it couples the hot path to a remote dependency and creates a scaling bottleneck.
Just read this? Test yourself on what you have been reading.
Read the original → u2opia.com
- #system design
- #scalability
- #entitlements
- #caching
- #microservices
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on system design — each one lists the topics its interview covers.
See open roles