Onsite Coding
141 questions · 0 done
- Largest product of a contiguous runMedium
- Expand a compressed string with counts and nested groupsMedium
- Best non-adjacent pick on a ringMedium
- Largest all-zero square, then rectangleHard
- Check brackets and report the first errorEasy
- LRU cache with expiryMedium
- Order tasks by their dependencies and reject cyclesMedium
- Track the running median of a streamMedium
- Implement k-means from scratch until it convergesMedium
- LRU eviction with constant-time operationsMedium
- Parse an event stream that arrives in random chunksMedium
- Find the most frequent errors in a log too big for memoryProHard
- Rotate a square image 90 degrees in placeMedium
- Update a discrete posterior after each observationEasy
- Remove duplicate detections with non-max suppressionHard
- Hand-write the merge step of a BPE tokenizerMedium
- Total water trapped between barsMedium
- Longest common subsequence, used to score ROUGE-LMedium
- Batched LM cross-entropy with an ignore indexHard
- Write scaled dot-product attention with a causal maskMedium
- Talk through longest increasing subsequence and maximum subarrayProMedium
- Edit distance between two stringsMedium
- Multi-head attention that also does cross attentionHard
- Scaled dot-product attention with a causal maskMedium
- Find the duplicate number with constant memoryMedium
- Mask the prompt out of the SFT lossEasy
- Generate tokens with temperature, top-k and top-pHard
- Apply rotary position embeddingsHard
- Binary search for a boundary with few checksMedium
- Write a breadth-first crawler that stays on one hostMedium
- Keep only the k most likely tokens before samplingEasy
- Generate tokens with temperature, top-k and top-p from scratchHard
- Rate limit API requests with a token bucketEasy
- Batch incoming requests by size or wait timeMedium
- Build a cache with expiry and LRU evictionMedium
- How do you test Python code that calls an LLM?ProMedium
- Write the loop that runs a tool-calling agentMedium
- Find the root-cause span in a failed distributed traceMedium
- Debug a p99 latency spike in a streaming inference serviceProHard
- Batch jobs sometimes run twice: find out why and fix itProHard
Pro marks questions whose full answer outline needs Pro; you can read the question and write your answer for free. Coding questions open in the practice editor.