Given a non-empty array of integers, return true if there is an index on which to split the array so that the sum of the numbers on one side is equal to the sum of the numbers on the other side.
I recently participated in a small-team hackathon using Ruby on Rails. After the first day of building, the teams met to discuss some of the pain points we had experienced. One point that came up multiple times was shifting association names. The problem was that team members were implementing associations with…
The task at hand: shuffle an array without using any library methods to shuffle for us. We need an algorithm to change the order of our array in a way that any permutation is equally likely. So, how do we implement an efficient shuffling algorithm?
Whether you’re practicing for technical interviews, interested in improving your Ruby foo, or just want to solve a few puzzles, you should take on the challenge of implementing algorithms to pass the set of RSpec tests I published here.
If you’ve been studying web development, you may have worked with a params hash, a session cookie, or routing based on HTTP request methods. If you’ve ever thought “I’d really like to know how this works, but I’ll look into it later,” now is the time for you to follow up.