Course · 24 lessons

Coding Interview Workshop

Clarify contracts, implement rigorous solutions, test edge cases and explain engineering tradeoffs.

  1. Clarify the contract before aggregating

    Aggregate quantities by an exact ordinal key.

    Contracts · 18 min
  2. Expose repeated enumeration and allocation

    An IEnumerable is a recipe for obtaining an enumerator, not necessarily a saved collection.

    Complexity · 18 min
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. Maintain a streaming median with two heaps

    Maintain the exact median of all integers received so far.

    Streaming statistics · 18 min
  9. Explain an iterative inorder invariant

    Traverse an acyclic binary tree in left-node-right order without recursion.

    Tree traversal · 18 min
  10. State BST search assumptions explicitly

    Binary-search-tree search discards one subtree only because of a stated ordering invariant.

    Tree search · 18 min
  11. Choose hops or cost before choosing a path algorithm

    The question shortest path is incomplete until the objective is specified.

    Graph contracts · 18 min
  12. Bound keyset pagination and continuation rules

    A continuation token describes the last ordered key returned, not a page number.

    API design · 18 min
  13. 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
  14. 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
  15. 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
  16. Reject overflow with a deliberate billing contract

    Compute a nonnegative quantity times a nonnegative price expressed in integer cents.

    Numeric correctness · 18 min
  17. Clarify Unicode units before truncating

    The word character is ambiguous in a .NET interview.

    Unicode debugging · 18 min
  18. 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
  19. 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
  20. Bound duplicate-request decisions honestly

    An idempotency key is bound to a specific request meaning, not merely remembered as seen.

    State contracts · 18 min
  21. 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
  22. 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
  23. 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
  24. 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