Senior Ruby Developer interview questions and answers
This Senior Ruby Developer interview profile brings together a snapshot of what to look for in candidates with a balanced sample of suitable interview questions.
Senior Ruby Developer Interview Questions
In some respects even the most technical role demands qualities common to strong candidates for all positions: the willingness to learn; qualified skills; passion for the job.
Even college performance, while it helps you to assess formal education, doesn’t give a complete picture. This is not to underplay the importance of a solid background in computer science. Some things to look for:
• Understanding of basic algorithmic concepts
• Discuss basic algorithms, how would they find/think/sort
• Can they show a wider understanding of databases
• Do they have an approach to modelling?
Do they stay up to date with the latest developments? If so, how? Probe for their favourite technical books. Who are they following on Twitter, which blogs do they turn to?
Are they active on Github? Do they contribute to any open source software projects? Or take part in Hackathons. In short, how strong is their intellectual interest in their chosen field? How is this demonstrated? Ask for side projects (like game development). Committed, inquisitive candidates will stand out.
Computer Science questions
- Using pseudo-code, reverse a String iteratively and recursively
- What constitutes a good unit test and what a functional one?
- Describe the core principles of a REST API. How is this a different philosophy from RPC?
- When do you think is the best time in a project’s lifecycle, to set up its test infrastructure?
- What do you expect to find in a regression test suite and why?
- What constitutes a good unit test and what a functional one?
Role-specific questions
- Do arguments in Ruby get passed by reference or by value?
- What tools do you use for linting, debugging and profiling?
- Ruby MRI uses a Global Interpreter Lock. Does that mean it doesn’t use real threads?
- What do we mean when we say that a lambda or block forms a closure?
- What’s the following program going to print?
x = 1 class MyClass y = 2 def foo z = 4 y ||= 0 puts z + y end define_method :bar do |x| z = 5 y ||= 0 puts z + y + x end end my_class = MyClass.new my_class.foo my_class.bar(10) my_class.bar
- How is a block different from a Proc ?
- Is it possible to have a producer thread reading from the network and a consumer thread writing to a file, really work in parallel? What about the GIL?
- Ruby 2.1 introduced generational garbage collection. Describe how that works and why it’s considered an improvement.
- Write a single line of Ruby code that prints the Fibonacci sequence of any length as an array.
- Implement a class macro :benchmark that can be used to print the time an instance method takes to execute (advanced).
class Foo def bar ... end def qux ... end benchmark :bar, :qux end foo = Foo.new foo.bar # => bar took 0.12 ms foo.qux # => qux took 1.15 ms