Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Ruby On Rails Online 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
  • Controllers
  • Models

Useful for hiring

  • RoR Developer (2-4 yrs of experience)
  • RoR Programmer
  • Ruby on Rails Application Developer

Start hiring job-fit candidates using this assessment

GET A DEMO

"Our recruiters no longer rely only on the telephonic interviews. We shortlist candidates based on assessment reports. The detailed test reports provide skill wise analysis of each candidate. This has helped our clients reduce their time to hire by 60%."

Vipin Sharma, Mobile Programming,
General Manager HR & Recruitement
Question

To randomize the order of entries in an Array, use the _______ method.

Answer
    • sample

    • shuffle

    • random

    • sort

    • scramble

Question

Determine the value of the variable x after the execution of the following code. x = [1,2,3] x.pop until x.empty? x.push(4) while x.empty?

Answer
    • [1]

    • [1,2,3,4]

    • [4]

    • [1,2,3]

Question

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.

Answer
    • 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

Which return values are correct for Bar class?
class Bar
  def initialize(*args)
    @args = args
    if args.size == 3
      foo
    else
      calculate
    end
  end
  def foo
    @total = @args.inject(:+)
  end
  def calculate
    total = 0
    @args.each { |el| total += el if el % 2 == 0 }
    @total = total
  end
  def total
    @total
  end
end

Note: There are multiple correct answers to this question.

Answer
    • bar = Bar.new(1,2,3)
      bar.total # => 6

    • bar = Bar.new(1,2,3,4,5)
      bar.total # => 6

    • bar = Bar.new(1,2,3,1)
      bar.total # => 3

    • bar = Bar.new(3,2,3)
      bar.total # => 3

Question

How can you add a class 'contacts' for form_tag in rails view?

Answer
    • <%= form_tag root_path, class: 'form-inline' do %>
          <%= text_field_tag :email %>
        <% end %>

    • <%= form_tag root_path, html: { class: 'form-inline' } do %>
          <%= text_field_tag :email %>
        <% end %>

    • <%= form_tag class: 'form-inline', root_path do %>
          <%= text_field_tag :email %>
        <% end %>

    • <%= form_tag html: { class: 'form-inline' }, root_path do %>
          <%= text_field_tag :email %>
        <% end %>

Test details:

Ruby on Rails coding test enables employers to identify & hire potential ROR developers. Therefore, an emphasis is laid upon evaluating the knowledge of applied skills gained through real work experience rather than theoretical knowledge.

The Ruby on Rails test contains MCQ's (Multiple Choice Questions), MAQ's (Multiple Answer Questions), Fill in the Blank, Descriptive, True or False.

Test Duration: 30 minutes
 
No. of Questions: 30

The Ruby on Rails online test contains a combination of application and theory questions that helps you to evaluate technical as well as practical skills of candidates.

Test description:

Ruby on Rails Online Test is created & validated by our global subject matter experts (SME)s to assess the Ruby programming skills of  ROR developer on Rails - as per Industry Standards.

Ruby on Rails (RoR) is an open-source web application framework written in Ruby, an object-oriented programming language. Rails is a model–view–controller ( MVC ) framework, providing default structures for a database, a web service and web pages. It encourages and facilitates the use of web standards such as XML or JSON for data transfer and HTML, CSS, and JavaScript for display and user interfacing. In addition to MVC, Rails emphasizes on convention over configuration (CoC), don't repeat yourself (DRY) and the active record pattern. Ruby is an open source, dynamic programming language that supports multiple programming paradigms.

The Ruby on Rails programming test helps recruiters & hiring managers to validate skills of the candidates related to Ruby programming on Rails framework before hiring.
 

Online Ruby on Rails 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 

  • Controllers

  • Models


Screen under-qualified candidates using our scientifically designed Ruby on Rails knowledge test & spend the time interviewing only relevant candidates.

Our hiring analytics will be generated instantly which gives you a detailed analysis of technical skills related strengths & weaknesses of the candidates. It will help you in making better hiring decisions.

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO