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. When Whitespace characters such as spaces and tabs can not ignored in Ruby code?

While using strings
While using integer
while using float value
All of the above

2. Which statement will execute at the end of the code, whether the exception raise or not?

retry
raise
ensure
else

3. Ruby is designed by?

Yukihiro Matsumoto
Guido van Rossum
Tim Berners-Lee
Brendan Eich

4. What will the following expression evaluate to?

!true && !false

TRUE
FALSE
Syntax Error
None of the above

5. Which of the following statement is not a feature of ruby?

Ruby is interpreted programming language.
Ruby can be used to write Common Gateway Interface (CGI) scripts.
Ruby can be embedded into Hypertext Markup Language (HTML).
Ruby can not be connected to Database.

6. Ruby is ?

procedural language
scripting language
Markup language
Stylesheet language

7. What will be output for the following code?

str2 = String.new ""LetsFindCourse""

puts str2 

LETSFINDCOURSE
letsfindcourse
Error
LetsFindCourse

8. Guess the operator : If Condition is true ? Then value X : Otherwise value Y?

Range Operators
Ternary Operator
Parallel Operator
Arithmetic operator

9. What will be output for the following code?

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

Q
t
C
Error

10. What will be output for the following code?

str = ""Hello Ruby!""
putc str

Hello Ruby!
H
R
Hello

Results