03Merge overlapping intervals▼easyPalantirMetaOpenAI1 repliesunlockedThe interval pattern shows up everywhere in FDE loops: calendars, flight segments, log windows. Master the sort-then-sweep idiom here and three other interview questions fall out for free.Open full answer →
09Three Sum: find all unique triplets that sum to zero▼mediumMetaxAIScale1 repliesunlockedEveryone knows the sort + two-pointer outline. The interview is actually about duplicate handling: three separate skip conditions that candidates routinely botch live. Here's the clean version and the narration that goes with it.Open full answer →
16Flight segments (start, end, seats): find the maximum simultaneous passengers▼mediumPalantirMeta1 replies○ sign inThe Palantir coding-screen classic. It looks like merge-intervals but needs a different weapon, the sweep line, and the boundary-tie detail decides whether your answer is right or off by a planeload.Open full answer →
86Sort a k-sorted array, where each element is at most k positions from its final place▼mediumAmazonGoogle2 replies◆ premiumA full sort throws away the structure you were handed. Because no element moves more than k slots, a min-heap of size k+1 always has the next smallest element on top, sorting in O(n log k) and one pass.Open full answer →