liveBook · Manning

Problem solving

As explained in The Art of Code

Problem-solving is the process of analyzing a problem and devising an effective solution.

Problem solving turns a technical situation into an effective solution. It is needed when code compiles but a production failure, unpredictable behavior, or performance drop still leaves the real problem unclear. Creativity helps move beyond an initial symptom rather than treating it as the cause. section 10.1.2 section 10.3

Use a four-step loop:

  • Clarify the problem by asking context-setting questions and gathering data. Trace reproducible failures from where the error appears (hot exploration); for nonreproducible failures, build a timeline from the first report (cold exploration). section 10.4
  • Investigate beneath visible symptoms. Follow each answer with another question, consult documentation, articles, colleagues, or AI tools, and verify any suggestions against the actual context. section 10.3.3
  • Evaluate hypotheses to confirm the real cause rather than acting on a plausible guess. section 10.4
  • Implement the solution, then reflect on what it teaches so the result becomes reusable knowledge for later work. section 10.4

Tracing a slow page with 5 Whys

A slow page may first point to long database requests. Repeatedly asking why can reveal slower queries, a dropped index, a migration script that omitted it, manual environment-specific SQL files, and finally the absence of a standard migration tool. The technique follows the chain from symptom to underlying process or design cause. section 10.3.3

Constraints can also make problem solving more inventive. For a list of people, compare solutions that find youngest and oldest names and alphabetize all names under performance, memory, functional-pipeline, and readability constraints. Then combine the strongest qualities of the alternatives. section 10.2.1

Figure 10.1 The creative problem-solving methodology
figure

Use the methodology diagram as a quick map of the clarify, investigate, evaluate, and implement loop. section 10.3

How The Art of Code covers it

How deep it goes
Explains a four-step loop with hot/cold exploration, root-cause investigation, hypothesis evaluation, implementation, and reflection.
Examples
Uses a slow page caused by a dropped database index and a constrained Person-list transformation exercise.
What it assumes
Assumes familiarity with technical problems while making a practice-based problem-solving process explicit for junior developers.
What you can do after
Diagnose/debug with it by clarifying symptoms, investigating causes, validating hypotheses, implementing fixes, and reflecting on results.
How it connects
Connects creativity, constraints, root-cause analysis, 5 Whys, hot exploration, cold exploration, and hypothesis evaluation.

Also explained in

Compare how 3 books explain problem solving →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Code. The section links point to the parts of the book it draws on.