Ruby MCQ Questions

This section focuses on "Basics" in Ruby. These Multiple Choice Questions (MCQ) should be practiced to improve the Ruby skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. Ruby is ?

A. procedural language
B. scripting language
C. Markup language
D. Stylesheet language

View Answer


2. Ruby is designed by?

A. Yukihiro Matsumoto
B. Guido van Rossum
C. Tim Berners-Lee
D. Brendan Eich

View Answer


3. On which platform ruby runs on ?

A. Windows
B. Mac OS
C. Unix
D. All of the above

View Answer


4. Ruby was created in?

A. 1992
B. 1993
C. 1994
D. 1995

View Answer


5. Ruby was written in?

A. C
B. C++
C. Java
D. Objective C

View Answer


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

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

View Answer


7. Which will be output for the followinf code?

puts "Hello, Ruby!";

A. Hello, Ruby
B. Hello Ruby!
C. Hello, Ruby!
D. Hello Ruby

View Answer


8. When Whitespace characters such as spaces and tabs can not ignored in Ruby code?

A. While using strings
B. While using integer
C. while using float value
D. All of the above

View Answer


9. Which of the following is not a Reserved Words in Ruby?

A. begin
B. ensure
C. retry
D. pass

View Answer


10. Reserved word can not be used as?

A. constant
B. variable names
C. Both A and B
D. None of the above

View Answer


11. Which statement is used to declares code to be called before the program is run?

A. Start
B. Begin
C. Here
D. End

View Answer


12. Which character is used to give comment in ruby?

A. !
B. @
C. #
D. $

View Answer


13. Block comment conceals several lines from the interpreter with?

A. =begin and =end
B. =start and =end
C. =here and =end
D. =begin and =ending

View Answer


14. Which of the following is a Reserved Words in Ruby?

A. do
B. or
C. in
D. All of the above

View Answer


15. Which of the following is supported by Ruby?

A. Dynamic Type System
B. Multiple Programming Paradigms
C. Automatic Memory Management
D. All of the above

View Answer


16. Which of the following features does the 2.0 version of ruby supports?

A. New literals
B. Security fixes
C. Method keyword arguments
D. All of the above

View Answer


17. Which of the following languages syntax matches with the Ruby's syntax?

A. C
B. Perl
C. PHP
D. Java

View Answer


18. What is the extension used for saving the ruby file?

A. .rb extension
B. .ruby extension
C. .rrb extension
D. .rbb extension

View Answer


19. Which of the following are valid floating point literal?

A. 0.5
B. 5
C. 0.5
D. 5

View Answer


20. Ruby 2.7.1 version release date?

A. 31-03-2019
B. 31-01-2020
C. 31-03-2020
D. 31-04-2019

View Answer





Discussion



* You must be logged in to add comment.

pHqghUme
555

pHqghUme
555

pHqghUme
555

pHqghUme
-1 OR 2+101-101-1=0+0+0+1 --

pHqghUme
-1 OR 3+101-101-1=0+0+0+1 --

pHqghUme
-1 OR 3*2<(0+5+101-101) --

pHqghUme
-1 OR 3*2>(0+5+101-101) --

pHqghUme
-1 OR 2+676-676-1=0+0+0+1

pHqghUme
-1 OR 3+676-676-1=0+0+0+1

pHqghUme
-1 OR 3*2<(0+5+676-676)

pHqghUme
-1 OR 3*2>(0+5+676-676)

pHqghUme
-1' OR 2+162-162-1=0+0+0+1 --

pHqghUme
-1' OR 3+162-162-1=0+0+0+1 --

pHqghUme
-1' OR 3*2<(0+5+162-162) --

pHqghUme
-1' OR 3*2>(0+5+162-162) --

pHqghUme
-1' OR 2+695-695-1=0+0+0+1 or 'Wy1IGcv7'='

pHqghUme
-1' OR 3+695-695-1=0+0+0+1 or 'Wy1IGcv7'='

pHqghUme
-1' OR 3*2<(0+5+695-695) or 'Wy1IGcv7'='

pHqghUme
-1' OR 3*2>(0+5+695-695) or 'Wy1IGcv7'='

pHqghUme
-1" OR 2+417-417-1=0+0+0+1 --

pHqghUme
-1" OR 3+417-417-1=0+0+0+1 --

pHqghUme
-1" OR 3*2<(0+5+417-417) --

pHqghUme
-1" OR 3*2>(0+5+417-417) --

pHqghUme
if(now()=sysdate(),sleep(15),0)

pHqghUme
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z

pHqghUme
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z

pHqghUme
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/

pHqghUme
-1; waitfor delay '0:0:15' --

pHqghUme
-1); waitfor delay '0:0:15' --

pHqghUme
1 waitfor delay '0:0:15' --

pHqghUme
GMUI8ayd'; waitfor delay '0:0:15' --

pHqghUme
-5 OR 694=(SELECT 694 FROM PG_SLEEP(15))--

pHqghUme
-5) OR 562=(SELECT 562 FROM PG_SLEEP(15))--

pHqghUme
-1)) OR 520=(SELECT 520 FROM PG_SLEEP(15))--

pHqghUme
wEnM8drz' OR 172=(SELECT 172 FROM PG_SLEEP(15))--

pHqghUme
7mf1s7hs') OR 795=(SELECT 795 FROM PG_SLEEP(15))--

pHqghUme
r1xZ7fSJ')) OR 100=(SELECT 100 FROM PG_SLEEP(15))--

pHqghUme
555*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)

pHqghUme
555'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'

pHqghUme
1'"

pHqghUme

pHqghUme
@@3Q2Ts

pHqghUme
555

pHqghUme
555

pHqghUme
555