>RunTimeFix
BookStudyPracticeInterviewsYouTubeCoursesAbout
Log inGet Started
>RunTimeFix

Practical programming education. Books, videos, courses, and hands-on learning for competitive programming, DSA, and software engineering.

RunTimeFix

  • About
  • YouTube
  • Book
  • Study Library
  • Courses

Learn

  • Competitive Programming
  • DSA
  • Development
  • Databases

Legal

  • Privacy
  • Terms
  • Refund Policy

RunTimeFix — debug → solve → run

© 2026 RunTimeFix. All rights reserved.

RunTimeFix

fn solve(n: i32) -> i32 {
  if n < 2 { return n; }
  let (a, b) = (0, 1);
  for _ in 0..n {
    (a, b) = (b, a + b);
  }
  b
}

Master Competitive Programming with C++

RunTimeFix

Free · Part 1 of 3 · 272 pages

175 downloads

Master Competitive Programming with C++

by RunTimeFix

From LeetCode to Codeforces — build the algorithmic intuition that separates elite competitors from everyone else.

A practical, no-fluff guide to competitive programming. Instead of reciting definitions, this book teaches you how to think about problems: recognizing patterns, proving complexity, and translating insight into clean, fast C++ code.

Sign Up to Download Free Book

Free account required. PDF, 272 pages · ~4 MB.

Who this book is for

  • Self-taught developers who keep hitting a wall with harder problems
  • Students preparing for FAANG interviews or ICPC-style contests
  • Anyone who wants to write code that is both correct and fast

What you'll learn

  • Time and space complexity — read any algorithm like a compiler
  • The core data structures and when each one wins
  • Binary search, two pointers, sliding window and prefix sums
  • Graphs: BFS, DFS, Dijkstra and shortest paths done right
  • Dynamic programming from the ground up

Book series

3 parts — Part 1 is free

Start with Part 1 for free. Later parts go deeper into the algorithms and strategy that win rated contests.

Part 01Free

Master Competitive Programming with C++

From LeetCode to Codeforces — build the algorithmic intuition that separates elite competitors from everyone else.

272 pages

Sign Up
Part 02Coming soon

Master Competitive Programming with C++ — Part 2

Segment trees, Fenwick trees, advanced DP, and the algorithms that decide rated contests.

Pages TBD

Coming soon
Part 03Coming soon

Table of contents

30 chapters, taken straight from the book's index — written to be read front to back, each one builds on the last.

  1. 01

    C++ Foundations & Input/Output

    Program Structure & Compilation · Variables & Data Types · Arithmetic Operations & Modulo · Integer Overflow & The 1LL Trick · Input/Output Streams & Fast I/O · Conditionals & Logical Operators

  2. 02

    Loops & Direct Simulations

    The Three Loop Structures · Loop Controls: break & continue · Nested Loops · Core Loop Patterns

  3. 03

    Arrays, Strings & Character Operations

    1D Arrays (C-Style) · 2D Arrays & Row-Major Layout · std::string & Character Operations

  4. 04

    Functions & Recursion

    Function Mechanics & Variable Scope · Parameter Passing: Value vs. Reference · Recursion & the Call Stack

  5. 05

    Strings & Character Operations

    std::string in C++ · Character Operations & ASCII Mathematics

  6. 06

    Structs, Lambdas & Structured Bindings

    Structures (Structs) in C++ · Lambdas & Inline Comparators · auto & Structured Bindings (C++17)

Frequently Asked Questions

Is the book really free?+
Yes — Part 1 (272 pages, 30 chapters) is completely free. You just need a free RunTimeFix account to download the PDF.
What does the book cover?+
Everything from C++ foundations and I/O to advanced graph algorithms (Dijkstra, MST, LCA), dynamic programming, segment trees, and contest strategy. It's designed to be read front to back.
  • How to practice deliberately and climb Codeforces ratings
  • Master Competitive Programming with C++ — Part 3

    Graph theory mastery, flows, and the contest-strategy playbook for climbing ratings.

    Pages TBD

    Coming soon
  • 07

    Preprocessor, Debug Macros & Compilation

    The C++ Preprocessor & Macros · Compilation Pipeline & G++ Compiler Flags

  • 08

    Vectors, Pairs & Utility Algorithms

    std::vector — The Dynamic Array · std::pair — Grouping Two Values · std::tuple — Grouping Three or More Values (D1) · String STL Methods (Advanced) · Iterators — The Bridge Between Containers and Algorithms · Utility Algorithms

  • 09

    Sets, Maps & Multi-Containers

    std::set — Ordered Unique Elements · std::multiset — Ordered Elements with Duplicates · std::map — Key-Value Associations · std::unordered_map & std::unordered_set — Hash-Based Containers · std::stack — LIFO Container Adapter · std::queue — FIFO Container Adapter · std::deque — Double-Ended Queue · std::priority_queue — Heap-Based Container

  • 10

    Sorting & Frequency Arrays

    std::sort — The Workhorse · lower_bound & upper_bound — Binary Search in STL · binary_search — Boolean Existence Check · unique — Removing Consecutive Duplicates · next_permutation — Generating Permutations · Sorting Applications · Frequency Counting

  • 11

    Complexity & Problem Solving

    Reading Problem Statements · Complexity Analysis · Brute Force · Observation Finding · Edge-Case Handling · Debugging Techniques · Stress Testing

  • 12

    Basic Number Theory & Modular Arithmetic

    Divisibility · GCD & LCM · Primes & Primality Testing · Sieve of Eratosthenes · Prime Factorization · Divisor Enumeration · Modular Arithmetic · Binary Exponentiation · Parity Arguments · Sum Formulas

  • 13

    Prefix Sums & Difference Arrays

    1D Prefix Sums · 2D Prefix Sums · Suffix Sums & Suffix Aggregates · Difference Arrays

  • 14

    Two Pointers & Sliding Window

    Two Pointers (Opposite Direction) · Two Pointers (Same Direction) · Sliding Window (Fixed Size) · Sliding Window (Variable Size)

  • 15

    Binary Search (Array & Answer Space)

    Binary Search on a Sorted Array · STL Binary Search Functions · Binary Search on the Answer · Boundary Handling

  • 16

    Greedy Algorithms & Constructive Problems

    The Greedy Paradigm · Sorting-Based Greedy · Interval Scheduling (Activity Selection) · The Exchange Argument · Constructive Algorithms

  • 17

    Bit Manipulation & Masking

    Bitwise Operators · Bit Tricks · XOR Properties · Bitmask Enumeration · __builtin Functions

  • 18

    Stacks, Queues & Monotonicity

    Stack Applications · Queue Applications · Monotonic Stack · Monotonic Deque (Sliding Window Min/Max)

  • 19

    Disjoint Set Union (DSU)

    The Problem DSU Solves · Naive Implementation · Optimization 1: Path Compression · Optimization 2: Union by Rank/Size · Component Queries

  • 20

    Coordinate Compression, Fenwick Tree & Segment Tree

    Coordinate Compression · Fenwick Tree (Binary Indexed Tree) · Segment Tree · Sparse Table (D1 — Recognition)

  • 21

    Graph Representation, DFS & BFS

    Graph Terminology · Graph Representation · DFS on Graphs · BFS on Graphs · Connected Components · Grid Traversal

  • 22

    Cycle Detection, Bipartite Checking & Topological Sort

    Cycle Detection in Undirected Graphs · Cycle Detection in Directed Graphs · Bipartite Checking · Topological Sort · DAG Reasoning · Functional Graphs

  • 23

    Dijkstra, 0-1 BFS & Kruskal's MST

    Dijkstra's Algorithm · 0-1 BFS · Minimum Spanning Tree — Kruskal's Algorithm

  • 24

    Rooted Trees — DFS, Subtree Size & Diameter

    Tree Terminology · Rooting a Tree · Tree Diameter · Distance Between Two Vertices · Tree Algorithms: Summary of Techniques

  • 25

    Binary Lifting, LCA & Euler Tour

    Binary Lifting · Lowest Common Ancestor (LCA) · Euler Tour

  • 26

    Dynamic Programming — Foundations

    The DP Paradigm · The DP Recipe · Classic DP Problems · Longest Increasing Subsequence (LIS) · Maximum Subarray Sum (Kadane's Algorithm)

  • 27

    Dynamic Programming — Knapsack & Subsets

    The 0-1 Knapsack Problem · Unbounded Knapsack · Subset Sum & Knapsack Variants · Bitmask DP

  • 28

    Backtracking & Meet-in-the-Middle

    The Backtracking Template · Generating Combinatorial Objects · Pruning · Meet-in-the-Middle

  • 29

    Modular Inverse, Combinatorics & Fast Math

    Modular Multiplicative Inverse · Combinatorics: C(N, K) mod M · Common Combinatorial Problems · Matrix Exponentiation (Fast Math)

  • 30

    Hashing, String Algorithms & Geometry Basics

    Polynomial Rolling Hashing · The Trie (Prefix Tree) · Geometry: The Cross Product · Book 1 Conclusion

  • Sign Up to Download Free Book
    Do I need prior programming experience?+
    Basic familiarity with any programming language helps, but Chapter 1 starts from C++ fundamentals. The book is structured to be self-contained.
    Will there be more parts?+
    Yes — Part 2 (advanced data structures and DP) and Part 3 (graph theory mastery and contest strategy) are planned. Part 1 readers will be notified when they launch.
    Can I use this book for interview preparation?+
    Absolutely. The topics covered (arrays, strings, trees, graphs, DP, binary search) align directly with FAANG-style coding interview questions.