Ruby Software Engineer Interview Questions | Glassdoor

Ruby Software Engineer Interview Questions


Ruby software engineer interview questions shared by candidates

Top Interview Questions

Sort: Relevance Popular Date

Describe a routine which returns the set of integers in {1..100} divisible without remainder by 3 but not by 9.

12 Answers

I'm assuming the question wants us to find integers that are divisible by 3 but not by 9. This can be easily obtained using a mod function inside the following if statement: if(number % 3 == 0 && number % 9 != 0) Here is a short program I wrote in c++ to show how to solve this problem. Instead of returning the set of integer, I just printed them out on the screen: #include #include using namespace std; int main(int argc, char** argv) { int i = 0; vector list; vector::iterator it; for(i = 1; i <= 100; i++) { if(i%3 == 0 && i%9 != 0) { list.push_back(i); } } for(it = list.begin(); it != list.end(); it++) { cout << *it << endl; } return 0; } If I missed anything, please let me know. Happy coding and problem solving!

That'll certainly work, Tyler, but the OP indicated he was interviewing for a Ruby On Rails - not C++ - gig.

put those integers into an array, pick every third element, out of which discard every third element.

This was a pair programming session with a Ruby engineer. They allow you to use your own laptop which was great but you only get 30 minutes to finish the problem with working unit tests. I think they re-use this pair programming problem so I'm not going to divulge details here. But it wasn't a particularly hard problem, they just want you to see how you code and test. Do not forget to write unit tests! Ideally you would develop it in a TDD fashion.

2 Answers

Phone interview: Explain how "find_xxx" active record method works. Onsite interview: How to refactoring code (actually production code)

1 Answer

What do you read daily to keep up with Rails community?

They asked me to tell them about a set of code I had written that I was proud of. After that they asked me to describe the architecture of some code I designed and then how I would design it differently if I were to do it again and why.

Ruby and API assignment for parsing json request for included resources

1 Answer

When is it OK to release code that is not clean?

1 Answer

Past Projects, Use of data structures, practical problems in life of SW engineer, SQL related question

19 of 9 Interview Questions