Coding Interview Workshop
Clarify contracts, implement rigorous solutions, test edge cases and explain engineering tradeoffs.
- Clarify the contract before aggregating
Aggregate quantities by an exact ordinal key.
Contracts · 18 min - Expose repeated enumeration and allocation
An IEnumerable is a recipe for obtaining an enumerator, not necessarily a saved collection.
Complexity · 18 min - Build a boundary matrix for slicing
Define a slice using a start index and a count, with an exclusive end implied by their relationship.
Edge cases · 18 min - Find a linked-list cycle by identity
The input is a singly linked node graph whose links remain unchanged while searching.
Linked structures · 18 min - Implement an LRU cache with explicit updates
An LRU cache evicts the least recently used entry when inserting a new key into a full cache.
Cache design · 18 min - Separate trie words from prefixes
A trie represents shared prefixes with paths, but a path is not automatically a complete stored word.
Text indexing · 18 min - Define stable top-K ties before optimizing
Return the k most frequent keys, breaking equal counts by the position where each key first appeared.
Ranking · 18 min - Maintain a streaming median with two heaps
Maintain the exact median of all integers received so far.
Streaming statistics · 18 min - Explain an iterative inorder invariant
Traverse an acyclic binary tree in left-node-right order without recursion.
Tree traversal · 18 min - State BST search assumptions explicitly
Binary-search-tree search discards one subtree only because of a stated ordering invariant.
Tree search · 18 min - Choose hops or cost before choosing a path algorithm
The question shortest path is incomplete until the objective is specified.
Graph contracts · 18 min - Bound keyset pagination and continuation rules
A continuation token describes the last ordered key returned, not a page number.
API design · 18 min - Parse quoted fields with an explicit state machine
Parse one bounded comma-separated record with quoted fields and doubled quotes inside a quoted field.
Parsing · 18 min - Test comparator laws instead of subtracting
A comparer returns a negative, zero or positive sign describing order; the magnitude is not a distance contract.
Ordering correctness · 18 min - Debug mutation by choosing ownership
A request to remove matching items needs an ownership decision: return a filtered copy or mutate an exclusively owned list.
Mutation review · 18 min - Reject overflow with a deliberate billing contract
Compute a nonnegative quantity times a nonnegative price expressed in integer cents.
Numeric correctness · 18 min - Clarify Unicode units before truncating
The word character is ambiguous in a .NET interview.
Unicode debugging · 18 min - Make a timed take-home policy testable
A timed take-home has a deadline policy that should be testable without waiting thirty real minutes.
Time and testing · 18 min - Refactor review code around a pure decision
A coding-review task often mixes validation, calculation, logging and persistence in one method.
Code review · 18 min - Bound duplicate-request decisions honestly
An idempotency key is bound to a specific request meaning, not merely remembered as seen.
State contracts · 18 min - Use a differential oracle and generated cases
Find the first value that occurs exactly once, returning a nullable integer when no such value exists.
Testing strategy · 18 min - Own enumerators when consumers stop early
A lazy operation owns the enumerators it creates even when its consumer stops before the source ends.
Lazy sequence ownership · 18 min - Defend a bounded-cache policy with a senior rubric
A senior interview answer should name the resource budget, admission rule and failure behavior before choosing infrastructure.
Senior tradeoffs · 18 min - Deliver a checked interview capstone
Deliver a small complete interview solution with a written grammar, aggregation rule, deterministic ranking and bounded output page.
Integrated problem solving · 30 min