A pattern-first interview workbook

Reasoning Into Code

250 deliberate katas for coding interviews.

Understanding an algorithm and writing it correctly are different skills. This book builds the bridge: define the state, name the invariant, write the protocol, trace the transitions, then turn the reasoning into executable Python.

Arunank Divya Sharan · First edition · September 2026

complete lessons
250
ordered modules
25
PDF pages
955

Inside every lesson

A precise question

An explicit contract, constraints and concrete input/output examples.

A reasoning protocol

State, invariants, safe updates and the bridge from pseudocode to code.

A visible execution

Diagrams and worked traces that show how the state changes.

A complete reference

Python implementation, correctness argument, complexity, pitfalls and a reasoning card.

One deliberate progression

The original problem order is preserved. Later lessons build on the habits established earlier.

01–06

Learn to express state

Scans, hashing, sorting, two pointers, sliding windows and prefix state.

07–12

Control the frontier

Stacks, queues, heaps, intervals, linked lists and binary search.

13–18

Traverse and decompose

Matrices, grids, recursion, backtracking, trees and tries.

19–25

Connect the patterns

Graphs, union-find, greedy choices, dynamic programming, bits and designed structures.

See all 25 modules

Start with one problem

Read the question first. Try the solution before opening the explanation, then compare your state and transitions with the trace.