Ruby Typing Speed Test
Ruby reads like English but types like nothing else: `@` instance variables, `:symbols`, pipe-delimited block parameters, and `#{}` interpolation. These drills train the punctuation hiding inside Ruby's famous readability.
The Punctuation Behind Ruby's Elegance
Blocks are Ruby's core idiom, and their parameters live between pipes: `users.each { |u| puts u.name }` requires two Shift-backslash reaches per block — a key most typists never use. Symbols prefix identifiers with a colon (`:admin`, `role:`), instance variables with `@`, and globals with `$`, so sigils appear at word boundaries throughout real code.
String interpolation wraps expressions in `#{}` — pound, brace, brace — inside double quotes, and the symbol-to-proc shortcut `(&:name)` stacks ampersand and colon. Method names ending in `?` and `!` (`passed?`, `save!`) put punctuation at identifier ends, and `do |x| ... end` alternates words with pipes. Ruby's minimal braces don't mean minimal symbols — they're just different ones.
Key Drills for Ruby:
- Pipes around parameters: Block params need `|x|` — drill the pipe pair until blocks open without hesitation.
- Colon-prefix symbols: `:symbol` and `key:` forms are everywhere. The colon should feel natural on both sides of a word.
- Interpolate in one motion: `#{}` is three symbols typed as one gesture inside strings. Chunk it.
Sample Drill: Blocks, Map & Select
Enumerable chains with blocks and symbol-to-proc.
admins = users.select { |u| u.role == :admin }
names = admins.map(&:name).sort
names.each_with_index do |name, i|
puts "#{i + 1}. #{name}"
end
All 15 Ruby 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.
-
Blocks, Map & Select easy
Enumerable chains with blocks and symbol-to-proc.
-
Safe Navigation Operator easy
Walk optional associations with &. and fall back with
-
String Cleanup Methods easy
Strip, downcase, gsub, and capitalize words in a title.
-
Case with Ranges easy
Classify HTTP status codes using ranges in a case expression.
-
Begin & Rescue easy
Fall back to defaults when a config file is missing or malformed.
-
Classes & attr_accessor medium
Defining a class with accessors and instance methods.
-
Struct with Methods medium
Define a lightweight Point struct with a distance method.
-
Modules as Mixins medium
Share audit behavior via a module and add ordering with Comparable.
-
ActiveRecord Model medium
Declare associations, validations, a scope, and a callback in a Rails model.
-
Tally, Group & Slice medium
Count statuses, bucket by day, and export records in batches.
-
Hash Transformations hard
Building and transforming hashes with each_with_object.
-
Rails Update Action hard
Scope a lookup to the current user and use strong parameters on update.
-
Dynamic Settings Object hard
Expose hash keys as methods and predicates with method_missing.
-
Infinite Lazy Enumerator hard
Generate primes with Enumerator.new and take a few lazily.
-
Retry with Backoff hard
Retry a block on network errors with exponential sleep between attempts.
The Symbols That Slow You Down
The keystrokes below are where Ruby 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 |
|---|---|---|---|
| |x| | Block params | Shift+Backslash twice | Two of the farthest reaches on the board, per block. `each { |u| }` lives or dies on this pair. |
| :sym | Symbol | : as Shift+Semicolon, then word | Symbols prefix identifiers with colons — and keyword arguments end with them (`role:`). Both directions. |
| #{} | Interpolation | # as Shift+3, then {} as Shift+[ and Shift+] | Three symbols inside quotes, in fixed order: pound-brace-expression-brace. Type as one gesture. |
| @ | Instance variable | Shift+2 | `@name`, `@count` — sigils at word starts throughout classes. Shift-2 reflexively. |
| &: | Symbol-to-proc | & as Shift+7, then : as Shift+Semicolon | The `(&:name)` shortcut stacks two shifted symbols — ampersand then colon — mid-argument. |
| ? ! | Predicate / bang endings | ? as Shift+Slash, ! as Shift+1 | Ruby ends method names with punctuation (`passed?`, `save!`). Word-ending question marks are unique to Ruby. |
Common Ruby Typing Mistakes
- ✗ Reaching for the pipe pair slowly — block-heavy Ruby is untypable until `|x|` is one motion.
- ✗ Forgetting the closing brace of `#{}` — the interpolation should be chunked, not spelled.
- ✗ Dropping `?` or `!` from method names at speed; Ruby treats them as part of the identifier.
What's a Good Ruby Typing Speed?
Ruby's words are short but its sigils are many: 30–45 WPM is solid working speed, and 50+ WPM with 96%+ accuracy is excellent. Enumerable chains (`map { |x| x.to_s }`) are the ideal benchmark drill.