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
.
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.
Implement a one directional linked list. A Node
class and LinkedList
should both be created.
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.
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.
Given a misspelled word, compute and display a list of suggestions.
Within an N x N grid, visit every node exactly one time.