OpenExamsFREE PRACTICE — ANY EXAM

Free Ruby Association Certified Ruby Programmer Gold Practice Questions

100 free questions · Answer explanations · No signup required

View examination details, outline and sources

Loading selected examination banks…

Sample Practice Questions

Try these 10 sample questions from the Ruby Association Certified Ruby Programmer Gold practice bank. Each includes the answer and explanation. Continue with the interactive practice above to review the full question set.

  1. 1Which predefined object contains arguments passed to a Ruby script?

    1. A.ARGVCorrect answer: A
    2. B.ARGF
    3. C.ENV
    4. D.STDIN

    Explanation: The Ruby documentation states: "An Array of command line arguments given for the script.". ARGV holds script arguments; ARGF combines input files, ENV represents environment settings, and STDIN is the input stream.

    Reference: Ruby 3.1 ARGV documentation — ARGV

  2. 2What is the value of `%i[open close]` in Ruby 3.1?

    1. A.[:open, :close]Correct answer: A
    2. B.["open", "close"]
    3. C.:"open close"
    4. D."open close"

    Explanation: The Ruby documentation states: "You can write an array of symbols with %i (non-interpolable) or %I (interpolable):". Each whitespace-separated word becomes a symbol; this is neither a string array nor a single symbol or string.

    Reference: Ruby 3.1 %i and %I: Symbol-Array Literals documentation — %i and %I: Symbol-Array Literals

  3. 3What is the value of `def total; 2 + 6; end; total`?

    1. A.8Correct answer: A
    2. B.nil
    3. C.2
    4. D.6

    Explanation: The Ruby documentation states: "By default, a method returns the last expression that was evaluated in the body of the method.". The final evaluated sum is returned without an explicit return keyword.

    Reference: Ruby 3.1 Return Values documentation — Return Values

  4. 4A diagnostic tool knows an instance-variable name at runtime, including its @ prefix. Which method reads that variable directly?

    1. A.const_get
    2. B.class_variable_get
    3. C.public_send
    4. D.instance_variable_getCorrect answer: D

    Explanation: The Ruby documentation states: "Returns the value of the given instance variable, or nil if the instance variable is not set.". instance_variable_get reads the named instance variable; constants, class variables, and method dispatch are different operations.

    Reference: Ruby 3.1 instance_variable_get documentation — instance_variable_get

  5. 5Which Enumerable method groups elements into a hash keyed by the block's return values?

    1. A.partition
    2. B.map
    3. C.group_byCorrect answer: C
    4. D.select

    Explanation: The Ruby documentation states: "Returns a Hash that partitions the elements into groups.". group_by uses block results as grouping keys; partition returns two arrays, while map transforms and select filters.

    Reference: Ruby 3.1 group_by documentation — group_by

  6. 6After a class includes Singleton, how should callers obtain its shared instance?

    1. A.Call new for each access.
    2. B.Call instance on the class.Correct answer: B
    3. C.Call allocate on the class.
    4. D.Call dup on the class.

    Explanation: The Ruby documentation states: "Providing the Klass.instance() method that returns the same object each time it is called.". Singleton provides instance and makes normal allocation entry points private.

    Reference: Ruby 3.1 Singleton documentation — Singleton

  7. 7A loader needs the directories Ruby searches for required scripts and extensions. Which global provides that search path?

    1. A.$LOADED_FEATURES
    2. B.$LOAD_PATHCorrect answer: B
    3. C.$FILENAME
    4. D.$DEBUG

    Explanation: The Ruby documentation states: "Load path for searching Ruby scripts and extension libraries used by Kernel#load and Kernel#require.". $LOAD_PATH controls search locations. Loaded features record prior loads; the other globals do not supply directories.

    Reference: Ruby 3.1 $LOAD_PATH documentation — $LOAD_PATH

  8. 8Which Ruby literal represents the exact rational value three tenths?

    1. A.0.3
    2. B.0.3rCorrect answer: B
    3. C.3i
    4. D.0x3

    Explanation: The Ruby documentation states: "A Rational number is exact, whereas a Float number may be inexact.". The r suffix creates a Rational. The alternatives create a Float, an imaginary number, and an integer.

    Reference: Ruby 3.1 Rational Literals documentation — Rational Literals

  9. 9A setter stores its argument but explicitly returns :stored. What does the assignment expression `obj.value = 12` evaluate to?

    1. A.:stored
    2. B.12Correct answer: B
    3. C.nil
    4. D.obj

    Explanation: The Ruby documentation states: "Note that for assignment methods the return value will be ignored when using the assignment syntax. Instead, the argument will be returned:". Assignment syntax yields the assigned value, not the setter's explicit method return.

    Reference: Ruby 3.1 Return Values documentation — Return Values

  10. 10A class wants to install an instance method using a runtime name and a block as its body. Which method supports this?

    1. A.define_methodCorrect answer: A
    2. B.define_singleton_method
    3. C.const_set
    4. D.instance_variable_set

    Explanation: The Ruby documentation states: "Defines an instance method in the receiver.". define_method installs the block as an instance method; singleton definition targets a different method table and the setters affect data.

    Reference: Ruby 3.1 define_method documentation — define_method

Exam Review

About Ruby Association Certified Ruby Programmer Gold

Ruby Association Certified Ruby Programmer Gold · UNSPECIFIED

Key exam facts

Provider
Ruby Association owns and certifies the examination; Prometric administers it at test centers.
Format
Computer Based Testing with multiple-choice questions.
Exam questions
Total questions: 50.
Time limit
90 minutes of examination time.
Passing score
75%.
Exam fee
Japan: JPY 16,500 including tax, with a separate student discount. The English owner page lists USD 150 with an Education Pricing link; this is not a universal converted price. A Japan retake campaign offers a free second attempt after failure, by application through 23 December 2026 and retake by 28 December 2026, subject to its conditions.

Topics covered

  • Execution environment

    • Pre-defined variables and constants
  • Syntax

    • Literals
    • Variables and constants
    • Operators
    • Blocks
    • Exceptions
    • Non local exit
    • Keyword arguments
    • Numbered parameters
    • lambda
    • Pattern matching
    • Here documents
  • Object Oriented Programing

    • Details of Method
    • Access control
    • Details of Class
    • Class inheritance
    • Details of modules
    • Module#prepend
    • Refinements
  • Metaprograming

  • Built-in libraries

    • Well-used built-in classes and modules (e.g., Object, Module, Kernel, Enumerable, Comparable)
    • Numeric
    • Regular expression
    • Proc
    • Enumerator
  • Standard Library

How to prepare

Work through the topics, read the explanation after each answer, and revisit the areas where you miss questions. Use the official outline and reference materials below to guide your study.

These independent practice questions are not actual exam items and do not guarantee a passing result.

Frequently asked questions

What is the exam format?

Computer Based Testing with multiple-choice questions.

How many questions are on the exam?

Total questions: 50.

How long is the exam?

90 minutes of examination time.

What is the passing score?

75%.

How much does the exam cost?

Japan: JPY 16,500 including tax, with a separate student discount. The English owner page lists USD 150 with an Education Pricing link; this is not a universal converted price. A Japan retake campaign offers a free second attempt after failure, by application through 23 December 2026 and retake by 28 December 2026, subject to its conditions.

Official sources and references

Confirm current exam arrangements with the exam provider.