Preparing for a Ruby Technical Interview
There’s a handful of resources that I like using to prepare for coding interviews. In this post, I’ll share my thoughts behind my favorite websites and tools and how I use them.
Best All-Around Resource: Codewars (Price: Free)

I stumbled onto Codewars a few years ago while searching for a source of Ruby practice problems and I haven’t looked back. The site features crowdsourced programming exercises that range from relatively simple to insanely challenging. Exercises can be completed in several languages, including Ruby, Python, Java, Javascript, and more. Codewars has done a fantastic job gamifying programming through their “honor points” leaderboard. Best of all, it’s completely free!
Best Ruby Fundamentals Resource: Exercism.io (Price: Free)

If you’re looking for a review of the Ruby basics, the best resource I’ve found is Exercism.io. Exercism has exercises available for a ton of languages and comes with prebuilt test suites so you can practice the red/green/refactor cycle. The site is especially helpful if you want to get the hang of object oriented programming or test driven development. Exercism comes with a slick command-line tool that both downloads exercises and submits your code to the site for peer feedback. I’ve also found the community to be quite generous in offering constructive criticism.
Best Coding Challenges Resource — Project Euler

Project Euler is another great, free resource for brainteaser problems. Most of the problems are math-oriented, specifically around number theory and combinatorics, and I’ve actually come across a few of these in real interviews. While many of the problems can be solved in a few lines of code, there are a few questions that are quite challenging, especially if you delve into optimization. After solving a Project Euler question (or if you’re stuck), one thing that you might find helpful is searching for other elegant solutions on Github. This will make sure that you’re not missing any major tricks and help you recognize coding patterns.
Practicing for Interviews
Practicing for interviews does NOT simply mean you should solve 100 Project Euler questions. The quality of the code and the process you use matters a lot! If you want to maximize the efficiency of your practice sessions, you need to simulate real interviewing conditions as closely as possible. What does this mean?
- Put yourself under time pressure. You typically won’t have 3 hours to solve a problem in a live interview
- Make sure you’re speaking out loud. Long periods of dead silence during a real interview is typically a bad sign! Interviewers want to understand your thought process, so you need to constantly explain what you are trying to achieve. Get a tape recorder or grab a friend and make sure your explanations make sense.
- Keep your code clean. It’s tempting to use single letter variables and global Ruby methods to save on time (especially when you’re just practicing), but you sacrifice cleanliness in doing so!
Things to Remember
Here are some questions that I ask myself after I while I’m solving a problem.
- Can I extract this into a class?
- Am I explaining myself clearly?
- What is the smallest or easiest part of the solution that I can write and test?
- Can I quickly refactor anything I’ve already written?
Here are some questions that I ask myself after I finish solving a problem:
- Can this problem be refactored? Are there any code smells (e.g., method lengths, confusing variables names, global methods, magic numbers, etc.?
- What is the run time complexity of my solution?
- Is my code optimized for memory? For time? For both?
- Is it possible to solve this problem using pure mathematics?
Conclusion
Coding interviews are always nerve-wracking, but as you practice more, your ability to stay calm under pressure should increase significantly. If you think there’s a coding resource that I haven’t heard about, let me know in the comments below! Best of luck!