Coding

Algorithms, patterns, and interview problems.

MODULE 0614 NOTESPATTERNS / COMPLEXITY / PRACTICE
Coding

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.

hash-tableco-occurrencecounting
Coding

Find the Earliest Supported Library Version

Find the earliest supported release with hierarchical binary search, cached API probes, and tested Java and Python solutions.

binary-searchversioningsearch
Coding

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.

type-inferencegenericstrees
Coding

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.

iterationcheckpointingstate-machine
Coding

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.

intervalsheapgreedy
Coding

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.

distributed-systemstreeconcurrency
Coding

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.

simulationobject-oriented-designsorting
Coding

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.

data-structurespersistencefile-io
Coding

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.

data-structuresintervalstrees
Coding

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.

bit-manipulationiterationnetworking
Coding

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.

graphbfssimulation
Coding

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.

heapevent-sourcingsimulation
Coding

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.

data-structurestrieundo-redo
Coding

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.

graphbinary-searchdata-structures