Rails makes it easy to be productive and easy to write slow, tangled apps. These questions check whether a candidate understands the conventions, not just the generators.
Hiring a Ruby on Rails developer is easy. Telling a real one from a convincing résumé is the hard part — and it’s most of what we do. These are grouped by level, because the same question that stretches a junior is a warm-up for a senior.
Junior Ruby on Rails interview questions
0–2 years
MVC and ActiveRecord basics.
What is the MVC pattern in Rails?
Models hold data and business rules, controllers handle requests, views render output; Rails wires them by convention.
Puts business logic in views or controllers.
What is ActiveRecord?
The ORM mapping Ruby objects to database rows, providing querying, associations and validations.
Writes raw SQL for everything, ignoring the ORM.
What does “convention over configuration” mean?
Rails assumes sensible defaults (naming, structure) so you write less config; following conventions keeps apps consistent.
Fights the conventions and configures everything manually.
What are migrations?
Versioned, incremental schema changes checked into source control so the database evolves reproducibly.
Edits the database by hand outside migrations.
What are validations and where do they belong?
Model-level rules ensuring data integrity before persistence (presence, uniqueness, format).
Validates only in the view/JS and trusts the client.
What are strong parameters?
A controller mechanism whitelisting permitted attributes to prevent mass-assignment vulnerabilities.
Permits all params, opening a security hole.
What is the difference between render and redirect_to?
render renders a view in the same request; redirect_to issues a new request to another URL.
Renders after a POST and causes duplicate submissions.
What are associations (has_many, belongs_to)?
Declarations that model relationships between tables and generate helper methods.
Manually joins with raw queries instead.
Mid-level Ruby on Rails interview questions
2–5 years
Queries, callbacks and jobs.
What is the N+1 query problem in Rails?
Loading associated records one query per parent; fixed with eager loading via includes.
Iterates associations in a view, firing hundreds of queries.
What are ActiveRecord callbacks and their risks?
Hooks around lifecycle events (before_save, after_create); overusing them hides logic and causes surprising side effects.
Stuffs complex logic and external calls into callbacks.
How do background jobs work?
Queued via ActiveJob with a backend (Sidekiq/Resque) to offload slow work from the request cycle.
Does slow work like emails synchronously in the request.
What is the difference between where, find and find_by?
where returns a relation, find fetches by id (raises if missing), find_by returns the first match or nil.
Uses find on user input and triggers unhandled exceptions.
What are scopes?
Reusable, chainable query fragments defined on a model for readable, composable queries.
Duplicates the same where-clauses across the app.
How does Rails handle sessions and CSRF?
Signed cookies for sessions and a CSRF token verified on state-changing requests.
Disables CSRF protection to make forms work.
What are concerns and when do you use them?
Modules to share behaviour across models or controllers; useful but can become a dumping ground.
Uses concerns to hide a fat model’s complexity.
How do you write and run tests in Rails?
Model, controller/request and system tests with fixtures or factories; a fast, meaningful suite guides refactoring.
Ships features with no tests.
Senior Ruby on Rails interview questions
5+ years
Performance and architecture.
How do you diagnose a slow Rails endpoint?
Profile queries and view rendering, check for N+1s, missing indexes, and slow external calls; use tooling like the query log and APM.
Adds caching to hide an unindexed query.
How do you keep models from becoming god objects?
Extract service objects, value objects, form objects and query objects to keep responsibilities focused.
Lets one model grow to thousands of lines.
How do you cache effectively in Rails?
Fragment/Russian-doll caching, low-level caching and HTTP caching, with careful key design and invalidation.
Caches without an invalidation strategy and serves stale data.
How do you handle database migrations safely at scale?
Backward-compatible, non-blocking migrations, adding indexes concurrently, and separating deploy from data backfill.
Runs a blocking migration on a huge table at peak.
How do you secure a Rails app?
Strong params, escaping output, parameterised queries, CSRF protection, and keeping dependencies patched.
Interpolates user input into SQL strings.
How do you scale a Rails application?
Horizontal app servers, a job queue for async work, read replicas and caching, plus connection-pool tuning.
Assumes one server scales indefinitely.
What are the tradeoffs of Rails in 2026?
Excellent developer velocity and a mature ecosystem, versus runtime performance and concurrency limits that need care at scale.
Presents Rails as flawless or hopeless.
How do you manage a large legacy Rails codebase?
Characterisation tests, incremental refactoring, extracting services, and upgrading dependencies steadily.
Proposes a risky big-bang rewrite.
Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.