Coding
Algorithms, patterns, and interview problems.
Most Frequently Co-Purchased Items
Find each product's most frequent shopping-basket companion with exact pair counts, deterministic ties, and tested Java and Python solutions.
Find the Earliest Supported Library Version
Find the earliest supported release with hierarchical binary search, cached API probes, and tested Java and Python solutions.
Generic Return Type Inference: Match, Bind, Substitute
Infer concrete return types from nested tuples and generic parameters, with immutable type trees, Java and Python solutions, and runnable tests.
Resumable Iterators: Checkpoints for Lists and UTF-8 Files
Design a compact recovery cursor, then implement list and file iterators in Java and Python with runnable tests and precise restart semantics.
Rebalance Overlapping Shard Ranges
A greedy sweep with a min-heap and a monotone frontier, explained with runnable Java and Python solutions and boundary tests.
Counting a Distributed Tree with Async Messages
An optimal message-based tree count in Java and Python, with isolated requests, duplicate suppression, retries, and topology follow-ups.
Monster Battle System: Turn Simulation and Smart Attacker Selection
Build a deterministic monster battle in Java and Python, then optimize repeated best-attacker queries without changing the rules.
Durable In-Memory KV Store with Size-Limited Snapshot Files
Build a recoverable KV snapshot with custom UTF-8 encoding, bounded chunk files, and runnable Java and Python solutions.
Build a Memory Allocator: First-Fit, Best-Fit, and Coalescing
Track free intervals by address and size, merge on free, and implement both allocation policies in Java and Python.
IPv4 Address Iterator: One 32-Bit Cursor
A lazy IPv4 iterator with Java and Python solutions, carry handling, the final-address boundary, and CIDR/IPv6 interview follow-ups.
Plant Infection on a Grid: Spread, Recovery, Death, and Firebreaks
Five escalating grid questions, from multi-source BFS to timed events and an exact firebreak planner, with Java and Python solutions.
GPU Credits: Out-of-Order Grants and Expiring Credits
Replay timestamped credit events with an expiry-ordered heap, then cache balances across a bounded time horizon. Includes tested Java and Python solutions.
Build a Text Editor: Undo, Autocomplete, and Collaboration
An interview walkthrough from a mutable text buffer to reversible edits, a live prefix index, and convergent collaborative editing.
Design a Versioned Social Graph with Snapshots
Use logical time and edge-activity intervals to support O(1) snapshots, historical following queries, friend recommendations, and snapshot diffs.