The best place for learning ruby is to get started with the programming-ruby. It fairly covers the important bits in a very readable language. Here are a few quick questions on ruby:
- What is rubygems?
- What is a Symbol?
- What is the difference between a Symbol and String?
- What is the purpose of yield?
- How do you define class variables?
- How do you define instance variables?
- How do you define global variables?
- How can you dynamically define a method body?
- What is a Range?
- How can you implement method overloading?
- What is the difference between '&&' and 'and' operators?
- What is the convention for using '!' at the end of a method name?
- What is a module?
- What is mixin?
- How will you implement a singleton pattern?
- How will you implement a observer pattern?
- How can you define a constant?
- How can you define a custom Exception?
- How can you fire a method when a module is included inside a class?
- What is the default access modifier (public/protected/private) for a method?
- How can you call the base class method from inside of its overriden method?
Rails Specific Questions
A thorough reading of the articles at Ruby on Rails Guides can be very useful for starters as well as a refresher for veterans. The following bunch of questions are specific to rails, in no particular order. The Pragmatic Bookshelf has a fantastic book for beginners called Agile Web Development Using Ruby on Rails.
- Define the Rails MVC implementation using an example.
- What is a named scope? (or Scope in Rails 3).
- Can you give an example of a class that should be inside the lib folder?
- Where should you put code that is supposed to run when your application launches?
- What deployment tool do you use?
- How can you migrate your database schema one level down?
- What is an observer?
- What is a sweeper?
- How can you implement caching in Rails?
- What is a filter? When it is called?
- How can you divide your controllers into separate modules?
- What is RESTful routing?
- How can you list all routes for an application?
- How can you send a multi-part email?
- Is it possible to embed partial views inside layouts? How?
- What is the purpose of RJS?
- How can you create a REST API for your application?
- How can you define a new environment called 'staging'?
- What is Rake?
- What is Capistrano?
- What is a polymorophic association?
- How can you implement a polymorphic association?
- What is a has and belongs to many association?
- What is the difference between has_one and belongs_to?
- How can you implement single table inheritance?
- What is eager loading?
- How can you eager load associated objects?
- How can you add a custom validation on your model?
- How can you implement a custom theme for your forms?
- Why is fields_for used for?
- What is the purpose of a helper method?
- What is flash?
- How can you install the missing gems that are required by your application in the simplest way?
- How can you implement internationalization?
- How can you show search user friendly urls instead of using only numeric ids?
- How can you configure your application for different environments?
- How can you instruct rails logger to ignore passwords and such fields while logging?
Test Frameworks
Ruby on Rails has a number of built-in and a few other third-party test frameworks. Here are a few sample questions on such frameworks:
- Are you familiar with unit testing?
- How does functional testing differ from unit testing?
- Have you ever used a mocking framework?
- Are you familiar with BDD using RSpec or Cucumber?
- What is an alternative to using test fixtures?
- How can you reuse part of a text fixture?
- How do you specify associations in the test fixture yml files?
Plugins
Plugins are the principal mechanism to reuse code. The open-source community is at full-bloom when it comes about plugins. The Rails Plugins site has a really good list of such plugins from the community.
- What plugin would you recommend for user authentication and authorization?
- What plugin do you use for full-text search?
- How can you implement a state machine?
- What is the difference between a plugin and a gem?
- How can you create a plugin?
- Can you please name a few useful plugins?
- How can you implement a search feature that searches for multiple models?
- How can you upload a flie to a server?
Architecture Related Questions
This questions can be from different angles like: quality, security, scalability, manageability, interoperability, reusability and all the other ilities you name! Here are a few example questions:
- Is Rails scalable?
- What are the key deployment challenges?
- How can you safeguard a rails application from SQL injection attack?
- How can you secure a rails application?
- How can rails engage with a SOA platform?
Community Related Questions
I see a fairly large community on Github, Stack Overflow, RailsCasts, The Riding Rails Blog and many more. Some interviewers may want to see if you are connected to the community. The following questions may help you prepare :-)
- Can you tell me a few good community resources for Rails?
- Where would you reach out to get the community to answer your questions?
- What's new in Rails 3.0?
- Which famous applications are built using ruby on rails?
I plan to polish this document on a later revision. But in the meanwhile, if you feel like contributing, you can start commenting with the answers, more questions or suggestions. I believe this will not only help people getting ready for their next Rails job, but also for everyone to see what knowledge we are missing...
Disclaimer: This is not a shortcut, rather its kind of a check list that may help you with an interview.
Disclaimer: This is not a shortcut, rather its kind of a check list that may help you with an interview.
Thanks for sharing questions for ruby on rails.
ReplyDeleteNice Blog. Helps a lot.
ReplyDeleteThanks :-)
Nice work Sandeep. Appreciate your work!
ReplyDelete- Puneet
thanks guys.
ReplyDeleteThank you Sandeep
ReplyDeleteThank u Sandeep :)
ReplyDeleteThanks its very useful to me...
ReplyDeleteIs there answers for these questions?
ReplyDeleteanswer here :
Deletehttp://anilpunjabi.tumblr.com/post/25948339235/ruby-and-rails-interview-questions-and-answers#_=_
Sorry. Please use google.
ReplyDeleteNice Collection
ReplyDeleteYou can check the answer from this website:
ReplyDeletehttp://anilpunjabi.tumblr.com/post/25948339235/ruby-and-rails-interview-questions-and-answershttp://anilpunjabi.tumblr.com/post/25948339235/ruby-and-rails-interview-questions-and-answers
You can check the answer from this website:
ReplyDeletehttp://anilpunjabi.tumblr.com/post/25948339235/ruby-and-rails-interview-questions-and-answers
Nice sandeep, it is useful 2 me, thx yar
ReplyDeleteReally a very nice collection of Questions. I have also collected some questions with their answers in my blog..
ReplyDeletehttp://www.technoscrum.blogspot.in/2013/07/ruby-on-rails-interview-questions.html
Still i am trying to Cover up all the questions mentioned here within a couple of days... Keep in touch
Thanks for a very good and comprehensive list.
ReplyDeleteNice collection sandeep
ReplyDeletehi
ReplyDeleteThank u sandeep
ReplyDeleteNice Blog and thanks for sharing your information we are also providing online training on once have a look http://www.keentechnologies.com/sap-hcm-online-training.html
ReplyDelete