This repository is a modern C++ interview preparation toolkit, designed to deepen the understanding of core C++ concepts through clean, from-scratch implementations of data structures, concurrency primitives, smart pointers, metaprogramming techniques and more. It is organized to mirror the themes commonly explored in interviews, while encouraging a deeper grasp of language internals and performance considerations. In addition to the code, it includes a curated “References & Further Reading” section that maps out books, blogs, and documentation for going deeper into modern C++, systems programming, performance, networking, concurrency, and algorithms.
Header-only library code, organized by topic.
Custom STL-like containers that exercise memory management, iterators, and algorithmic behavior:
Array,Vector,StringList,ForwardListHashMap(chaining) andOpenAddressingHashMapSPSCQueuefor single-producer/single-consumer scenarios
Basic synchronization primitives implemented manually to understand low-level threading:
Mutex(POSIX-based)SpinLock(busy-wait locking)
Custom smart pointer implementations that mimic unique_ptr, shared_ptr, and related semantics:
UniquePtrSharedPtrWeakPtr
A collection of classical sorting algorithms (e.g., quicksort, mergesort, heapsort) implemented with a focus on clarity and performance trade-offs.
Miscellaneous utilities showcasing advanced language features:
Any.hpp: type-erasure containerCompileTimeFunctions.hpp: template metaprogramming andconstexprexplorationmove_semantics.hpp:move/forwardhelpers and move-semantics experiments
Small C++ programs that exercise and test some of the headers in include/. These files serve as usage examples and lightweight tests (for example, metafunctions_test.cpp for the metaprogramming utilities).
A collection of PDF question-and-answer sets. The questions are a mix of those that were asked in real interviews (either to me personally or sourced online) and ones I created while studying specific topics. They are organized as themed sheets you can skim or drill through before an interview:
- C++ language and modern C++ features
- Operating systems and computer architecture (processes, scheduling, memory, synchronization, etc.)
- Networking (sockets, TCP/UDP, protocols, latency, etc.)
I’ll keep adding new questions and answers as I read more resources on these topics.
CMake build configuration for generating project files and building the code.
This project is not meant to replace the STL. Instead, it is a learning environment to:
- Reinforce your understanding of core data structures by re-implementing them in a simple way.
- Explore concurrency and memory models at a low level.
- Practice template metaprogramming and compile-time techniques.
- Build interview-ready intuition through hands-on coding rather than rote memorization.
cmake -S . -B build
cmake --build buildYou can include individual headers in your own C++ test files or use the provided tests.hpp for quick experimentation.
This section collects focused resources on modern C++, systems programming, performance, networking, concurrency, and algorithms. It’s meant as a concise “reading map” for going beyond syntax into how real machines behave, how production C++ is designed and optimized, and how to reason about trade-offs that matter both in interviews and in real-world systems.
-
Effective Modern C++ — Scott Meyers — Item-based guidelines for C++11/14 that teach how to use move semantics, smart pointers, lambdas, auto, and concurrency correctly and idiomatically.
-
C++ Templates: The Complete Guide (2nd Edition) — David Vandevoorde, Nicolai M. Josuttis, Douglas Gregor — Definitive deep dive into templates, from basic syntax to type traits and template metaprogramming, essential for understanding modern generic C++ code.
-
The C++ Programming Language (3rd Edition) — Bjarne Stroustrup — Comprehensive tour of the C++ language and standard library from its creator, ideal as a foundational reference and big-picture overview.
-
C++ High Performance, Second Edition: Master the art of optimizing the functioning of your C++ code — Focuses on writing cache-friendly, branch-efficient, and scalable C++ code, with practical coverage of profiling, memory behavior, concurrency, and low-level tuning.
-
Beautiful C++ — Emphasizes clear, expressive, and maintainable modern C++ design, showing how to combine language features and idioms to produce elegant, robust code.
-
C++ Software Design — A systems-level look at structuring C++ codebases: interfaces, boundaries, testability, and architecture patterns tailored to large C++ projects.
-
Computer Architecture: A Quantitative Approach (6th Edition) — Classic reference on CPU and system design, using real quantitative data to explore pipelining, caches, memory hierarchies, and parallelism.
-
Computer Systems: A Programmer's Perspective (2nd Edition) — Bridges the gap between hardware, compilers, and OSes, explaining how data representation, the memory hierarchy, linking, and concurrency affect real programs.
-
Operating Systems: Three Easy Pieces — Concept-driven OS textbook organized around virtualization, concurrency, and persistence, with approachable explanations and hands-on projects.
-
TCP/IP Illustrated, Volume 1: The Protocols (2nd Edition) — Packet-level exploration of the TCP/IP stack, illustrating how protocols like IP, TCP, and UDP really behave on the wire with detailed traces and examples.
-
Computer Networks: A Systems Approach — A systems-oriented networking textbook that explains the Internet stack from links and switching up through routing, congestion control, and applications, with a strong focus on design principles, trade-offs, and real-world protocol behavior.
-
Concurrency in Action — Anthony Williams (2nd Edition) — The go-to guide for C++ concurrency primitives (threads, mutexes, atomics, futures) and patterns for writing correct, modern multithreaded C++ code.
-
High Performance Parallelism Pearls Volume One: Multicore and Many-core Programming Approaches — Collection of case studies on extracting performance from multicore CPUs and accelerators, covering practical parallelization techniques and real-world workloads.
-
Concurrency with Modern C++ — Modern C++11–20 treatment of concurrency and parallelism, including threads, tasks, futures, lock-free techniques, and higher-level patterns for scalable systems.
- Introduction to Algorithms (3rd Edition) — Comprehensive algorithms textbook (CLRS) covering data structures, graph algorithms, dynamic programming, and complexity analysis with mathematically rigorous treatments.
- The Linux Command Line: A Complete Introduction (2nd Edition) — A hands-on introduction to the Unix shell that takes you from basic commands and pipelines to shell scripting, job control, and everyday CLI workflows, giving you the practical foundation needed to be productive and confident on Linux systems.
- Trading Systems Developer Interview Guide — A focused collection of real-world trading-systems interview questions and answers, with heavy emphasis on low-latency engineering, C++ performance fundamentals (memory/layout, concurrency), market microstructure basics, and the practical system-design tradeoffs you’re expected to reason about in HFT-style roles.
-
Herb Sutter’s Blog — Language evolution and modern best practices.
-
Guru of the Week (GotW) — Guru of the Week (GotW) is a series of C++ programming problems created and written by Herb Sutter.
-
Agner Fog's Blog — A bit on the advanced side. Contains a plethora of tips/advices for low-level optimization.
-
rigtorp.se — A blog by Erik Rigtorp featuring deep dives into performance, benchmarking, data structures, and low-level C++ techniques.
-
Johnny’s SW Lab – Performance — Blog posts focused on software performance, profiling techniques, and low-level optimization in C++ and systems development.
-
Preshing – Blog — A blog by Jeff Preshing covering algorithms, lock-free data structures, concurrency, and systems-level programming insights.
-
Matt Godbolt’s Blog (xania.org) — Posts on C++ tooling and performance, plus practical insights from building Compiler Explorer and exploring code generation.
-
What Every Programmer Should Know About Memory — Ulrich Drepper’s classic deep dive into RAM, CPU caches, NUMA, and how modern memory hierarchies affect performance and correctness. A must-read if you care about writing cache-friendly, high-performance C/C++ and systems code.
-
Beej's Guide to Network Programming — A practical, conversational introduction to Unix/POSIX socket programming in C, covering TCP/UDP, IPv4/IPv6, and select/poll/epoll with lots of examples.
-
What Every Computer Scientist Should Know About Floating-Point Arithmetic — David Goldberg’s definitive tutorial on IEEE 754, rounding, cancellation, and numerical error. Essential to understand why floats “behave weirdly” and how to write numerically robust code.
-
IEEE754 — William Kahan’s lecture notes on the design and status of the IEEE 754 floating-point standard, with historical context, rationale, and many subtle corner cases from the person most associated with the standard.
-
C++ Design Patterns for Low-latency Applications Including High-frequency Trading — A research-driven overview of C++ design patterns and techniques for ultra-low-latency systems (e.g., HFT), covering cache-aware design, lock-free patterns, and practical performance tuning backed by benchmarks.
-
CppReference — Authoritative reference for the standard library and language features.
-
LINUX Man Pages — Official and comprehensive reference for Linux system calls, library functions, and interfaces.
-
ISO C++ Drafts — For exploring the language standard.
-
Compiler Explorer — Visualize template instantiations, optimizations, and generated assembly.
-
LearnCpp — Good place to start reviewing basic C++ concepts.
-
getcracked.io — Repository of technical interview questions spanning data structures, algorithms, system design, and more.