面试题与答案
了解热门 Ruby On Rails 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
面试前建议观看的最佳 LIVE 模拟面试
了解热门 Ruby On Rails 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
面试题与答案
搜索问题以查看答案。
应届生 / 初级级别面试题与答案
Why Ruby on Rails?
2. DRY Principal (Do not repeat Your self )
3. Gems and Plugins
4. Pure OOP Concept
5. Scaffolding
6.. Rest Support
7.Action Mailer
8. Rake support
9. open source
10.Rpsec Suppot for testing
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Explain how (almost) everything is an object in Ruby.
This is a simple question based on complex concept. Here’s your chance to show off your theoretical knowledge and demonstrate that you can have an in depth conversation on class hierarchies, inheritance, methods, encapsulation, polymorphism, and more.
Explaining this could take an hour or a few minutes – there’s no single correct answer here, save from being able to demonstrate your familiarity with OOP concepts.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What’s your favorite testing tool?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What are Gems and which are some of your favorites?
Be sure to be able to discuss a list of your favorite gems, why you like them, and any customizations you like to add. This is also a good opportunity to highlight any gems you may have published.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
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 does a symbol differ from a string?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How and when would you declare a Global Variable?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How would you create getter and setter methods in Ruby?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Describe the difference between class and instance variables?
Class variables are created with the prefix ‘@@’ and are shared by all objects in a class.
Instance variables are created with the prefix ‘@’ and belong to a single object within a class.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Example some of the looping structures available in Ruby?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What is a lambda?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What are Class Variables? How to define them?
Class variables are created using the @@ prefix to denote the variable as class level.
It works just like any other variable, however in the case of inheritance it works more like a static variable that is accessed across all variable instances.
Another example can be found here:
class DemoClass @@my_var = nil def initialize @@my_var = "hello world" end def my_var puts @@my_var end end class Demo2Class < DemoClass def initialize @@my_var = "goodbye world" end end demo1 = DemoClass.new demo1.my_var demo2 = Demo2Class.new demo2.my_var demo1.my_var The output would be as shown below: hello world goodbye world goodbye world
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How to define Instance variables?
Instance variables are defined using single @ symbol.
@foo = "Hello"
Within a class they can be declared as below:
class Animal attr_accessor :name, :age end
Next you can query an object instance to find which instance variables it has.
anim = Animal.new anim.instance_variables => [ ] anim.name="John" anim.age = 3 => [:@age, :@name]
In the above case we did not put the @ symbol before the instance variables but it is implied.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What is the difference between ‘&&’, ‘AND’ and ‘&’ operators?
The ‘&&’ and ‘and’ are both logical and statements. They ‘&&’ operator has higher precedence though. Here’s an example of illustrate this in more detail:
foo = 3 bar = nil a = foo and bar # => nil a # => 3 a = foo && bar # => nil a # => nil
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Does Ruby support Multiple Inheritence?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How can you define a Constant in Ruby on Rails?
Create a new file as shown below under: config/initializers/my_constants.rb
COLORS = ['white', 'red', 'green']
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What is the default access modifier for a method?
By default all methods are public, except the initialize(constructor) method.
You can make methods private using this declaration within your class:
class MyClass
def method_public_here
end
PRIVATE# all methods that follow will be made private: not accessible for outside objects
def method_private_here
end
end保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Define the Rails MVC implementation with an example.
The MVC framework is an age-old architecture pattern that works very well for most applications. Rails has adopted the MVC pattern in its inherent design.
Stated Simply:
a) Model — is where the data is — the database
b) Controller — is where the logic is for the application
c) View — is where the data is used to display to the user
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。