Problem Solving Method
Reading problems, constraints, observations, proofs, testing, debugging, and practice.
-
Reading The Problem & Restating It
Restating the problem, separating what is given from what is asked, hidden constraints, and working the example by hand.
-
From Constraints To A Complexity Budget
Reading n and the time limit, operations-per-second budgets, the n-to-complexity table, and overflow.
-
Finding The Observation
Small cases, working backwards, reformulating, symmetry, relaxing a constraint, and counting from the other side.
-
Invariants, Monovariants & Proof Sketches
Loop invariants, exchange arguments, induction, monovariants, and finding counterexamples.
-
Choosing The Data Structure
Picking a structure from the operations you need: ordered vs unordered, heaps vs sorted arrays, and queries vs updates.
-
Edge Cases, Assertions & Stress Testing
Edge cases, assertions, random small tests, comparing against brute force, and shrinking a failing case.
-
Debugging A Wrong Answer
Reading the verdict, bisecting the code, common bug families, and when to rewrite.
-
How To Practice
Difficulty just above your level, time boxes, implementing what you read, and mixing random and topic practice.
-
The Interview Round Itself
Clarifying, stating the brute force, optimizing, explaining tradeoffs, taking hints, and testing before you finish.
Up next
22 of 22 questions here are still unsolved.