C++ practice
0 exercises and 185 quizzes from the lessons of this track. Sample tests run in your browser; what you pass is kept in this browser only.
Start here: toolchains, compiling and first programs
- Quiz: What C++ is used for today and how to learn it
- Quiz: Install a C++23 compiler on Windows, macOS or Linux
- Quiz: How C++ compiles: preprocess, compile and link
- Quiz: Compiler flags every C++ learner should use
- Quiz: Reading C++ compiler errors and fixing old code
- Quiz: Console I/O in C++: cin, cout, print and println
- Quiz: C++ program structure, naming and formatting
Types, values and expressions
- Quiz: Variables and initialisation: =, () and {}
- Quiz: C++ fundamental types: integers, floats, char, bool
- Quiz: Integer overflow and signed/unsigned conversions
- Quiz: Floating-point precision and comparison in C++
- Quiz: C++ operators, precedence and integer division
- Quiz: Why i++ + ++i has no single answer in C++
- Quiz: C++ bitwise operators and the <bit> header
- Quiz: C++ const, constexpr, consteval and constinit
- Quiz: C++ auto, decltype and type aliases
- Quiz: std::string and std::string_view
- Quiz: UTF-8, Unicode and text encodings in C++
- Quiz: C++ enums: enum class and std::to_underlying
Control flow
Functions, files and scope
- Quiz: C++ functions: declarations, definitions, returns
- Quiz: C++ command-line arguments and exit codes
- Quiz: C++ pass by value, reference or const reference
- Quiz: C++ function overloading and default arguments
- Quiz: Recursion and the call stack in C++
- Quiz: C++ header files and the one-definition rule
- Quiz: C++ preprocessor and feature-test macros
- Quiz: Scope, storage duration, linkage and namespaces
- Quiz: C++ lambdas: captures and generic lambdas
- Quiz: Function pointers, functors and std::function
Arrays, vectors and aggregate types
- Quiz: std::vector: the container to reach for first
- Quiz: std::array, C arrays and array decay
- Quiz: C-style strings and why std::string replaced them
- Quiz: 2D grids in C++: flat storage and std::mdspan
- Quiz: C++ structs, aggregates and designated initialisers
- Quiz: std::pair, std::tuple and structured bindings
- Quiz: std::optional, std::variant and std::any
References, pointers and memory
- Quiz: C++ references: lifetime extension and dangling
- Quiz: C++ pointers: addresses, dereferencing, nullptr
- Quiz: Pointer arithmetic, arrays and std::span
- Quiz: Dynamic memory in C++: new, delete and leaks
- Quiz: Object lifetime and undefined behaviour in C++
- Quiz: Memory layout: sizeof, alignment and padding
- Quiz: Finding memory bugs with AddressSanitizer and UBSan
- Quiz: C++ memory-bug hunt: ten broken programs
Classes, objects and RAII
- Quiz: C++ classes, member functions and access control
- Quiz: Constructors, member initialiser lists and explicit
- Quiz: Brace initialisation and initializer_list traps
- Quiz: Destructors and RAII in C++
- Quiz: The rule of zero, three and five in C++
- Quiz: C++ operator overloading and the spaceship operator
- Quiz: Printable types: operator<< and std::formatter
- Quiz: C++ static members, friends and nested types
- Quiz: Deducing this: explicit object parameters in C++23
- Quiz: Designing value types and strong types in C++
Inheritance and polymorphism
- Quiz: Inheritance in C++: base and derived classes
- Quiz: Virtual functions, override and virtual destructors
- Quiz: Abstract classes and interfaces in C++
- Quiz: Multiple inheritance, the diamond and virtual bases
- Quiz: C++ casts and run-time type information (RTTI)
- Quiz: Alternatives to inheritance: variant, composition
Templates and concepts
- Quiz: C++ function templates and argument deduction
- Quiz: Class templates and argument deduction (CTAD)
- Quiz: Non-type and template template parameters
- Quiz: C++ template specialisation and overloading
- Quiz: Variadic templates and fold expressions
- Quiz: C++20 concepts and requires-clauses
- Quiz: Type traits, if constexpr and reading SFINAE code
- Quiz: Compile-time programming with constexpr
- Quiz: Templates in practice: build time and binary size
Standard containers
- Quiz: Choosing a C++ container: complexity and speed
- Quiz: std::deque, std::list and iterator invalidation
- Quiz: std::map, std::set and custom comparators
- Quiz: std::unordered_map, hashing and iteration order
- Quiz: std::flat_map and std::flat_set (C++23)
- Quiz: std::stack, std::queue and std::priority_queue
- Quiz: std::bitset and the std::vector<bool> trap
- Quiz: Parsing strings in C++ with std::from_chars
- Quiz: C++26 preview: inplace_vector and hive
Iterators, algorithms and ranges
- Quiz: C++ iterators, iterator categories and sentinels
- Quiz: Essential C++ algorithms: find, sort, partition
- Quiz: C++ <numeric>: accumulate, reduce, prefix sums
- Quiz: C++ range algorithms and projections
- Quiz: C++ views and pipelines: filter, transform, iota
- Quiz: C++23 range adaptors and compiler support
- Quiz: Writing your own C++ ranges and views
- Quiz: C++ parallel algorithms and execution policies
- Quiz: Benchmarking C++ code honestly
Move semantics and smart pointers
- Quiz: C++ value categories, std::move and copy elision
- Quiz: Writing move constructors and move assignment
- Quiz: Forwarding references and perfect forwarding
- Quiz: std::unique_ptr: exclusive ownership
- Quiz: std::shared_ptr and std::weak_ptr
- Quiz: Expressing ownership in C++ function signatures
- Quiz: Memory-bug hunt: ownership and use-after-move
Error handling
Input/output, files, formatting and time
Build systems, testing and tooling
- Quiz: CMake for C++: targets, properties and presets
- Quiz: Static and shared libraries in C++
- Quiz: Unit tests with GoogleTest or Catch2 and CTest
- Quiz: vcpkg and Conan: C++ dependency management
- Quiz: clang-tidy, clang-format and static analysis
- Quiz: Debugging C++ with LLDB and GDB
- Quiz: Sanitizer and hardened C++ build presets
- Quiz: Profiling C++: finding where the time goes
- Quiz: Portability across compilers, platforms and judges
Concurrency: threads, atomics and the memory model
- Quiz: Threads with std::thread and std::jthread
- Quiz: Data races, mutexes and lock guards in C++
- Quiz: C++ condition variables and producer-consumer queues
- Quiz: std::async, futures and promises
- Quiz: C++ atomics, compare-exchange and atomic waiting
- Quiz: The C++ memory model and memory orders
- Quiz: Latches, barriers and semaphores (C++20)
- Quiz: Building a thread pool in C++
- Quiz: Concurrency-bug hunt: races and deadlocks
Modules and coroutines
- Quiz: C++20 modules: export, import and partitions
- Quiz: import std in C++23: which toolchains support it
- Quiz: Migrating a C++ project to modules
- Quiz: C++ coroutines: co_await, co_yield and co_return
- Quiz: Generators: std::generator and writing your own
- Quiz: Async coroutines: tasks, awaitables, event loops
C++26 previews: reflection, contracts and safety
- Quiz: What is in C++26 and which compilers support it
- Quiz: C++26 reflection basics: ^^ and splicing
- Quiz: C++26 reflection: enum names and serialisation
- Quiz: C++26 annotations: generating code from structs
- Quiz: C++26 contracts: pre, post and contract_assert
- Quiz: C++26 erroneous behaviour and library hardening
- Quiz: C++26 library previews: simd, function_ref and more
- Quiz: C++26 std::execution: senders and receivers
- Quiz: Smaller C++26 language features you can use now
C++ for DSA and competitive programming
- Quiz: Online judge C++ compilers, flags and limits
- Quiz: A clean C++ contest template, and habits to avoid
- Quiz: Fast C++ input and output for online judges
- Quiz: The STL toolkit for DSA in C++
- Quiz: Custom comparators and strict weak ordering
- Quiz: C++ binary search: lower_bound and partition_point
- Quiz: Overflow, __int128 and modular arithmetic
- Quiz: C++ unordered_map: custom hashes and anti-hash tests
- Quiz: Order-statistics trees with __gnu_pbds (GCC only)
- Quiz: Deep recursion, stack limits and iterative DFS
- Quiz: Stress testing contest solutions in C++
Systems programming with C++
- Quiz: Calling C from C++ (and C++ from C)
- Quiz: POSIX in C++: files, pipes and child processes
- Quiz: TCP sockets in C++: client and server on localhost
- Quiz: Event loops in C++: poll, kqueue and epoll
- Quiz: Memory-mapped files in C++: mmap and binary formats
- Quiz: Custom allocators and std::pmr memory resources
Embedded C++
- Quiz: Embedded C++: freestanding, no exceptions, no heap
- Quiz: Cross-compiling for Arm Cortex-M and running in QEMU
- Quiz: Memory-mapped registers and volatile in C++
- Quiz: Interrupt-safe ring buffers in embedded C++
- Quiz: Fixed-point arithmetic in C++ firmware
- Quiz: State machines for firmware in C++
- Quiz: Testing firmware logic on your laptop
- Quiz: Safety-critical C++ and MISRA C++:2023
C++ for game development
Design, idioms and maintainable C++
- Quiz: C++ idioms: scope guards and pimpl
- Quiz: Type erasure in C++: how std::function works
- Quiz: CRTP, mixins and static polymorphism
- Quiz: Classic design patterns in modern C++
- Quiz: Composition, aggregation and association in C++
- Quiz: C++ API design, versioning and ABI stability
- Quiz: Testing C++: fakes, property tests, golden files
- Quiz: Reading and modernising legacy C++
Interview preparation and capstone projects
Results here are what this browser has checked: feedback for you, not proof. They stay on this device; your Learn progress can be exported to a file. · Back to the C++ track