11. Which keyword is used to define a module in Ruby? A. include B. def C. module D. class 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
12. What is the purpose of the method_defined? method in Ruby's Module class? A. Checking if a method is defined within an object B. Checking if a module is defined within a method C. Checking if a method is defined within a class D. Checking if a method is defined within a module 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
13. What is an eigenclass in Ruby? A. A hidden class that stores singleton methods for an object B. A class that is automatically created for every object C. A class that inherits from a module D. A class that cannot be instantiated directly 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
14. What is the purpose of the include keyword in Ruby? A. To instantiate an object of a class B. To define a new class that inherits from an existing class C. To include a file in the current Ruby script D. To mix in module methods as instance methods of a class 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
15. What does the term "lexical scope" refer to in Ruby? A. The scope determined by the order of execution of statements B. The scope determined by the visibility of variables and methods in the current context C. The scope determined by where variables and methods are defined in the source code D. The scope determined by the order of creation of objects 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
16. What is the purpose of the yield keyword in Ruby? A. To define a method that can be invoked multiple times within a block B. To transfer control from a method back to the block that invoked it C. To pass parameters to a block when invoking it D. To define a method that can be invoked multiple times within a block 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
17. What is the main difference between a lambda and a Proc in Ruby? A. Procs can be converted to lambdas, but lambdas cannot be converted to Procs B. Lambdas are objects of the Proc class, while Procs are not C. Lambdas enforce strict argument checking, while Procs do not D. Procs can accept a variable number of arguments, while lambdas cannot 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
18. What is an anonymous function in Ruby called? A. Lambda B. Block C. Method D. Proc 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
19. What does the term "currying" refer to in Ruby? A. The process of breaking down a function that takes multiple arguments into a series of functions that take a single argument each B. The process of combining multiple functions into a single function C. The process of generating a sequence of random numbers within a given range D. The process of creating a new instance of a class 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
20. Which Ruby module is commonly used for memoization? A. Memo B. Cache C. Memoize D. Memoist 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