41. What is the recommended approach for handling exceptions in Ruby? A. Suppress exceptions by using ignore blocks B. Use exit to terminate the program when an exception occurs C. Let exceptions propagate without handling them D. Use begin and rescue blocks to gracefully handle exceptions 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
42. Which tool is commonly used for Ruby version management and dependency isolation? A. RSpec B. RuboCop C. RVM (Ruby Version Manager) D. Rails 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
43. What is the purpose of the "Law of Least Astonishment" in Ruby programming? A. To minimize the number of lines of code in a program B. To ensure that the behavior of code is intuitive and predictable C. To prioritize the performance of code over its readability D. To minimize the number of lines of code in a program 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
44. Which Ruby convention is commonly used for naming global variables? A. lower_snake_case B. UPPER_SNAKE_CASE C. $UPPER_SNAKE_CASE D. @lower_snake_case 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
45. What is the purpose of using constants in Ruby programming? A. To store values that can be modified during the execution of the program B. To declare variables that are accessible only within a specific scope C. To store values that are sensitive and should not be accessed by other parts of the program D. To define values that remain constant throughout the execution of the program 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
46. Which Ruby convention is commonly used for naming instance variables? A. @lower_snake_case B. UPPER_SNAKE_CASE C. snake_case D. PascalCase 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
47. What is the purpose of using comments in Ruby code? A. To store values that are sensitive and should not be accessed by other parts of the program B. To declare variables that are accessible only within a specific scope C. To hide sections of code from being executed D. To provide additional information and explanations about the code 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
48. Which Ruby convention is commonly used for naming private methods? A. Method names starting with private_ B. Method names ending with _private C. Method names starting with _ D. Method names starting with __ 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