Ruby Programming Quiz


Play this quiz that will help you to excel in Ruby certification exams, placements etc. This Ruby programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Ruby programming test enables you to assess your knowledge of Ruby programming.

Take the Free Practice Test



Ruby MCQs

Practice Ruby MCQ Questions, which will help you to understand Ruby Programming related concepts and also helps you to prepare for placements, interviews, competitive exams etc.

Ruby Quiz

Try Free Ruby Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Ruby Quiz

1. What will be the output of the given code?

num=(10<11)||(11===11)? (11===11.0): 0
puts num

TRUE
FALSE
1
0

2. Reserved word can not be used as?

constant
variable names
Both A and B
None of the above

3. Global variables in ruby begin with?

@
#
$
&

4. Why notation is used in Ruby?

Formfeed
Escape
Carriage return
Bell

5. What will be the output of the given code?

for num in 1...4

   puts num*num

end

0 1 4 9
1 4 9 16
0 1 2 3
1 2 3

6. what will be output for the following code?

str1 = LFC puts "str1: #{str1}"

str1: LFC
str1: #{str1}
str1: {LFC}
str1: #{LFC}

7. Which type of number(0b1011 ) is ?

Octal
Hexadecimal
Binary
Decimal

8. What will be the output of the given code?

 boolean_var = !(100 / 10 === 10)
puts boolean_var

TRUE
FALSE
Type Error
Syntax Error

9. What will be output for the following code?

str = "LetsFindCourse Ruby MCQs" puts str[2]

t
e
MCQs
Ruby

10. Which of the following is Exit Controlled loop?

do..while
For
Until
While

Results