Foundations
Problem Solving Framework
Master a repeatable 8-step framework to analyze, break down, and solve any coding interview problem with confidence.
Last Updated: July 31, 2026
•
15 min read
1. Introduction
What is the Problem Solving Framework?
The Problem Solving Framework is a structured, repeatable step-by-step process used by senior engineers to tackle unfamiliar or complex programming problems. Instead of guessing code or typing immediately, it guides you from reading a prompt to delivering a clean, verified solution.Why is it Important?
When faced with a tough problem in an interview or on the job, panic often leads to typing code blindly, missing hidden edge cases, and running out of time. A framework acts as your blueprint—it removes guesswork, keeps your thinking organized, and demonstrates strong engineering maturity to interviewers.Where is it Used?
2. Mental Model
Imagine a Chef in a Restaurant Kitchen.
When a customer orders a dish, a master chef doesn't start throwing random ingredients into a hot pan! 1. They read the order carefully (Are there allergies? Is it gluten-free?). 2. They check the ingredients on hand. 3. They plan the recipe steps in their head. 4. Only then do they turn on the stove and start cooking.
In software, jumping straight to code is like throwing raw food into a fire without a recipe—it usually burns! The Problem Solving Framework is your master recipe.
3. Concept: The 8-Step Framework
Here is the exact step-by-step framework to approach any coding problem:
Step 1: Understand the Problem
Read the problem twice. Rephrase the goal in your own words. Identify what data comes in (inputs) and what result must go out (outputs).Step 2: Explore Concrete Examples
Work through small, manual examples on paper.Step 3: Break Down the Goal
Identify the constraints. Ask clarifying questions:Step 4: Start with a Brute Force Solution
Always state the simplest solution first, even if it is slow (like using nested loops). This proves you can solve the problem and gives you a baseline to improve upon.Step 5: Optimize the Strategy
Ask: "Where is the bottleneck in my brute force solution?"Step 6: Write Pseudocode / Outline the Steps
Write plain English steps before touching syntax. This structures your logic without worrying about language syntax errors.Step 7: Implement Clean Code
Translate your pseudocode into code. Use clear variable names (leftPointer, currentSum), modular structure, and guard clauses for invalid inputs.
Step 8: Walkthrough & Test Edge Cases
Dry-run your code with an example using line-by-line tracing. Check:null, [], "")i <= n vs i < n)4. Visuals
Framework Comparison: Unstructured vs Structured
| Step | Unstructured Approach (Fails) | Structured Framework (Succeeds) |
|---|---|---|
| 0 - 2 min | Start typing code immediately | Read prompt, rephrase goal, clarify constraints |
| 2 - 10 min | Get stuck on syntax / logic bugs | Work out small examples manually on paper |
| 10 - 20 min | Re-write code 3 times in panic | State brute force, then optimize using patterns |
| 20 - 30 min | Code fails on hidden edge cases | Write clean code, dry-run with test cases |
5. Real-World Examples
6. Interview Perspective
How Interviewers Ask This Topic
Interviewers deliberately give underspecified or ambiguous problem statements (e.g., "Find two numbers that add up to a target"). They are waiting to see if you ask questions before coding!Common Mistakes
Warning: 1. Silent Coding: Typing for 10 minutes without speaking. Interviewers cannot grade your thought process if you stay silent.
> 2. Ignoring Constraints: Not checking if numbers can be negative, leading to broken assumptions.
> 3. Giving Up on Brute Force: Refusing to state a simple O(N²) solution because you think it's "too easy," ending up with 0 working code.