Online Ruby Test

10 Questions | Attempts: 304
Share

SettingsSettingsSettings
Online Ruby Test - Quiz

Ruby is an important object-oriented scripting language used on Rails web framework. Are you a beginner or a Ruby expert? If yes, take this quiz, it's for you.


Questions and Answers
  • 1. 

    Ruby was designed and developed by who and in what year? 

    • A.

      Larry Wall in 1987

    • B.

      Yukihiro Matsumoto in 1993

    • C.

      James Gosling in 1995

    • D.

      Bjarne Stroustrup in 1979

    Correct Answer
    B. Yukihiro Matsumoto in 1993
  • 2. 

    $LOAD_PATH is used to 

    • A.

      Make Ruby aware that included files must be searched in the current directory

    • B.

      Include statement in a class

    • C.

      Show multiple inheritance

    • D.

      Terminate a string

    Correct Answer
    A. Make Ruby aware that included files must be searched in the current directory
  • 3. 

    Which of the following is not a feature of object-oriented programming language? 

    • A.

      Data Encapsulation

    • B.

      Data Abstraction

    • C.

      Polymorphism

    • D.

      Morphism

    Correct Answer
    D. Morphism
  • 4. 

    The blueprint from which individual objects are created is 

    • A.

      A class

    • B.

      An object

    • C.

      A variable

    • D.

      A string

    Correct Answer
    A. A class
  • 5. 

    Which of the following variables are not available across classes?

    • A.

      Class variables

    • B.

      Local variables

    • C.

      Global variables

    • D.

      Instance variables

    Correct Answer
    C. Global variables
  • 6. 

    The variables that are defined in a method are

    • A.

      Global variables

    • B.

      Local variables

    • C.

      Instance variables

    • D.

      Class variables

    Correct Answer
    B. Local variables
  • 7. 

    Which of the following is a constant resolution operator? 

    • A.

      ::

    • B.

      [ ] [ ]=

    • C.

      **

    • D.

      ! ~ + -

    Correct Answer
    A. ::
  • 8. 

    The same block of codes in a specified number of times can be executed by

    • A.

      Strings

    • B.

      Conditional statements

    • C.

      Variables

    • D.

      Loops

    Correct Answer
    D. Loops
  • 9. 

    Which of the following blocks are executed in the order they are encountered?

    • A.

      MAIN block

    • B.

      END block

    • C.

      BEGIN block

    • D.

      ACTUAL block

    Correct Answer
    C. BEGIN block
  • 10. 

    Which of the following is a means of embedding the value of any Ruby expression into a string using #{ and } −

    • A.

      Expression substitution

    • B.

      General delimited strings

    • C.

      Escape characters

    • D.

      Character encoding

    Correct Answer
    A. Expression substitution

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 19, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 25, 2018
    Quiz Created by
    Stephanie Young

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.