March


Not CompletedMarch 21 - Refactoring an Iterative XML Parser to Use Functional Programming in Ruby

In the last guide I implemented an XML parser that counted all of the lines from Shakespeare's Macbeth play. That implementation worked, however it used an iterative approach, which resulted in a highly coupled method that would only be able to work on another XML file if it had an identical structure and set of tag names. In this guide we're going to refactor the solution to utilize a functional approach.

Not CompletedMarch 22 - Demonstrate Ruby Procs / Lambdas vs Methods for Variable Scope

There are some key differences between procs / lambdas and traditional methods in Ruby, however the differences can many times be subtle. In this exercise we'll examine how variable scope is processed differently between the different options.

Not CompletedMarch 23 - Pass Multiple Blocks to a Method by Leveraging Lambdas in Ruby

In many cases, lambdas are the most effective when they're used in conjunction with methods. A method is limited to taking a single block in Ruby, however by leveraging lambdas you are able to pass in as many blocks as needed.

Not CompletedMarch 24 - Build a Prefix Notation Calculator in Ruby

Building a calculator is a popular interview question and a good approach for learning a programming language. In this guide we're going to build a Prefix Notation calculator in Ruby, which enables users to enter an operator, followed by any set of numbers to calculate.

Not CompletedMarch 25 - Build a Dice Validator in Ruby

Building validations in programs is a common requirement. In this exercise we'll examine how to ensure a set of dice are valid by implementing a method that returns false if the dice are outside the range of 1-6.

Not CompletedMarch 26 - Build Rock, Paper, Scissors in Ruby with Player vs Computer Gameplay

Rock, paper, scissors may seem like a simple game to build, however it offers a great base case for how to build a rule's engine that can be scaled up for more complex systems. In this guide we'll examine how to build the game so that users can play against the computer.

Not CompletedMarch 27 - Finding All Duplicates in an Array in Ruby

Ruby has a helpful method for removing duplicates from an array, the uniq method. However, there are times when you simply want to know which elements in an array are duplicates. In this guide we'll add a method to the Array class that returns all duplicates. Additionally, I'll examine two approaches to the solution and discuss the benefits of each option.

Not CompletedMarch 28 - Implementing Caching into the Rock, Paper, Scissors Game

After reviewing the Rock, Paper, Scissors game code, I realized that there was a bug with the computer guessing mechanism. In this guide we're going to walk through how to implement caching in order to correct the issue.

Not CompletedMarch 29 - How to Sort URLs from Markdown into Nested Hashes with Regular Expressions

When it comes to parsing files that contain URLs, a common practice is to have the ability to group URLs by type. In this guide we walk through how to categorize links based on regular expressions.

Not CompletedMarch 30 - Find All Triplets with Zero Sum in Ruby

This is first in the series of Google coding interview questions. In order to pass this exercise, you will need to know how to find all of the potential combinations for an array, along with selecting the values that match a calculated sum.

Not CompletedMarch 31 - Generate All Binary Strings from Given Pattern in Ruby

This guide walks through how to generate all binary strings that can be formed by replacing each wildcard character with a either a '0' or '1'.

Unsupported Browser

devCamp does not support ancient browsers.
Install a modern version for best experience.