Ruby on Rails Interview Questions

Practice for Ruby on Rails interviews by solving TestDome questions. Our interview questions are used by more than 7,000 companies and 450,000 individual test takers.

Jobseekers: Certify Your Knowledge

Take a Certification Test

Companies: Use Our Tests for Screening

Buy a Pack Of Candidates

Need to practice your Ruby on Rails skills for an upcoming job interview? Try solving these Ruby on Rails interview questions that test knowledge of HTTP routing, database abstraction and migration, and other skills. We’ll provide feedback on your answers, and you can use a hint if you get stuck.

These Ruby on Rails interview questions are examples of real tasks used by employers to screen job candidates such as Ruby developers, Ruby on Rails developers, back-end developers, and others that require knowledge of the Ruby on Rails web application framework.

1. Contacts Migration

Ruby on Rails Database Migrations Public

Select all statements that are correct after the following migration has been executed:

class ContactsMigration < ActiveRecord::Migration
  def change
    create_table :contacts do |t|
      t.string :name
      t.integer :telephone_number
      t.text :address, null: false

(Select all acceptable answers.)

Solve Question

2. Employee Search

Ruby on Rails Database Abstraction Public

A company database contains the following table, in which id is the primary key:


id name age
1 Steve 21
2 John 44
3 Amy 26
4 Marcus 44

Select all the statements that return only the employee with name "John" (id = 2).

(Select all acceptable answers.)

Solve Question

3. Record Route

Ruby on Rails HTTP Routing Public

Consider the following controller and view definitions:

class RecordsController < ApplicationController
  def update
    @record = Record.find(params[:id])
<%= form_for @record do |f| %>
<%= render 'form', f: f %>
<% end %>

Select the statements that can be used to update a record.

(Select all acceptable answers.)

Solve Question

If you feel ready, take one of our timed public Ruby on Rails Interview Questions tests:

Ruby on Rails Online Test (Easy / Hard)

Not exactly what you are looking for? Go to our For Jobseekers section.
Dashboard Start Trial Sign In Home Tour Tests Questions Pricing For Jobseekers