Phase 13 — Frontier: Advanced Search & Large-Number Algorithms

Read this before doing anything in this phase.

This phase sits beyond Phase 12. Where Phase 12 covers Codeforces/ICPC material, this phase covers two families that appear in even narrower contexts:

  1. State-space search at astronomical scale — solving problems whose state graphs have 10^13 to 10^19 nodes (15-puzzle, Rubik’s Cube) via IDA*, pattern databases, bidirectional search, coordinate compression of group elements, and exact-cover machinery.
  2. Large-number algorithms — arbitrary-precision arithmetic, fast primality testing and factorization at 64-bit scale, modular systems, discrete logarithms, and computing the 10^18-th term of a recurrence.

The audience:

  • Puzzle/robotics/planning engineers (motion planning, combinatorial solvers)
  • Cryptography engineers and researchers (the number-theory half is their bread and butter)
  • Quant developers at the most algorithmic desks
  • Competitive programmers past ICPC regionals
  • Engineers interviewing at companies that ship solvers (SAT/SMT, OR, scheduling, chip placement)
  • Anyone asked “how would you solve a Rubik’s Cube optimally?” and expected to answer for real

If you are not on this list, skip this phase entirely. The opportunity cost argument from the Phase 12 README applies with double force here.


When to Use This Phase

Use this phase if all are true:

  1. You have completed Phases 1–11 (and the relevant parts of 12) and pass mocks at your target level.
  2. The role explicitly involves search, solvers, cryptography, or number-theoretic code.
  3. You have months, not weeks, before the interview.
  4. You genuinely enjoy this material — at this depth, motivation is the binding constraint.

When to Skip This Phase

Skip if any is true:

  • You are interviewing for any standard SWE role at any level, including staff+ at FAANG.
  • You haven’t finished Phase 12’s relevant labs (FFT is a prerequisite for two labs here).
  • You are behind on Phase 10 (testing) or Phase 11 (mocks). Those decide offers; this does not.

What’s In This Phase

LabTopicWhen it appears
01IDA* & Pattern Databases (15-puzzle)Planning/robotics, search research, game AI
02Kociemba’s Two-Phase Algorithm (Rubik’s Cube)Puzzle solvers, group-theoretic search, robotics demos
03Bidirectional BFS on Implicit GraphsWord Ladder-class problems; the one lab here FAANG does ask
04Algorithm X & Dancing Links (Exact Cover)Sudoku/tiling solvers, OR, constraint solving
05Big-Integer Arithmetic & KaratsubaRuntime/library engineering, “how does Python multiply big ints?”
06Miller-Rabin & Pollard’s RhoCryptography, CTF, Project Euler-grade number theory
07Extended Euclid, Modular Inverse & CRTCryptography, competitive programming staple
08Discrete Logarithm: Baby-Step Giant-StepCryptography interviews, CTF
09Matrix Exponentiation & Linear RecurrencesCompetitive programming regular, quant
10Exact TSP: Held-Karp & Branch-and-BoundOR/logistics, bitmask-DP interviews (LC Hard)

Each lab uses the standard 23-section format plus the “When to Skip This Topic” section, same as Phase 12.

Dependency notes:

  • Lab 01 → Lab 02: Kociemba is IDA* + pattern-database ideas applied twice. Do 01 first.
  • Lab 03 is the most interview-relevant lab in the phase (Word Ladder is a genuine FAANG question) — if you cherry-pick one, pick it.
  • Labs 05–08 form a number-theory sequence; Phase 7 Labs 01–03 (modular arithmetic, binary exponentiation, sieve) are prerequisites.
  • Phase 12 Lab 07 (FFT) pairs with Lab 05 (the multiplication ladder) and Lab 07 (Garner reconstruction).

How to Use This Phase

  1. Read this README in full.
  2. Search your target job descriptions for: solver, planning, search, cryptography, number theory, optimization, exact algorithms.
  3. Cherry-pick matching labs. Doing the whole phase end-to-end is almost never the right call.
  4. Exception: Lab 03 (bidirectional BFS) and Lab 09 (matrix exponentiation) are cheap and general enough to justify for anyone doing Phase 12.

Realistic Expectations

  • Kociemba’s algorithm will almost certainly never be an interview question. Its value is that implementing it forces mastery of state encoding, admissible heuristics, precomputed tables, and search pruning — the transferable skill set behind every hard search problem.
  • The number-theory labs (05–08) do get asked nearly verbatim in cryptography-adjacent roles and CTF-style screens.
  • This phase, like Phase 12, is not graded against the standard passing bar. It is deep-end material for a small group.

If you’re here to procrastinate Phase 10 or 11 — stop. That’s the failure mode that costs offers.


After This Phase

There is no Phase 14. If you complete the labs relevant to your target role, return to Phase 11 and convert the depth into mock performance.