Each heap problem asked the same two questions: what goes into the heap, and how should two items compare? This is what each exercise asked of you:
| Exercise | The question that unlocked it |
|---|---|
| Build a MinHeap Class | After I take the root away, which item moves into its place, and which way does it travel? |
| Top K Slowest API Responses | Which of the k responses I’m keeping is the first to lose its spot when a slower one arrives? |
| Trending Hashtags | When two tags have the same count, which one should a reader see first, and does my comparison agree? |
| Merge Sorted Log Files | Which entries could possibly come next, and how do I find the earliest of them without scanning every file? |
A quick self-check: think of the test that stayed red the longest for you. Which assumption in your code did it break? Interviewers often ask exactly that kind of question, and it’s a lot easier to answer once you’ve talked it through.
Want a second pair of eyes on your Heap work?
From here on, the label comes off. Mixed Practice hands you problems without saying whether they need a graph walk, a heap, or both, just like an interviewer would.