1. What is metaprogramming in Ruby? A. Writing code that modifies its own structure B. Writing code that writes code C. Writing code that generates other code D. Writing code that optimizes performance 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
2. Which Ruby module provides reflection capabilities for classes, modules, and objects? A. Kernel B. MetaModule C. ObjectSpace D. Reflection 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
3. What is the purpose of the method_missing method in Ruby? A. Intercepting method calls before they are executed B. Defining custom method behaviors based on method names C. Handling undefined method calls D. Providing default implementations for missing methods 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
4. What is a singleton class in Ruby? A. A class that can have only one method B. A class that is used to define methods for a single object C. A class that can have only one subclass D. A class that can have only one method 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
5. What does the term "duck typing" refer to in Ruby? A. The process of explicitly casting objects to a specific type B. Assigning types to variables based on their values C. The practice of allowing objects of different types to respond to the same method call D. Determining an object's type based on its methods 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
6. Which Ruby method is commonly used for dynamically defining new methods on an object? A. create_method B. new_method C. add_method D. define_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
7. What is a closure in Ruby? A. An object that encapsulates a block of code along with its surrounding context B. A block of code that can be passed around as an object C. A method that takes a block as an argument D. A method that returns a lambda 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
8. What is memoization in Ruby? A. Evaluating code at runtime based on user input B. Creating anonymous functions that can be called later C. Dynamically defining methods based on certain conditions D. Caching the return value of a method for future invocations 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
9. What is the purpose of the instance_eval method in Ruby? A. Evaluating a block of code within the context of the current instance B. Dynamically defining methods on a specific instance C. Evaluating a block of code within the context of a specific object D. Accessing the instance variables of a class from within a class 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
10. What does the term "monkey patching" refer to in Ruby? A. Assigning custom methods to specific objects B. Modifying or extending existing classes or modules at runtime C. Overriding built-in methods with custom implementations D. Assigning custom methods to specific objects 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