Skip to content

yez/random_problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solutions to problems using Ruby and RSpec

These problems are the result of research or past interviews and can be a helpful guide to anyone conducting an interview or being interviewed themselves.

I would suggest first reading the test files, downloading them individually and making all examples pass with RSpec.

FizzBuzz

Iterate through a range of numbers starting at 0 and ending at the inputed number n.

Print the number.

If the number is divisible my 3 print fizz instead. If the number is divisible by 5 print buzz instead. If the number is divisible by both 3 and 5, print fizzbuzz instead of the number.

Solution

Test

LinkedList

Implement a one directional linked list. A Node class and LinkedList should both be created.

Solution

Test

Reverse Polish Notation (RPN) Evaluator

RPN (otherwise known as postfix notation) is a way of writing simple arithmetic without the use of parenthesis.

Example: 1 + 2 translated to RPN is 1 2 +

Create a calculator that can accept a string in RPN, and compute the result.

Solution

Test

Array Sorting

Given two ordered arrays, create a method to combine them into a single ordered array. The use of sort, + and similar array operators is prohibited.

Solution

Test

Spell Checker

Given a misspelled word, compute and display a list of suggestions.

Solution

Test

Grid

Within an N x N grid, visit every node exactly one time.

Solution

Test

About

Random programming problems and solutions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages