Skip to content

Ruby Programming Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 50 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What is a Symbol in Ruby?

Show ▼

A Symbol is a lightweight, immutable identifier prefixed with a colon, e.g. :name. Symbols are stored in memory only once, making them more efficient than strings for keys and identifiers.
Example: :status, :id

How do you create an Array in Ruby?

Show ▼

An Array is an ordered collection created with square brackets or Array.new.
Examples:
nums = [1, 2, 3]
words = %w[hello world]
empty = Array.new(5, 0)

How do you create a Hash in Ruby?

Show ▼

A Hash is a collection of key-value pairs.
Examples:
h = { name: "Alice", age: 30 }
h = Hash.new(0)
Access values with h[:name].

What is a block in Ruby?

Show ▼

A block is an anonymous chunk of code enclosed in do...end or curly braces { } that can be passed to a method.
Example:
[1,2,3].each { |n| puts n }

What is the difference between do...end and curly braces for blocks?

Show ▼

Both define blocks, but curly braces { } have higher precedence than do...end.
Convention: use { } for single-line blocks and do...end for multi-line blocks.

🎯 Take the Ruby Programming Practice Exam