Design Top-K System — Section 8: Advanced Deep Dive Q&A (Principal Level)
Goal of this section: Address the hardest follow-up questions interviewers ask at Staff/Principal level and provide ideal model answers.
Q1. How do you compute Global Top-K across regions?
Answer:
We use a hierarchical aggregation model.
- Compute Top-K per region independently
- Emit regional Top-K candidates
- Merge regional candidates into a global heap
- Produce Global Top-K
This avoids scanning all items globally and limits the candidate set to K * regions.
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson