Coding Katas
AI coding rounds ask you to implement core pieces from scratch, usually in Python and NumPy, sometimes in PyTorch, in 20–45 minutes. Practice these katas until you can write them cleanly while explaining shapes and edge cases. (The full worked solutions live in the ML Coding section of Interview Prep.)
In this lesson
- Kata 1: Stable softmax + cross-entropy
- Kata 2: Scaled dot-product attention with a causal mask
- Kata 3: Sampling with temperature, top-k, top-p
- Kata 4: Cosine top-k retrieval
- Kata 5: Chunk a document with overlap
- Kata 6: BM25 scoring
- Kata 7: Reciprocal Rank Fusion
- Kata 8: A retry wrapper with exponential backoff and jitter
- Kata 9: A minimal tool-calling agent loop
- Kata 10: An eval harness
- How to practice
This lesson is part of AI Engineering. Unlock the full course to read it, take the quiz and track your progress.