Finished this one? 0 / 75 Challenges done
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Challenges
- SoftmaxThe function at the end of every classifier and language model: turn raw scores (logits) into a probability distribution. Implement the numerically stable version so big logits do not overflow. Solve it in Python or TypeScript.Read →
- Cosine SimilarityThe measure behind every embedding search and RAG system: how aligned are two vectors, ignoring their length? Dot product over the product of magnitudes — 1 identical, 0 orthogonal, -1 opposite. Solve it in Python or TypeScript.Read →
- K-Nearest NeighborsThe simplest classifier there is: to label a new point, look at the k closest labeled points and let them vote. No training, no weights — just Euclidean distances, with deterministic tie-breaks. The whole model is the dataset. Solve it in Python or TypeScript.Read →
- Union-Find (Connected Components)The disjoint-set behind Kruskal’s MST and network connectivity: answer "are these connected?" in near-constant time with union by rank and path compression, then count the components. Solve it in Python or TypeScript, with hidden tests.Read →
- Min StackA stack that also returns its minimum in O(1) — no scanning. Carry the running minimum alongside each element. Replay push/pop/top/getMin operations. Solve it in Python or TypeScript, with hidden tests.Read →
- Sliding-Window Rate LimiterAllow at most N requests per rolling window — the rate limiter that guards real APIs. A sliding log of accepted timestamps gives exact limits without fixed-window bursts. Decide accept/reject for a stream. Solve it in Python or TypeScript, with hidden tests.Read →