Active Record
- The N+1 query problem - what causes it, how you notice it, and `includes` versus `preload` versus `eager_load`. This is the most asked Rails question.
- Scopes versus class methods, and why a scope should always return a relation.
- Lazy evaluation - when does a relation actually hit the database, and why does calling `.count` in a loop hurt?
- Validations against database constraints, and why you want both.
- Callbacks, and the common senior opinion that heavy callback use makes behaviour hard to follow.
- Migrations that are safe on a large table - adding an index concurrently, avoiding a blocking default backfill.
Rails structure
- The request lifecycle - routing, middleware, controller, view.
- Strong parameters and what they prevent.
- Concerns - and when extracting into one is genuinely sharing behaviour rather than hiding it.
- Background jobs with Active Job, and what makes a job safe to retry.
- Caching layers - fragment, Russian doll, and low-level caching.
- Turbo and Hotwire, if the role uses them.
Ruby itself
- Blocks, procs and lambdas - and the return-behaviour difference between a proc and a lambda.
- Modules for mixins, and the ancestor chain.
- `method_missing` and its cost - plus implementing `respond_to_missing?` alongside it.
- Symbols versus strings.
- Duck typing, and what that changes about how you design interfaces.
Testing and performance
RSpec or Minitest, what you actually test at each level, and a defensible view on fixtures against factories. Then performance: finding slow queries, the N+1 again in production, caching strategy, and what you would do about a slow endpoint - measure first. The database half is in SQL interview questions and PostgreSQL interview questions.
How deep it goes by level
- Junior: the fundamentals above, explained clearly. Nobody expects production scars yet, and saying what you have not done reads better than bluffing.
- Mid-level: the same ground plus an app you have maintained and a performance problem you fixed. Expect follow-ups asking why you made a choice rather than whether you know the syntax.
- Senior: an upgrade across major versions, and how you structured logic as the codebase grew. The recall questions get shorter and the judgement questions get longer.
Whatever the level, say your answers out loud rather than reading them. Most of what candidates lose in a Rails interview is lost between knowing something and explaining it under observation - the method is in how to use AI for interview prep.
Where CoPilot Interview fits
Disclosure: we build an interview assistant, so treat this as a disclosed pitch. CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds, with a permanent free tier that needs no credit card.
Frequently asked questions
What are the most common Ruby on Rails interview questions?
The N+1 query problem and how to fix it, where business logic belongs, Active Record scopes and lazy evaluation, strong parameters, background jobs and retry safety, and the difference between procs and lambdas.
What is the N+1 query problem in Rails?
Loading a collection with one query and then triggering another query per record when accessing an association - 50 posts becomes 51 queries. Fix it by eager loading with `includes`, and detect it by watching the query log or using a tool that flags it in development.
Where should business logic go in a Rails app?
There is no single right answer, which is why it is asked. Models keep logic near the data but grow unwieldy; service objects isolate operations but can fragment behaviour. Interviewers want a reasoned position and an understanding of what each approach costs as the app grows.
What is the difference between a proc and a lambda?
A lambda checks argument count and returns from itself, while a proc ignores extra arguments and returns from the enclosing method. The return behaviour is the part that causes real bugs and the part interviewers are usually probing.
Walk into the round with a second pair of eyes
CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds. The free tier is permanent: 15 minutes a day, no credit card.
Try it free