Ruby MCQ Test: Ruby MCQs - Practice Questions
1. In Ruby, what is a 'block'?
2. What is the result of '5.times.map { |i| i * 2 }' in Ruby?
3. Which operator is used for concatenating strings in Ruby?
4.
5. What is the purpose of the 'freeze' method in Ruby?
6. What is the output of the code 'puts 2 * 3' in Ruby?
7. Which method is used to convert a string to uppercase in Ruby?
8. Which Ruby data structure is similar to an array but can contain only unique values?
9. In Ruby, what is the 'yield' keyword used for in a method definition?
10. What is the result of 5 + 3 in Ruby?