Ruby on Rails interview questions

Want to become an expert in cracking Ruby on Rails interview questions?

Start with practicing the questions below. Whether a question involves multiple choice or live coding, we will give you hints as you go and tell you if your answers are correct or incorrect.

After that, take our timed public Ruby on Rails interview questions test.

To use our service for testing developers, purchase one of the paid plans for companies.


1. ContactsMigration
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.text :address
      t.integer :tnumber
    end

    rename_column :contacts, :tnumber, :telephone_number
    add_timestamps(:contacts, null: true)
  end
end
Easy  
3min
Solve question

2. EmployeeSearch
Ruby on Rails Database abstraction Public

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

employees
idnameage
1Steve21
2John44
3Amy26
4Marcus44

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

Easy  
3min
Solve question

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

  • Ruby on Rails online test ( Easy )
Not exactly what you are looking for? Go to our For developers section.