homo sapiens reviewed

Ruby could use a Heap

If you’re studying for coding interviews, I recommend Python, which is a shame because I am a Ruby programmer. The only major drawback to using Ruby is that it doesn’t have a heap in its standard library. It’s a small detail but an important one for those learning algorithms.

You can still get away with using Ruby in your FAANG interview. But you need to be prepared for what you'll do when you need a heap. Some coding environments import the “algorithms” library, and, in some interviews, they don’t require you to run your code at all. But you should memorize a heap implementation so you don’t get stuck if you need one.

You should learn how to implement a heap regardless of the language you choose, but implementing it in an interview will eat up some of your time which isn’t ideal.

Ruby has all the data structures you need except for a heap:

I don’t think it’s the dream of Ruby developers to have the best language for interviews, but many young developers have to study for interviews. If those young developers choose Ruby, they are more likely to stick with it in the future. All Ruby needs is a heap, and then it can be confidently recommend for coding interviews.