51. What is a "memoization" technique in Ruby? A. Dynamically defining methods based on certain conditions B. Creating anonymous functions that can be called later C. Caching the return value of a method for future invocations D. Evaluating a block of code within the context of a specific object Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
52. Which method is commonly used to dynamically define instance methods in Ruby? A. method_missing B. instance_method C. define_method D. create_method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
53. In Ruby, what is the purpose of the #method method? A. It invokes the specified method on the object B. It checks if the object responds to the specified method C. It defines a new method on the object D. It returns a Method object representing the specified method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
54. What is the purpose of the public_send method in Ruby? A. It invokes a public method on an object, bypassing visibility restrictions B. It sends a message to the Ruby interpreter to execute a piece of code C. It checks if the object responds to the specified method D. It returns a Method object representing the specified method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
55. Which Ruby module is commonly used to implement the Singleton design pattern? A. Kernel B. Module C. Factory D. Singleton Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
56. What does the term "DSL" stand for in Ruby programming? A. Dynamic Static Language B. Distributed Systems Language C. Domain-Specific Language D. Data Serialization Language Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
57. What is the purpose of the attr_accessor method in Ruby? A. It creates only a setter method for a class attribute B. It creates getter and setter methods for a class attribute C. It creates a private attribute for a class D. It creates only a setter method for a class attribute Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
58. What is a "callback" in the context of Ruby on Rails? A. A method that is called when a database query is executed B. A method that is called when an exception occurs C. A method that is called in response to a specific event in the application lifecycle D. A method that is called before an object is instantiated Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
59. What does the "stabby lambda" (->) syntax in Ruby represent? A. It is used to define instance methods B. It is used to define class methods C. It is used to define method aliases D. It is used to define anonymous functions Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
60. In Ruby, what is the purpose of the module_function keyword? A. It ensures that the module cannot be included in other modules or classes B. It makes the specified methods accessible both as instance methods and module methods C. It converts the specified methods into private methods D. It ensures that the module cannot be included in other modules or classes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board