Ruby on Rails Professional Standards & Competencies 2 — Questions and Answers
Question 1: A Rails developer discovers a critical security vulnerability in a gem used by a client's production app. What is the professional best practice?
- Ignore it unless the client reports issues
- Notify the client immediately and provide a remediation plan (Correct answer)
- Silently patch and deploy without telling anyone
- Wait for the gem maintainer to release a fix first
Correct answer: Notify the client immediately and provide a remediation plan
Professional responsibility requires immediate disclosure to the client with a clear remediation plan so they can make informed risk decisions.
Question 2: Which Rails convention promotes the 'Convention over Configuration' principle to reduce cognitive overhead for team members?
- Using custom directory structures per project
- Placing models in app/models, controllers in app/controllers, and views in app/views (Correct answer)
- Storing all logic in a single lib/ directory
- Configuring every component explicitly in application.rb
Correct answer: Placing models in app/models, controllers in app/controllers, and views in app/views
Rails' standard directory layout (app/models, app/controllers, app/views) is the canonical expression of Convention over Configuration, enabling any Rails developer to navigate any Rails project.
Question 3: When writing Rails migrations on a team, why should you never edit a migration that has already been committed and run in production?
- Because Rails will delete the file automatically
- Because other developers' schema versions will diverge and rollback becomes unreliable (Correct answer)
- Because ActiveRecord does not support editing migration files
- Because schema.rb is locked after the first migration
Correct answer: Because other developers' schema versions will diverge and rollback becomes unreliable
Editing a previously-run migration breaks the shared schema history, making rollbacks and recreating databases from scratch unreliable for all team members.
Question 4: A colleague submits a PR with 2,000-line controller actions containing business logic. What is the professional Rails standard response?
- Approve it to avoid conflict
- Request a refactor extracting logic into service objects or models per the Skinny Controller principle (Correct answer)
- Merge it and refactor later without telling anyone
- Rewrite the PR yourself and force-push to their branch
Correct answer: Request a refactor extracting logic into service objects or models per the Skinny Controller principle
The Rails community standard 'Skinny Controller, Fat Model' calls for business logic to live in models or service objects, and a code review is the right venue for this feedback.
Question 5: What does it mean professionally to 'own' a Rails feature end-to-end?
- Writing only the model layer
- Taking responsibility for design, implementation, testing, deployment, and monitoring of the feature (Correct answer)
- Assigning subtasks to junior developers only
- Completing the feature without writing tests
Correct answer: Taking responsibility for design, implementation, testing, deployment, and monitoring of the feature
Professional feature ownership means a developer is accountable for the entire lifecycle, from implementation through production health, not just writing the initial code.
Question 6: Which tool is the Rails community standard for enforcing consistent code style across a team?
- Minitest
- RuboCop with the rubocop-rails extension (Correct answer)
- Brakeman
- Bundler Audit
Correct answer: RuboCop with the rubocop-rails extension
RuboCop with rubocop-rails is the de facto Rails community linter that enforces both Ruby and Rails-specific style guidelines across teams.
Question 7: A Rails developer is asked to estimate a feature but is unsure of the complexity. What is the professional approach?
- Give a very short estimate to appear confident
- Provide a range estimate and identify unknowns that need a spike or discovery phase (Correct answer)
- Refuse to estimate until all requirements are complete
- Give the longest possible estimate as a buffer
Correct answer: Provide a range estimate and identify unknowns that need a spike or discovery phase
Providing a range with explicit unknowns and proposing a time-boxed spike is the professional engineering practice for uncertain estimates.
A Rails developer discovers a critical security vulnerability in a gem used by a client's production app.
What is the professional best practice?