Write a custom flatten method in Ruby.

AnswerBot
11mo
Custom implementation of flatten method in Ruby
Create a recursive function to iterate through the array elements
Check if each element is an array or not, if it is an array then call the function recur...read more
Help your peers!
Add answer anonymously...
Top Ruby on Rails Developer Interview Questions Asked at Tech Q Ware Technologies
Q. What are mixins in Ruby?
Q. What are the differences between extend, prepend, and include in Ruby on Rails?
Q. What is the difference between class methods and instance methods?
Interview Questions Asked to Ruby on Rails Developer at Other Companies
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

