Heaps, Top-K & Intervals
Everything X shows you is ranked. The timeline picks a few hundred posts out of the thousands your follows produced. Trending surfaces the hottest hashtags of the last hour. A dashboard reports the median latency of a live request stream. Underneath all of it sit three plain moves this family drills. A heap pulls the extreme of a set without ordering the rest. Two heaps run back to back to track the running middle of a stream. And sorting then sweeping folds a pile of overlapping time windows into a tidy few. None of the three is exotic, which is exactly why the loop expects them to be automatic.
The pressure X applies here is the pressure it applies everywhere in the coding loop. The code has to run and clear the cases on a shared editor, you reach for the edges without being told, and you give a spoken read of the time and space. That holds across both versions of the company: the earlier Twitter screen still live on some roles, and the harder xAI-run bar that came with the merger. Reports vary on the exact rounds. What stays constant is that a clean heap you can write without fumbling buys the room for the follow-up that almost always lands next.
- 3 problems, worked step by step
- about 22 min
Premium lessonX (Twitter) interview guide
These took digging.
What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.
100 companies. Checked every month.
Unlock all 100 companies$49 a year · less than $1 a week · Cancel anytime
X (Twitter) interview guideKnow what X (Twitter) asks before you walk in.
19 coding · 5 system design · 20 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.