17th
Apr
Ruby MCQ

Ruby MCQ

  • Admin
  • 17th Apr, 2021
  • 833 Followers

Ruby MCQ Questions

Following are mostly asked Ruby MCQ test that are designed for professionals like you to crack you interviews. You can take this Ruby online test before appearing to you real interview. This Ruby quiz there are around 30+ multiple choice questions on Ruby with four options.

1) Ruby is an object oriented general purpose programming language:

  • A. True
  • B. False

2) Which of these supported by Ruby?

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

3) Which of the following features does the 2.0 version of ruby supports?

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

4) Ruby is?

  • A. markup language
  • B. procedural language
  • C. stylesheet language
  • D. scripting language

5) Ruby is designed by?

  • A. Guido van Rossum
  • B. Tim Berners-Lee
  • C. Yukihiro Matsumoto
  • D. Brendan Eich
Download Free : Ruby MCQ PDF

6) Ruby was created in?

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

7) Which of the following statement is not a feature of ruby?

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

8) Which of the languages syntax matches with the Ruby’s syntax?

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

9) What is the extension used for saving the ruby file?

  • A. .rrb extension
  • B. .rb extension
  • C. .ruby extension
  • D. All of the above

10) Ruby can be embedded into Hypertext Markup Language:

  • A. Yes
  • B. No

11) What does the notation \b stands for?

  • A. space
  • B. newline
  • C. escape
  • D. backspace

12) What is the sequence of ruby strings?

  • A. 8-bit bytes
  • B. 32-bit bytes
  • C. 64-bit bytes
  • D. 16-bit bytes

13) Which of the following is not a valid datatype in Ruby?

  • A. integer
  • B. timedate
  • C. float
  • D. binary

14) How includes all stylesheet files?

  • A. <%= link_to ... %>
  • B. <%= stylesheet_link_tag :all %>
  • C. <%= javascript_include_tag :defaults %>
  • D. <%= csrf_meta_tag %>

15) How do you make sure your forms don’t get hacked?

  • A. <%= stylesheet_link_tag :all %>
  • B. tweets_path
  • C. <%= csrf_meta_tag %>
  • D. <%= link_to ... %>

16) What is a controller?

  • A. An array uses indices and a hash uses “keys”
  • B. When the order matters, use an array.
  • C. A controller is a container for a group of (possibly dynamic) web pages.
  • D. It’s a test that simulates a browser accessing our application.

17) Which of the following are valid floating point literal?

  • A. 5
  • B. 2
  • C. 0.5
  • D. 0.6

18) Which character is used to give comment in ruby?

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

19) Reserved word can not be used as?

  • A. variable names
  • B. strings
  • C. constant
  • D. Both A and C

20) On which platform ruby runs:

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

21) Ruby was written in?

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

22) Block comment conceals several lines from the interpreter with?

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

23) Why do we use =begin and =end?

  • A. To avoid the use of # again and again
  • B. To mark the start and end of multiline comment
  • C. To comment multiple lines
  • D. All of the above

24) Ruby 2.7.1 version release date?

  • A. 31-04-1999
  • B. 31-05-2015
  • C. 31-03-2020
  • D. 31-06-2010

25) What is the output of the given code? “Ruby” length #to find the length of given string

  • A. To find the length of given string
  • B. Ruby
  • C. 4 to find the length of given string
  • D. 4

26) This the right way to comment a single line. “Ruby”.length # I’m a single line comment!

  • A. True
  • B. False

27) Why do we use comments?

  • A. It is an efficient way of programming
  • B. It makes easy for the third person to understand
  • C. For later use to understand the working of the program
  • D. All of these

28) Which of these is not a valid library function?

  • A. Print
  • B. Get
  • C. Gets
  • D. Puts

29) Why is the library function ‘puts’used for?

  • A. Prints whatever is given and insert a new(blank) line
  • B. Gets input from the user
  • C. Prints whatever is given and print it to the screen
  • D. none

30) Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?

  • A. Fixnum
  • B. Binary
  • C. Bignum
  • D. Octal

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Apr
Wordpress MCQ
01st
May
Spring MCQ
01st
May
Hadoop MCQ
01st
Apr
Django MCQ
01st
Apr
Terraform MCQ