在网上找到一些关于Ruby On Rails面试会经常被提问到的一些相关基础知识。或许可以试着回答下,看看自己对这些问题的看法。对每个问题如有自己的见解,欢迎留言探讨。
-
What is a class?
-
What is the difference between a class and a module?
-
What is an object?
-
How would you declare and use a constructor in Ruby?
-
How would you create getter and setter methods in Ruby?
-
Describe the difference between class and instance variables?
-
What are the three levels of method access control for classes and what do they signify?
-
What does ‘self’ mean?
-
Explain how (almost) everything is an object in Ruby.
-
Explain what singleton methods are. What is Eigenclass in Ruby?
-
Describe Ruby method lookup path.
-
Describe available Ruby callbacks. How can we use them in practice?
-
What is the difference between Ruby’s Hash and ActiveSupport’s HashWithIndifferentAccess?
-
What is the difference between Proc and lambda?
-
The Second Series of Ruby Questions: Business Applications
-
Knowing the basics isn't enough to work for RubyGarage or for any other serious web development company. A programmer should also be able to explain how to write code for business applications. Since Rack is a very popular interface that makes it possible to develop an application in Ruby, we ask specific questions about it. Here are four possible questions and challenges:
-
What is Rack?
-
Explain the Rack application interface.
-
Write a simple Rack application.
-
How does Rack middleware works?
-
What is ActiveJob? When should we use it?
-
What is Asset Pipeline?
-
Explain the difference between Page, Action, Fragment, Low-Level, SQL caching types.
-
What is a Rails engine?
-
Provide an example of RESTful routing and controller.
-
Describe CRUD verbs and actions.
-
How should you test routes?
-
How should you use filters in controllers?
-
What are Strong Parameters?
-
What do we need to test in controllers?
-
How should you use content_for and yield?
-
How should you use nested layouts?
-
Explain the Active Record pattern.
-
What is Object-Relational Mapping?
-
Describe Active Record conventions.
-
Explain the Migrations mechanism.
-
Describe types of associations in Active Record.
-
What is Scopes? How should you use it?
-
Explain the difference between optimistic and pessimistic locking.
-
Explain what is a sessions mechanism. How does it work?
-
Describe cross-site request forgery, cross-site scripting, session hijacking, and session fixation attacks.
-
What is the difference between SQL Injection and CSS Injection?
-
How should you store secure data such as a password?
-
Why do we need to use HTTPS instead of HTTP?
-
What is unit testing (in classical terms)?
-
What is the primary technique for writing a test?
-
What are your favorite tools for writing unit tests?
-
What are your favorite tools for writing feature tests?
-
What is a code smell?
-
What are your favorite tools to find code smells and potential bugs?
-
Why should you avoid fat controllers?
-
Why should you avoid fat models?
-
Explain ext
-
What is a code smell?
-
What are your favorite tools to find code smells and potential bugs?
-
Why should you avoid fat controllers?
-
Why should you avoid fat models?
-
Explain extract Value, Service, Form, View, Query, and Policy Objects techniques
网友评论