Coding problems and trade-offsCHAPTER 02
PART A / Coding problems and trade-offs
Step 26 of 252
CHAPTER 02GUIDED READING

Coding problems and trade-offs

Solve unfamiliar problems and explain correctness, boundaries, and trade-offs.

Solve a specified problem before changing its requirements

A transaction list, a schedule, or a dependency graph gives you concrete input to work with. Each problem states what to return, how ties and invalid values behave, and which changes would require a different approach.

Keep the reference closed for your first attempt. Produce a solution, walk a small example, explain its cost, then handle the follow-up. The problems reuse the preceding foundations and include separate runnable references for comparison.

Parts group related chapters. Each lesson has a chapter.lesson address, such as 4.07. Open a title below, or use Next to follow the reading sequence. Within a lesson, On this page lists its sections.

  1. 2.01
  2. 2.02
  3. 2.03
  4. 2.04
  5. 2.05
  6. 2.06
  7. 2.07
  8. 2.08
  9. 2.09
  10. 2.10
  11. 2.11
  12. 2.12
  13. 2.13
  14. 2.14
  15. 2.15
  16. 2.16
  17. 2.17
  18. 2.18
  19. 2.19
  20. 2.20
  21. 2.21
  22. 2.22

    Dependency order

    Graphs and retained state

  23. 2.23

    Word ladder

    Graphs and retained state

  24. 2.24

    Connectivity under added links

    Graphs and retained state

  25. 2.25

    Shortest path through a grid

    Graphs and retained state

  26. 2.26

    Cheapest route with nonnegative costs

    Graphs and retained state

  27. 2.27

    Top k observations in a stream

    Graphs and retained state

  28. 2.28

    Merge k sorted streams

    Graphs and retained state

  29. 2.29

    Prefix autocomplete

    Graphs and retained state

  30. 2.30

    Search for unique combinations

    Search and recurrence

  31. 2.31
  32. 2.32

    Minimum coins with a witness

    Search and recurrence

  33. 2.33

    Longest increasing subsequence

    Search and recurrence

  34. 2.34

    Edit distance

    Search and recurrence

  35. 2.35

    Count valid digit decodings

    Search and recurrence

  36. 2.36

    Days until a warmer temperature

    Stacks, parsing, and streams

  37. 2.37

    Largest rectangle in a histogram

    Stacks, parsing, and streams

  38. 2.38

    Parse and evaluate a policy expression

    Stacks, parsing, and streams

  39. 2.39

    Maintain an exact streaming median

    Stacks, parsing, and streams

  40. 2.40
  41. 2.41
  42. 2.42

    Run an unfamiliar coding mock

    Projects and practical assessment

  43. 2.43