Ruby Programming Interview Questions

Jesse Wright
3 min readMar 12, 2021

Simple questions on language and idioms.

Photo by Sebastian Herrmann on Unsplash

When you interview someone for a Ruby programming job what should you ask about their Ruby knowledge. These are simple questions that should only take a minute or two that will give you a good idea if they have worked with the language. And if they know the common idioms of Ruby.

If they don’t know Ruby, then hand it out for them to investigate. This will get them started on writing code for your institution.

The answers are at the end of this article.

  1. If there is a name that is all upper case and snake case what is it?
  2. If there is a name that begins with an uppercase letter and is camel-case what is it?
  3. If there is a name that is all lower case and snake-case what is it?
  4. If a method starts with lower case and is camel case what does that mean?
  5. If the method ends with a ‘?’ what does that imply?
  6. If the method ends with a ‘!’ what does that imply?
  7. What does Object dup method do? Why is it important?
  8. What does Array map do?
  9. What does Array select do?
  10. How do you check that a Hash has a key?
  11. How do you load a YAML file?
  12. How do you load a JSON file?
  13. What are the parameters for String split?
  14. How do you iterate over a Hash?
  15. When do you the do/end verses {}?
  16. You find a method with 9 or more positional parameters? What do you do to improve it?
  17. What does DRY mean?
  18. What does .nil? check?
  19. How would you remove nil values from an Array?
  20. Discuss why now people make class hierarchies shallow and wide rather than deep.
  21. How do you call a method in another module?
  22. A http status code for a call can be either 200 or 201, how do you code to check for either?
  23. What is an alias?
  24. What is technical debt?
  25. What is the difference between foo

--

--

Jesse Wright

Learning to be a writer. Ex-Grey beard programmer, now retired. Extensive wide ranging reader. Proud Democrat and Liberal and Atheist. Bipolar but Medicated.