01Two Sum: return indices of the two numbers that add to a target▼easy★ EssentialMetaScalePalantir1 repliesunlockedThe most common screen opener, and interviewers use it to check whether hashmap thinking is reflexive. Here's the one-pass answer, the narration that earns points, and the duplicate-handling edge case most candidates fumble.Open full answer →
02Group anagrams: cluster a list of strings into anagram groups▼easyMetaGleanScale1 repliesunlockedA 5-minute warm-up that quietly tests the most useful idea in practical coding: choosing a canonical key. The sorted-string vs character-count tradeoff is exactly what interviewers want to hear you reason about.Open full answer →
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 →
04Insert a new interval into a sorted, non-overlapping interval list▼easyPalantirMeta1 repliesunlockedThe follow-up interviewers reach for when merge-intervals goes too smoothly. The three-phase scan is elegant, but only if you've internalized the overlap condition most candidates have to re-derive under pressure.Open full answer →
05Top-K frequent elements▼easy★ EssentialMetaGleanOpenAI2 repliesunlockedTop-K is the most reused primitive in FDE interviews: it reappears inside log parsers, analytics questions, and retrieval ranking. Three solutions exist; knowing which one to lead with is the real test.Open full answer →
06Count subarrays whose sum equals K▼easyMetaScaleOpenAI1 repliesunlockedLooks like a sliding-window problem; isn't one. The prefix-sum + hashmap trick that solves it is the same idea behind sessionization and cumulative-metrics questions later in the loop: learn it once, reuse it three times.Open full answer →
07Design a class that returns the moving average of the last N values in a stream▼easyOpenAIGleanRetool2 repliesunlockedThe gentlest 'design a class' question in FDE screens, and the warm-up interviewers use before rate limiters and sessionization. The deque trick is easy; the API and time-window follow-ups are where the signal is.Open full answer →
08Build a wc-lite: count lines, words, and characters in text, with flags, factored for extension▼easyAnthropicRetoolOpenAI1 repliesunlockedAnthropic-style screens open with deceptively simple builds like this, then extend them three times. The grade isn't the counting; it's whether your first version survives the extensions without a rewrite.Open full answer →
58Given a list of inference latencies, compute the p95 and explain percentile indexing.▼easyOpenAIAnthropicGlean1 replies◆ premiumEveryone quotes p95 in latency SLOs, but few can compute it without a library and fewer can explain why the index is ceil(p*n)-1, not p*n. The warm-up that screens whether you actually understand the metric you live by.Open full answer →
59Compute the cosine similarity between two embedding vectors, handling the zero-vector case.▼easyOpenAICohereGlean1 replies◆ premiumThe arithmetic is three sums; the signal is what you do when a vector is all zeros and the denominator vanishes. The warm-up that gates every RAG and retrieval coding round.Open full answer →
60Parse a JSON-lines file of LLM logs and aggregate tokens generated per request.▼easyOpenAIAnthropicGlean1 replies◆ premiumReal LLM logs are JSONL, not JSON, and real log files have a malformed line halfway through. The warm-up that screens whether you can stream a file and aggregate without one bad record nuking the whole run.Open full answer →
61Write a generator that yields fixed-size batches from a large iterator for streaming inference.▼easyOpenAIAnthropicHugging Face1 replies◆ premiumBatching inputs is how you keep a GPU fed, but the source is an iterator you cannot index or len(). The warm-up that screens whether you can write a lazy generator that handles the ragged final batch.Open full answer →
62Maintain a sliding-window average over a stream of metrics, like tokens/sec.▼easyOpenAIAnthropicDatadog1 replies◆ premiumA dashboard needs the average tokens/sec over the last N seconds, updated on every sample, forever. The warm-up that screens whether you evict by time and keep a running sum instead of re-summing the window each call.Open full answer →