Here are some real life Ruby and Rails questions that you maybe asked in a job interview. These are based on my experience in applying for contract positions. I have not provided the answers, I will leave that as an exercise to the reader (as they say).
General Object-Oriented and Programming Questions
- What is polymorphism?
- What is overriding and oveloading?
- What does a test suite contain? (e.g. setup, fixtures, assertions)
Ruby Theory Questions
- What is a Singleton Method?
- What is the difference between a block, lamda and proc?
- What is the super class of Class?
- What is the super class of Module?
- What is a class variable vs. a constant?
- What do you like about Ruby?
Ruby Practical Questions
- Print the numbers 1 to 10 in the console
- Create a custom method to iterate over an array contain negative and positive numbers and only print the positive numbers
General Algorithm Questions
- Reverse an interger, e.g. 12345 => 54321, without converting to a string
- Perform a Binary Search on an array of numbers to find a target number
- What is the difference between #destroy and #delete?
- What modules make up Rails? (e.g. ActiveRecord)
- What is ActiveSupport?
- What two extension methods does ActiveSupport contains?
- What association methods does ActiveRecord provide?
- Which table is the foreign key related in a belongs_to association?
- What annoys you about Rails?
- Describe a situation where you had to work outside of the Rails stack or customize Rails to make it meet project requirements?
- What is an index?
- How is an index implemented?
- When would you use an index?
- What are the first things to look at with a slow query containing a join?
- What is an outer right join?
These questions are ones that I have been asked personally. Please add questions you have been asked in the comments. I'm sure there are some I am missing so I will update this post as they come to mind.