Loading...
QUIZ

Certification Test

 
Que No. 1 ) What is Ruby primarily known for?

A.) Game development
B.) Web development
C.) Mobile app development
D.) Scientific computing


Que No. 2 ) In Ruby, which keyword is used to define a class?

A.) class
B.) def
C.) module
D.) include


Que No. 3 ) Which symbol is used to define a symbol in Ruby?

A.) $
B.) @
C.) :
D.) #


Que No. 4 ) What is the result of 5 + "5".to_i in Ruby?

A.) 10
B.) "55"
C.) Error
D.) 55


Que No. 5 ) In Ruby, how do you print output to the console?

A.) console.log("Hello, Ruby!")
B.) puts "Hello, Ruby!"
C.) print("Hello, Ruby!")
D.) echo "Hello, Ruby!"


Que No. 6 ) Which data type is used to store whole numbers in Ruby?

A.) double
B.) float
C.) integer
D.) char


Que No. 7 ) What is the purpose of the self keyword in Ruby?

A.) To define a class
B.) To create an instance of a class
C.) To refer to the current object or class
D.) To declare a variable


Que No. 8 ) How do you define a constant in Ruby?

A.) constant x = 10
B.) x = 10 (constant)
C.) CONST x = 10
D.) X = 10


Que No. 9 ) Which of the following is not a valid variable name in Ruby?

A.) my_var
B.) _var
C.) 123var
D.) var123


Que No. 10 ) What is the purpose of the if statement in Ruby?

A.) To define a loop
B.) To execute code based on a condition
C.) To create an object
D.) To declare a variable