C++ Typing Speed Test
Modern C++ prefixes half its vocabulary with `std::` and nests templates inside templates. If `std::vector<std::pair<int, std::string>>` makes your fingers seize up, these drills will fix that.
Namespace Prefixes and Template Nesting
The `std::` prefix — five characters including a doubled shifted colon — precedes nearly every standard library name, making it the most repeated chunk in modern C++. Template angle brackets nest deeply (`std::map<std::string, std::vector<int>>`), and the closing `>>` sequence demands precise Shift-period double-strikes. Scope resolution (`::`), member access (`.` and `->`), and stream operators (`<<`, `>>`) each add doubled-symbol patterns.
C++11 onward layered in lambdas (`[](const auto& x) { ... }`), which open with a bracket pair in a position no other construct uses, plus `&` and `*` inherited from C. Smart pointers wrap types in more angle brackets (`std::make_unique<HttpServer>(8080)`). Drilling real STL and RAII code builds tolerance for the language's unmatched symbol density.
Key Drills for C++:
- std:: as one chunk: Type the namespace prefix as a single five-key burst. Hesitating on `::` doubles your cost on every line.
- Close your templates: Nested generics end in `>>` or `>>>`. Drill consecutive Shift-period strikes without releasing rhythm.
- Lambda openers: The `[](` sequence is unique to lambdas. Chunk bracket-bracket-paren so closures start instantly.
Sample Drill: Vectors & Range Loops
STL vector with emplace_back and range-based iteration.
std::vector<std::string> names;
names.emplace_back("Ada");
names.emplace_back("Linus");
for (const auto& name : names) {
std::cout << name << '\n';
}
All 15 C++ Drills
Every session picks a random drill from this pool. Use the difficulty filter above to stay on easy warm-ups or jump straight to the hard ones.
-
Vectors & Range Loops easy
STL vector with emplace_back and range-based iteration.
-
Counting with unordered_map easy
Tally word frequencies using operator[] default insertion.
-
Sorting with a Lambda easy
Sort a vector of structs by a member using a comparator lambda.
-
Structured Bindings easy
Iterate a std::map and unpack each key-value pair by name.
-
Returning std::optional easy
Signal a missing search result with std::nullopt instead of -1.
-
Smart Pointers & RAII medium
Managing ownership with unique_ptr and make_unique.
-
Splitting a string_view medium
Split text on a delimiter into non-owning string_view pieces.
-
Catching Exceptions medium
Handle specific and general exceptions in order from most to least derived.
-
STL Algorithms medium
Combine erase_if, accumulate, and find_if over standard containers.
-
Operator Overloading medium
Give a small vector type arithmetic and defaulted equality operators.
-
Function Templates hard
Generic max function with template type deduction.
-
Variant & Overloaded Visitor hard
Visit a std::variant with the overloaded-lambdas idiom.
-
Condition Variable Worker hard
Block a worker thread on a condition variable until jobs arrive or shutdown.
-
Move-only Buffer Class hard
Implement a move-only owning buffer with noexcept swap-based moves.
-
C++20 Concepts hard
Constrain a generic mean function to numeric types with a concept.
The Symbols That Slow You Down
The keystrokes below are where C++ typing speed is won or lost. Key positions shown for QWERTY — the pattern transfers to any layout, just on different physical keys.
| Symbol | Used For | Keys | How to Drill It |
|---|---|---|---|
| std:: | Namespace prefix | s-t-d, then Shift+Semicolon twice | The most repeated five-key chunk in modern C++. Type it as one memorized burst: letters, symbol, symbol. |
| << | Stream insert | Shift+Comma twice | Output chains repeat it dozens of times. Two even Shift-comma strikes without releasing rhythm. |
| >> | Stream extract / closer | Shift+Period twice | Doubled in both input chains and closing nested templates (`vector<vector<int>>`). |
| <> | Template brackets | < as Shift+Comma, > as Shift+Period | Every STL container wraps its type. `std::map<std::string, int>` is the full workout. |
| []( | Lambda opener | Shift+[, Shift+], Shift+9 | The unique lambda signature. Chunk bracket-bracket-paren as one gesture so closures start instantly. |
| & / * | References / pointers | Shift+7 / Shift+8 | Inherited from C and everywhere in signatures: `const auto&`, `int*`. Both reaches must be free. |
Common C++ Typing Mistakes
- ✗ Slowing down inside deep template nesting — practice `std::unordered_map<std::string, std::vector<int>>` as one drill.
- ✗ Forgetting the closing bracket when templates nest three deep — closers arrive in `>>` and `>>>` bursts.
- ✗ Typing `.` where `->` belongs on iterator access — both live in your hands; train the switch deliberately.
What's a Good C++ Typing Speed?
Modern C++ is the most symbol-dense mainstream language: 20–35 WPM is normal working speed, and 40+ WPM with 95%+ accuracy is excellent. Anything starting with `std::` should cost you no more attention than a common word.