🌍 The Odin Project · subject
The Odin Project Ruby Syllabus
Every chapter and topic of Ruby examined in The Odin Project — 8 chapters, 34 topics, plus 50 flashcards written against it.
Ruby syllabus — full chapter and topic list
Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for Ruby in The Odin Project, not a summary of it.
-
Basic Ruby
9 topics- Basic Data Types
- Variables
- Input and Output
- Conditional Logic
- Loops
- Collections
- Methods
- Debugging
- Enumerables
-
Basic Ruby Projects
4 topics- Caesar Cipher
- Sub Strings
- Stock Picker
- Bubble Sort
-
Object Oriented Programming Basics
5 topics- Object Oriented Programming
- Project Management
- Linting and RuboCop
- Project: Tic Tac Toe
- Project: Mastermind
-
Files and Serialization
2 topics- Files and Serialization
- Project: Hangman
-
Advanced Ruby
3 topics- Pattern Matching
- Blocks
- Custom Enumerables
-
Testing Ruby with RSpec
3 topics- Test Driven Development
- Introduction to RSpec
- Project: Connect Four
-
Computer Science in Ruby
7 topics- Recursive Methods
- Time and Space Complexity
- Common Data Structures and Algorithms
- Project: Linked Lists
- HashMap Data Structure
- Project: Binary Search Trees
- Project: Knights Travails
-
Conclusion
1 topic- Project: Chess
Ruby flashcards for The Odin Project
23 of 50 cards from the Ruby deck — real questions with worked answers.
What are the main basic data types in Ruby, and what is special about how Ruby treats them?
Integer, Float, String, Symbol, Boolean (true/false), and nil. Everything in Ruby is an object, so even literals like 5 or "hello" have methods (e.g., 5.times, "hello".upcase).
In Ruby, what does the expression 17 / 5 evaluate to, and why?
It evaluates to 3. When both operands are Integers, Ruby performs integer division and truncates the remainder. To get a Float result ($3.4$), at least one operand must be a Float, e.g., 17.0 / 5.
Which operator does Ruby use for exponentiation, and what does 2 ** 5 return?
The ** operator. 2 ** 5 returns 32, since $2^{5} = 32$. Fractional exponents give roots: 16 ** 0.5 returns 4.0 because $16^{\frac{1}{2}} = \sqrt{16} = 4$.
What does the modulo operator % return in Ruby, e.g., 16 % 5?
The remainder of division: 16 % 5 returns 1, because $16 = 3 \times 5 + 1$. It is commonly used to test even/odd (n % 2 == 0) and to wrap values around a range.
What is the difference between a String and a Symbol in Ruby?
A String is mutable and every literal creates a new object; a Symbol (e.g., :name) is immutable and the same symbol always references the same object in memory. Symbols are preferred as hash keys and identifiers because comparing them is faster.
How do you convert between strings and numbers in Ruby, and what does "hello".to_i return?
Use to_i, to_f, and to_s. "5".to_i returns 5; "hello".to_i returns 0 (no leading number); 5.to_s returns "5". These methods never raise errors on bad input, unlike Integer("hello").
What naming convention do Ruby local variables use, and what does a variable actually store?
snake_case (lowercase words separated by underscores, e.g., total_score). A variable stores a reference to an object, not the object itself — so two variables can point to (and mutate) the same object.
How are constants defined in Ruby, and what happens if you reassign one?
A constant starts with a capital letter (conventionally ALL_CAPS, e.g., MAX_SPEED = 100). Ruby allows reassignment but prints a warning — constants are not truly immutable, only by convention.
What is string interpolation in Ruby and what is its key requirement?
Embedding expressions inside a string with #{}, e.g., "Hello, #{name}!". It only works inside double-quoted strings; single quotes print the #{} characters literally.
What is the difference between gets and gets.chomp in Ruby?
gets reads a line of user input including the trailing newline (\n) added when the user presses Enter. gets.chomp removes that trailing newline, which is almost always what you want when comparing or storing input.
Compare puts, print, and p in Ruby.
puts prints the value plus a newline and returns nil; print prints without a newline and returns nil; p prints the raw inspect representation (showing quotes, nil, escape characters) and returns the object itself — making p ideal for debugging.
Which values are falsy in Ruby's conditional logic?
Only false and nil. Everything else is truthy — including 0, empty strings "", and empty arrays [] (unlike many other languages).
What is the difference between == , .eql?, and .equal? in Ruby?
== checks value equality (5 == 5.0 is true); .eql? checks value AND type (5.eql?(5.0) is false); .equal? checks object identity — whether both references point to the exact same object in memory.
What does Ruby's spaceship operator <=> return?
It returns $-1$ if the left operand is less than the right, $0$ if they are equal, and $1$ if the left is greater. It is the basis of sorting — Array#sort uses <=> to compare elements.
What is the unless statement in Ruby and when should it be used?
unless executes code when its condition is false — the opposite of if. Use it when the negative phrasing reads more naturally (e.g., unless hungry then clean up), and avoid pairing it with else, which hurts readability.
What is the syntax and purpose of Ruby's ternary operator?
condition ? value_if_true : value_if_false. It is a one-line replacement for a simple if/else that returns a value, e.g., age >= 18 ? "adult" : "minor".
How does a Ruby case statement work, and what operator does it use for matching?
case takes a value and compares it against each when clause using the case-equality operator === (which lets ranges, classes, and regexps match), executing the first match; else handles no match. Each branch can return a value.
How do && and || behave in Ruby, and what is short-circuit evaluation?
&& returns true only if both operands are truthy; || returns true if at least one is. Ruby stops evaluating as soon as the result is known: with &&, a falsy left side skips the right; with ||, a truthy left side skips the right.
How do you create an infinite loop in Ruby and exit it?
Use loop do ... end, and exit with break (usually inside an if condition, e.g., break if i > 10). loop is Ruby's simplest, idiomatic infinite loop construct.
What is the difference between a while loop and an until loop in Ruby?
while runs as long as its condition is true; until runs as long as its condition is false (it is the logical opposite). until avoids negated conditions, e.g., until done rather than while !done.
What is the difference between break and next inside a Ruby loop?
break exits the loop entirely; next skips the rest of the current iteration and jumps to the next one. Example: next if i.odd? skips odd numbers but keeps looping.
How do the #times, #upto, and #downto methods work in Ruby?
5.times { |i| ... } iterates with i from 0 to 4; 1.upto(5) counts 1,2,3,4,5; 5.downto(1) counts 5,4,3,2,1. They are the idiomatic replacements for C-style for loops when the number of iterations is known.
What is a Ruby array, and how do you access its first and last elements?
An ordered, integer-indexed collection that can hold mixed types. Access the first element with arr[0] or arr.first, and the last with arr[-1] or arr.last (negative indices count from the end).
Planning Ruby for The Odin Project
Ruby is about 16% of the The Odin Project syllabus by topic count — 34 of 212 topics, spread over 8 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 25 hours.
The heaviest chapters are Basic Ruby (9 topics), Computer Science in Ruby (7 topics), Object Oriented Programming Basics (5 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.
Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.
Ruby (The Odin Project) FAQ
What is in the The Odin Project Ruby syllabus?
Ruby is split into 8 chapters — Basic Ruby, Basic Ruby Projects, Object Oriented Programming Basics, Files and Serialization, Advanced Ruby and Testing Ruby with RSpec, and 2 more, containing 34 topics and 0 sub-topics in total.
How many chapters are there in Ruby for The Odin Project?
8 chapters. Ruby accounts for about 16% of the topics in the whole The Odin Project syllabus (34 of 212).
How long should I spend on Ruby for The Odin Project?
Budget around 25 hours for a first pass through Ruby — about 45 minutes per topic plus 12 minutes per sub-topic across its 34 topics. Add revision cycles on top.
Are there flashcards for The Odin Project Ruby?
Yes — a 50-card Ruby deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.