Ruby Test

Topics covered

Ruby Basics, Control Flow in Ruby, Looping with Ruby, Array and Hashes, Blocks and Sorting, Hashes and Symbols, Blocks, Procs, and Lambdas, Object Oriented Programming , Modules and Mixins, Working with Files, Metaprogramming

  • MAQ (Multiple Answer Question)
  • MCQ (Multiple Choice Question)
  • Descriptive Question
  • White Board Simulator
  • Coding Simulator
  • Audio Question
  • Video Question
  • Case Study Question

Ruby is one of the flexible and powerful programming languages. This language is used for Web / Internet Development to process text, to create games and also as a part of popular Ruby on Rails framework. Ruby is a high level and interpreted programming language like Python and PERL. Ruby has similar syntax to that of C++ and PERL and is much scalable for big programs execution. Due to its easy and clean syntax, it is easier for a developer to learn Ruby language. This Ruby test is specially designed to check application, practical skills of a Ruby developer – as per Industry Standards. Our Ruby skill test is created and validated by Subject Matter Experts.

Test Topics:

The test contains questions on following topics:

  • Ruby Basics

  • Control Flow in Ruby

  • Looping with Ruby

  • Array and Hashes

  • Blocks and Sorting

  • Hashes and Symbols

  • Blocks, Procs, and Lambdas

  • Object Oriented Programming 

  • Modules and Mixins

  • Working with Files

  • Metaprogramming 

The Ruby test contains MCQ's (Multiple Choice Questions), MAQ's (Multiple Answer Questions), Fill in the Blank, Descriptive, True or False. Using powerful reporting, you will have a detailed analysis of test results to help you make better decisions and predict candidate and employee success. 

This pre-employment test is useful for hiring:
  • Ruby Engineer 

  • Ruby Software Developer (0-3 years experience) 
  • Ruby Developer 

Test details:

Ruby online test enables employers and recruiters to identify potential hires by evaluating working skills and job readiness. For this reason, the emphasis is laid upon evaluating the knowledge of applied skills gained through real work experience, rather than theoretical knowledge. 

Test Details: 20 minutes 

  • 15 Application Oriented Questions

  • 05 Theory Questions 

The combination of Application and Theory questions helps to evaluate Technical as well as practical Skills of Candidates

Ruby Test

Question #1 of 3

How is it possible to refactor this class correctly?
class NullOrder
  def price_euro
    0.0
  end
  def price_usd
    0.0
  end
end 

Note: There are multiple correct answers to this question.

    • class NullOrder
      def price_euro
      0.0
      end
      alias price_usd price_euro
      end

    • class NullOrder
      def price
      0.0
      end
      end

    • class NullOrder
      def method_missing(m, *args, &block)
      m.to_s =~ /euro|usd/ ? 0.0 : super
      end
      end

    • class NullOrder
      def method_missing(m, *args, &block)
      m.to_s =~ /price_/ ? 0.0 : super
      end
      end

Question #2 of 3

Given an array, an index and a default value as input. Which code returns the element by that index; if no element exists with given index then return the default value? Index can be a negative integer, which means going over the array backwards from the end.

Note: There are multiple correct answers to this question.

    • def bar(array, index, value)
      return array[index] if array[index]
      value
      end

    • def bar(array, index, value)
      answer = array[value]
      return answer if answer
      index
      end

    • def bar(array, index, value)
      answer = array[index]
      return value unless answer
      answer
      end

    • def bar(array, index, value)
      answer = array.first
      return answer if value
      index
      end

Question #3 of 3

Which is a shortcut for writing these 2 methods for User class?

  def name=(value)
    @name = value
  end
  def name
    @name
  end

Note: There are multiple correct answers to this question.

    • class User
      attr_reader :user
      end

    • class User
      attr_writer :user
      end

    • class User
      attr_accessor :user
      end

    • class User
      attr_reader :user
      attr_writer :user
      end

SAMPLE REPORT
Candidate Name: David Messi Test Date: 28-May-2014
Test Name: Ruby Test Test Start Time: 13.30

Score: 11 Out Of 20

Percentage: 55

Result: FAIL

passing score image
SECTION PERFORMANCE
Section Name FAIL PASS
Ruby Theory
Score: 5/5
Ruby Application
Score: 6/15
STRENGTH AND WEAKNESS
Strength Ruby Theory
Weakness Ruby Application
* Note: If score <= 40 then its a Weakness. If score >= 80 then its a Strength.
ONLINE PROCTORING
0%
10 20 30 40 50 60 70 80 90 100%
Tolerable Limit Not acceptable
Window Violation: 0 | Time Violation: 0 secs
CANDIDATE DETAILS
Gender : Male Phone Number : +1-541-754-3010
Total Experience (Years) : 3 Total Experience (Months) : 5
Skill Set : Ruby Theory Current Employer : Interview Mocha
Current Job Title : Solution Architect Current Salary : 600.00
Expected Salary : 1000000.00 Current Location : Chicago

Sign up for a free trial today

Get your free trial and test up to 10 candidates. No strings attached. No credit card required.

SIGN UP FOR FREE

Schedule a Demo

How Interview Mocha works?

  • Add this test to your account

  • Invite candidates to take this test online

  • Candidates take the test

  • View and share actionable test reports

Trusted by leading brands worldwide

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • hexaware
Why hiring managers and recruiters across the globe love Interview Mocha
  • Largest number of ready pre-employment skill tests
  • Relevant test compositions and quality questions designed by Subject Matter Experts (IM SME)
  • Fastest custom test creation DNA
  • World’s most super easy skill assessment platform
  • High level of platform security implementation
  • Friendly and quick customer support
  • Ready to listen and implement your feedback, we are all ears
  • Affordable pricing

Sign up for a free trial today

Get your free trial and test up to 10 candidates. No strings attached. No credit card required.

SIGN UP FOR FREE

Schedule a Demo