All Practice Exams

100+ Free Ruby Gold Practice Questions

Pass your Ruby Association Certified Ruby Programmer Gold version 3 exam on the first try — instant access, no signup required.

✓ No registration✓ No credit card✓ No hidden fees✓ Start practicing immediately
100+ Questions
100% Free
1 / 100
Question 1
Score: 0/0

What is the direct superclass of the class Class itself in Ruby?

A
B
C
D
to track
Same family resources

Explore More Ruby Programming Certifications

Continue into nearby exams from the same family. Each card keeps practice questions, study guides, flashcards, videos, and articles in one place.

2026 Statistics

Key Facts: Ruby Gold Exam

50

Multiple-choice questions

Ruby Association

75% (38/50)

Passing score

Ruby Association

90 minutes

Time limit

Ruby Association

USD 150

Exam fee (JPY 16,500)

Ruby Association

Ruby 3.1

Assessed version

Ruby Association (Gold v3)

Silver required

Prerequisite

Ruby Association

The Ruby Association Certified Ruby Programmer Gold (version 3) is an advanced exam assessed against Ruby 3.1, requiring the Silver certification first. It has 50 multiple-choice questions in 90 minutes, a 75% (38 of 50) passing score, a USD 150 fee, and no expiration. It is delivered at Prometric test centers and covers execution environment, advanced syntax, object orientation, metaprogramming, built-in libraries, and the standard library.

Sample Ruby Gold Practice Questions

Try these sample questions to test your Ruby Gold exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1Given: module M refine String do def shout upcase + "!" end end end def call_shout(s) s.shout end using M puts call_shout("hi") What happens?
A.It raises NoMethodError because the refinement is not active inside call_shout
B.It prints "HI!"
C.It prints "hi!"
D.It raises a SyntaxError because using cannot appear at the top level
Explanation: Refinements are lexically scoped. The `using M` activates the refinement only from that point to the end of the file's top-level scope, but method bodies defined earlier (like `call_shout`) do not see it. Because `call_shout` was defined before `using` and in its own lexical scope, `s.shout` is unresolved and raises NoMethodError.
2What does the following print? module Greet def hello = "module hello" end class Person prepend Greet def hello = "class hello" end puts Person.new.hello
A.class hello
B.module hello
C.It raises NoMethodError
D.nil
Explanation: `prepend` inserts the module BEFORE the class in the ancestor chain, so `Person.ancestors` begins `[Greet, Person, ...]`. Method lookup finds `Greet#hello` first, printing "module hello". This is the key difference from `include`, which would place the module after the class.
3What is the output? case {name: "Ruby", age: 31} in {name: String => n, age: Integer => a} puts "#{n} is #{a}" in _ puts "no match" end
A.no match
B.It raises NoMatchingPatternError
C.Ruby is 31
D.name is age
Explanation: This is a hash pattern match. The hash has keys :name and :age whose values match `String` and `Integer` respectively, binding `n` to "Ruby" and `a` to 31. Hash patterns match when the listed keys exist with matching values, so the first clause succeeds and prints "Ruby is 31".
4What does this print? lambda_obj = ->(a, b) { return a + b } proc_obj = Proc.new { |a, b| a + b } puts lambda_obj.call(1, 2) puts proc_obj.call(1, 2, 3)
A.3 then ArgumentError
B.ArgumentError then 3
C.3 then 6
D.3 then 3
Explanation: A lambda enforces arity strictly, so it must receive exactly two arguments (it does). A non-lambda Proc has lenient arity: extra arguments are silently ignored, so `proc_obj.call(1, 2, 3)` binds a=1, b=2 and discards 3, returning 3. Both lines print 3.
5What does the following output? class Foo [:a, :b, :c].each do |name| define_method(name) { name.to_s } end end puts Foo.new.b
A.b
B.a
C.It raises NoMethodError
D.nil
Explanation: `define_method` is called inside the class body with a block that closes over the local variable `name`. Because each iteration creates a separate closure capturing its own `name`, the method `:b` returns "b". This is the canonical metaprogramming pattern for generating methods dynamically while correctly capturing block-local variables.
6What does this print? class Ghost def method_missing(name, *args) "called #{name} with #{args.inspect}" end def respond_to_missing?(name, include_private = false) name.to_s.start_with?("find_") end end g = Ghost.new puts g.respond_to?(:find_user) puts g.respond_to?(:save)
A.true then true
B.true then false
C.false then false
D.false then true
Explanation: `respond_to?` consults `respond_to_missing?` for methods not explicitly defined. Here it returns true only for names starting with "find_". So `:find_user` yields true and `:save` yields false. Defining `respond_to_missing?` (not overriding `respond_to?`) is the correct, idiomatic way to make dynamically handled methods discoverable.
7What is printed? str = "hello" def str.shout upcase end puts str.singleton_methods.inspect puts str.shout
A.[:shout] then hello
B.[] then HELLO
C.[:shout] then HELLO
D.It raises NoMethodError on shout
Explanation: `def str.shout` defines a singleton method on the specific object `str`, stored in its singleton class (eigenclass). `singleton_methods` lists `[:shout]`, and calling `str.shout` invokes `upcase` on the receiver, returning "HELLO". Singleton methods belong to one object, not the whole String class.
8What does the following print? result = [1, 2, 3, 4, 5].lazy.map { |x| x * 2 }.select { |x| x > 4 }.first(2) p result
A.It raises an error because lazy cannot be chained with first
B.[2, 4, 6, 8, 10]
C.[6, 8, 10]
D.[6, 8]
Explanation: A lazy enumerator defers evaluation and processes elements one at a time through the chain. Doubling gives 2,4,6,8,10; selecting values > 4 yields 6,8,10; `first(2)` materializes only the first two passing elements, [6, 8], short-circuiting before processing the rest. Laziness avoids building intermediate arrays.
9What is the output? fib = Enumerator.new do |y| a, b = 0, 1 loop do y << a a, b = b, a + b end end p fib.take(5)
A.[0, 1, 1, 2, 3]
B.It hangs forever in an infinite loop
C.[1, 1, 2, 3, 5]
D.It raises StopIteration
Explanation: `Enumerator.new` with a yielder block produces values lazily on demand; the internal `loop` runs only as far as the consumer pulls. `take(5)` requests five values, yielding the Fibonacci sequence starting at 0: [0, 1, 1, 2, 3]. The enumerator is paused between yields, so the infinite loop never runs to completion.
10What does this print? fiber = Fiber.new do x = Fiber.yield(10) Fiber.yield(x + 1) 100 end p fiber.resume p fiber.resume(5) p fiber.resume
A.10 then 11 then 100
B.10 then 6 then 100
C.nil then 6 then 100
D.10 then 6 then nil
Explanation: The first `resume` runs to `Fiber.yield(10)`, returning 10. The second `resume(5)` makes `Fiber.yield(10)` evaluate to 5, so x = 5, then it yields x + 1 = 6. The third `resume` runs to the end, returning the block's last value, 100. Arguments to `resume` become the return value of the paused `Fiber.yield`.

About the Ruby Gold Exam

The Ruby Association Certified Ruby Programmer Gold (version 3) certifies a deep understanding of the Ruby language, going well beyond the Silver level. Assessed against Ruby 3.1, it tests advanced syntax (pattern matching, numbered parameters, here documents, keyword arguments), object-oriented programming details (access control, class inheritance, Module#prepend, and Refinements), metaprogramming (eval, define_method, send, singleton classes, and hooks), built-in libraries (Enumerable, Comparable, Proc/lambda, Numeric, Enumerator, Fiber), and selected standard libraries (date, singleton, forwardable). Candidates must already hold the Silver certification, and the exam is delivered at Prometric test centers.

Questions

50 scored questions

Time Limit

90 minutes

Passing Score

75% (38 of 50)

Exam Fee

USD 150 (Ruby Association)

Ruby Gold Exam Content Outline

~6%

Execution Environment

Pre-defined variables and constants including ARGV, $0, ENV, and __method__, and how the Ruby interpreter exposes the runtime environment to scripts.

~22%

Syntax

Advanced literals and operators, blocks, exception handling with ensure and retry, non-local exit via catch/throw, keyword arguments, numbered parameters, lambda, pattern matching (array, hash, find, and guard patterns), and squiggly here documents.

~24%

Object Oriented Programming

Method details and coercion protocols, access control (public, private, protected), class details and lexical constant lookup, class inheritance with super, module mixins, Module#prepend and ancestor ordering, and Refinements scope.

~14%

Metaprogramming

Dynamic method definition with define_method, the eval family (instance_eval and class_eval), reflective access with instance_variable_get/set and send, singleton classes (class << self), and class hooks such as inherited, included, and method_added.

~26%

Built-in Libraries

Object and Kernel methods, Module behavior, Enumerable and Comparable mixins, Numeric types including Rational and divmod, regular expressions with named and numbered captures, Proc versus lambda semantics, and Enumerator including lazy evaluation and Fiber.

~8%

Standard Library

The date and time libraries, the singleton and forwardable modules, and commonly tested helpers such as StringIO, Marshal for deep copying, and Set.

How to Pass the Ruby Gold Exam

What You Need to Know

  • Passing score: 75% (38 of 50)
  • Exam length: 50 questions
  • Time limit: 90 minutes
  • Exam fee: USD 150

Keys to Passing

  • Complete 500+ practice questions
  • Score 80%+ consistently before scheduling
  • Focus on highest-weighted sections
  • Use our AI tutor for tough concepts

Ruby Gold Study Tips from Top Performers

1Read code aloud: most Gold questions show a snippet and ask for the exact output, so practice predicting return values and side effects line by line.
2Master the ancestor chain: know how include, prepend, and extend reorder lookup, and trace Module#prepend with super to predict which method runs first.
3Drill metaprogramming hooks (inherited, included, method_added) and the eval family, noting that instance_eval rebinds self while class_eval defines instance methods.
4Understand Refinements scope: they activate only after using and are lexically confined to the file or eval string, so they are not visible inside earlier-defined methods.
5Compare Proc and lambda carefully: lambdas enforce arity and their return exits only the lambda, while a non-lambda Proc's return exits the enclosing method.
6Know standard-library gotchas: Date subtraction yields a Rational, dup drops the frozen flag while clone keeps it, and Marshal round-tripping makes a deep copy.

Frequently Asked Questions

What are the exam facts for Ruby Gold?

The Ruby Association Certified Ruby Programmer Gold (version 3) has 50 multiple-choice questions in 90 minutes, a 75% (38 of 50) passing score, and a USD 150 fee. It is assessed against Ruby 3.1 and delivered at Prometric test centers, with no expiration on the credential.

Do I need the Silver certification before Gold?

Yes. The Gold credential requires you to hold (or pass) the Ruby Association Certified Ruby Programmer Silver certification. Gold builds on Silver with deeper coverage of metaprogramming, refinements, the object model, and the standard library.

Which Ruby version does the Gold exam test?

The version 3 Gold exam is assessed against Ruby 3.1.x. This means features such as pattern matching, numbered parameters, one-line rightward assignment, endless methods, and FrozenError as a RuntimeError subclass are in scope.

What topics make Gold harder than Silver?

Gold adds metaprogramming (define_method, eval, send, hooks), singleton classes, Module#prepend and ancestor ordering, Refinements, Proc versus lambda semantics, Fiber and lazy Enumerators, and standard libraries like date, singleton, and forwardable.

How much does the Ruby Gold exam cost?

The exam fee is USD 150 (JPY 16,500), with education pricing available for eligible students. There is no fee for study materials when you use the official Ruby Association prep-test, Ruby documentation, and this free practice bank.

Where do I take the Ruby Gold exam?

The exam is administered by the Ruby Association and delivered through Prometric test centers worldwide. You schedule a seat with Prometric; it is a proctored, in-center multiple-choice exam rather than an online-proctored test.