Ruby is being used heavily by many companies all over the world for external and internal use. Many of the web’s popular sites like Twitter, Github, and Yellow Pages are built on rails framework. No wonder, Ruby on Rails has emerged as the most sought skills in web development.
Now that Ruby’s begun its march towards global domination, it’s appearing increasing number of resumes. Sometimes while hiring developers, asking the right questions during the interview is a real challenge. It’s difficult to get a solid read on the candidate’s skill set without looking at the projects they have previously worked on.
To ensure you hire a competent ruby on rails developers, I have created a list of ruby on rails interview questions. And, if you want to spend your time interviewing only the cream of the crop you can cut off irrelevant candidates with ruby on rails employment test.
Testing your candidates with online pre-employment assessments is a fantastic way to learn more about them. To help you with online assessments, imocha has created ruby on rails online test that will give a fair shot of all candidates’ skills and applied knowledge. You can screen and hire Ruby Developers that fit the job, and your company.
These assessments give balanced emphasis to both theory and practical questions. With ruby on rails multiple choice questions, theory questions, and practical coding questions employer can easily evaluate candidate’s knowledge on various concepts and coding too.
Before starting interview questions, let’s have a look at the skills required for Ruby on Rails at different levels.
This is nowhere a complete list of skills hiring managers might be looking for in a Ruby on Rails developer. But, these are the basic skills required for a Ruby on Rails developer.
Entry Level
Create and setup a Rails environment
Use generators to create models, controllers, and migrations
Create and use a migration to manage the database
Create a unit test using rspec/etc
Create a model and basic validations
Handle a GET request using a Controller, Model, and View
Handle a POST request using a Controller, Model, and View
Basic HTML, CSS and JavaScript
Basic GIT - clone, commit, push.
MYSQL
Linux Administration
Agile Methodology
Mid-level
Setup and deploy a Rails App for production
Understand the Rails stack - callbacks, filters, plug-ins, engines, gems, rack
Understand and use Active Record associations
Understand and use scopes to define model abstractions
Define tests using Cucumber and rSpec
Understand and use Object Orientation
Understand and use Design Patterns (explain what they are, know some basic patterns)
Linux Administration
Agile Methodology
Senior
Analyze and profile an application for performance and memory issues
Analyzes and profile an application for security issues
Understand database modeling and query analysis
Tune a production deployment (Passenger, Thin, Apache etc)
Understand and use Ruby metaprogramming
Mentoring skills
Communication skills
Planning and Estimation
Below is a list of ruby on rails interview questions for experienced. This list is by no means exhaustive, you can ask more complex questions to know the candidate’s in-depth knowledge. Remember it’s not always the correct answer the candidate gives, but the thought process and problem-solving skills he applies.
1. Define the Rails MVC implementation using an example.
2. Explain how (almost) everything is an object in Ruby
3. Sketch out deployment architecture of a Ruby on Rails application utilizing multiple servers.
4. There are three ways to invoke a method in ruby. Can you give me, at least, two?
5. How can you secure a rails application to counter for Session Fixation?
6. How does validation works? How can one manage validation code?
7. Can clusters share the same memory? Can one cluster handle a request from a client that was handled by another?
8. What are the steps involved in writing and setting up an application in Ruby on Rails?
9. Given:
x = “hello”
Explain the difference between:
x += " world" and
x.concat " world"
10. How can you achieve Multiple Inheritance in Ruby?
11. What is database transactions and how it is represented in Rails?
12. How can you implement method overloading?
13. What’s the issue with the controller code below? How would you fix it?
class CommentsController < ApplicationController
def users_comments
posts = Post.all
comments = posts.map(&:comments).flatten
@user_comments = comments.select do |comment|
comment.author.username == params[:username]
end
end
end
14. What is CSRF? How does Rails protect against it?
15. What is the purpose of load, auto_load, and require_relative in Ruby?
16. How can you call the base class method from inside of its overridden method?
17. How can you implement rails observer for multiple models?
18. Is it possible to embed partial views inside layouts? How?
19. How can we use two databases to a single application?
20. What is a symbol and what the risks of using them in web apps?
21. Consider the following two methods
Method 1 - def times_two(arg1);
puts arg1*2;
end
Method 2 - def sum(arg1, arg2);
puts arg1 + arg2;
end
What will be the result of each of the following lines of code?
times_two 5
times_two(5)
times_two (5)
sum 1, 2
sum(1, 2)
sum(1, 2)
22. What does self mean?
23. How can you achieve the same effect as multiple inheritances using Ruby? What is mixin?
24. How can we implement caching in Rails?
25. How can we install the missing gems that are required by the application in the simplest ways?
26. How can we safeguard a rails application from SQL injection attack? (ask architecture related questions)
Do not hire without seeing the code written under time constraints by the candidates. Interview questions should be extracted from actual problems you sometimes encounter at work. By basing, interview questions on a recently solved problem, it is as accurate a simulation of real work you can get.
Your Questions!
I am relying on you (our readers, hiring managers) to expand this list of interview questions in the comments below. Add your application oriented ruby on rails interview questions for experienced you usually ask in the comments below.