Ruby Association Certified Ruby Programmer (Silver) Practice Test
Ruby programming certification covering Ruby syntax, data structures, object-oriented programming, blocks, iterators, and standard library usage. Administered by Ruby Association. Key domains include Built-in libraries, Object orientation and Syntax. The exam consists of 50 questions over 90 minutes.
Preguntas de Muestra
Prueba algunas preguntas para ver cómo es el examen completo.
A library maintainer is reviewing guard clauses in a Ruby 3.1.x script for a CSV cleanup gem. The code treats only false and nil as falsey: values = ["", 0, false, nil] kept = values.select { |value| value } p kept Which result should the reviewer expect?
A bootcamp team is deciding whether a module method should become an instance method or a singleton method in Ruby 3.1.x: module Auditable def audit_tag = "ok" end class Invoice include Auditable end p [Invoice.respond_to?(:audit_tag), Invoice.new.respond_to?(:audit_tag)] What is printed?
A bootcamp team is checking constant behavior in Ruby 3.1.x: NAME = "ruby" NAME.upcase! p NAME What is printed?
A library maintainer is sorting records in Ruby 3.1.x and needs stable intent, not string comparison: rows = [{name: "b", score: 7}, {name: "a", score: 9}, {name: "c", score: 5}] p rows.sort_by { |row| [row[:score], row[:name]] }.map { |row| row[:name] } What is printed?
A payments team uses parallel assignment to split a small Ruby 3.1.x tuple: first, *middle, last = [2, 4, 6, 8] p [first, middle, last] What is printed?