Question 1
Given: 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?
Correct Answer:
It raises NoMethodError because the refinement is not active inside call_shout
Question 2
What does the following print? module Greet def hello = "module hello" end class Person prepend Greet def hello = "class hello" end puts Person.new.hello
Correct Answer:
module hello
Question 3
What is the output? case {name: "Ruby", age: 31} in {name: String => n, age: Integer => a} puts "#{n} is #{a}" in _ puts "no match" end
Correct Answer:
Ruby is 31
Question 4
What 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)
Correct Answer:
3 then 3
Question 5
What does the following output? class Foo [:a, :b, :c].each do |name| define_method(name) { name.to_s } end end puts Foo.new.b
Correct Answer:
b
Question 1
Exam overview

About this Exam

Prepare with the Ruby Gold Practice Questions - Ruby Association Certified Ruby Programmer Gold version 3 Exam practice quiz. This question bank includes 100 questions covering puts, class, print, output, and name. Use it to review important concepts, identify knowledge gaps, and build confidence for the related exam, course, or assessment.

More details

Additional Information

Ruby Gold Practice Questions - Ruby Association Certified Ruby Programmer Gold version 3 Exam

This practice set contains 100 questions from the matching question bank and focuses on puts, class, print, output, and name. Work through each question carefully, review the provided solutions, and revisit topics that need more study before your next attempt.

This is an independent study resource intended for practice and review; it is not an official examination or an endorsement by any organization named in the title.

Quiz information

Frequently Asked Questions

The complete question count is available after full access is unlocked.
No fixed duration is currently configured for this quiz.
Question explanations are included where they are available in the quiz content, helping you review the reasoning after answering.
Yes. You can retake the practice test again as you continue studying during your available access period.
After your access is confirmed, you can continue into the complete practice exam from this quiz flow.
Unless explicitly stated otherwise, this page provides independent practice material for study and exam preparation and is not the official examination itself.
Keep studying

Related Questions