algorithms 0,0,1,0,2,0,8,1

algorithms playground for common questions

Algorithms

Algorithms playground for common questions solved in ruby syntax.
In case you want to prepare yourself for a job interview - try to solve it yourself first, then have a look here.

Why?

I interviewed with Google, Facebook, LinkedIn, Twitter and others. I also interviewed others myself. Sometimes it looks like they all ask you the same "out of the box" questions that don't really check knowledge but memorization of the same tricks. This is my way of saying - change your interview style. There are lots of smart people out there, this is not the best way to find them.

Problems

problem solution
Symmetric Tree click
Dijkstra's shortest path between two nodes click
Kruskal's minimum spanning tree algorithm click
Find the square root of a number click
Binary search click
Longest increasing subsequence click
Find all permutations of array click
Finding all combinations of well-formed brackets click
Finding the powerset of a set click
Game of life click
Print all combinations of set joining click
count and say click
Telephone number to words click
Maximum contiguous subarray click
Find the smallest biggest number that has the same digits click
Find the minimum insertions needed to make a word palindrome click
String matching - Knuth Morris Pratt algorithm KMP click
Balanced Parentheses click
Quicksort algorithm click
Mergesort algorithm click
Max Stocks Profit click
Countingsort algorithm click
Shellsort algorithm click
Knapsack problem click, click
Longest common subsequence problem click , click
Monty Hall Problem click
Eucliden and Extended Eucliden algorithm click
Suggest index of a number in an array click
Range minimum query sparse table algorithm click
Insertion Sort click

How?

Simply run ruby some_file.rb to execute the algorithm. At the bottom of each file there are some test samples.
example: ruby brackets_combinations.rb will print:
["((()))", "(()())", "(())()", "()(())", "()()()"].

Contribute

Did you find a bug? any way to do it better? please feel free to pull-request it :)

Related Repositories

awesome-algorithms

awesome-algorithms

A curated list of awesome places to learn and/or practice algorithms. ...

java-algorithms-implementation

java-algorithms-implementation

Algorithms and Data Structures implemented in Java ...

C-Sharp-Algorithms

C-Sharp-Algorithms

Implementations of Data Structures and Algorithms in C# ...

Algorithms-and-Data-Structures-in-Ruby

Algorithms-and-Data-Structures-in-Ruby

Ruby implementation of Algorithms,Data-structures and programming challenges ...

awesome-algorithms

awesome-algorithms

A curated list of awesome places to learn and/or practice algorithms. ...


Top Contributors

sagivo delta4d easher lexruee kevivmatrix jumanjiman rauljordan frontsideair st0le Mulix naimrajib07 nateberkopec nicolasleger yordis