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
- 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 →
- Top-K RetrievalThe core of the "R" in RAG: given a query embedding and a set of document embeddings, return the indices of the k most similar docs by cosine similarity, with a stable tie-break. Solve it in Python or TypeScript.Read →
- MMR RerankingTop-k by similarity returns five copies of the same paragraph. Implement Maximal Marginal Relevance: greedily pick results that are relevant to the query AND different from what you already picked — λ·relevance − (1−λ)·redundancy, with cosine similarity. Solve it in Python or TypeScript.Read →
- Rate Limiter, Constraint by ConstraintA third incremental round, where stage two invalidates stage one outright: a fixed-window counter becomes a sliding window, then per-key, then gains a burst allowance. Tests whether you can say “that counter has to go” calmly and refactor. Solve it in Python or TypeScript, with hidden tests.Read →
- Reconcile Two Systems That DisagreeThe customer is certain the ERP and the CRM agree; they have never checked. Build the reconciliation that produces a report someone can act on — normalised matching, per-field discrepancies, missing on each side, and duplicate keys reported rather than silently dropped. Solve it in Python or TypeScript, with hidden tests.Read →
- Harvest a Flaky Paginated APIThe vendor API is paginated, occasionally 500s, rate-limits without documenting it, and returns overlapping pages when the data moves under you. Collect everything, retry what deserves retrying, deduplicate, and return a partial result with the failures recorded rather than an exception. Solve it in Python or TypeScript, with hidden tests.Read →