Discuss an algorithm to traverse a tree, depth first.
Ruby Programming Interview Questions
Implement a function with signature find_chars(string1, string2) that takes two strings and returns a string that contains only the characters found in string1 and string two in the order that they are found in string1. Implement a version of order N*N and one of order N.
Given a circular list of integers (when you reach the end of the list you come back to the beginning), what is the most efficient algorithm to find the smallest integer in the list?
For example: circular_list = [22, 52, 66, 82, 5, 8, 12, 19].
Write a function that takes an integer and returns the smallest number that is greater than the given number which is a palendrome.
For example, if the input was 111 the next palindromic number would be 121.
Write a function, tokenize_string(input_string, delimiter_list) that returns a list of strings that are separated by the delimiters.
For example: tokenize_string("How now, Mrs. Brown Cow") returns ['How', 'now', 'Mrs', 'Brown', 'Cow']
Write a function that takes an unsorted integer array, and returns a three element subset whose sum is zero.
Note: This is a special case of the SUBSET-SUM problem. That problem is NP-complete, but we're only looking for subsets of 3 elements. This can be achieved in polynomial time.
The least common multiple of a set of integers is the smallest positive integer that is a multiple of all of the integers in the set.
Write a function that takes an array of integers and efficiently calculates and returns the LCM.
Write a function that takes as input a binary tree, and prints out each level of the tree on a newline. For example:
a
/ \
b c
/ / \
d e f
will output:
a
b c
d e f
Write a function that takes a an array of integers, and returns the contiguous subsequence of integers with the largest sum.
Model the animal kingdom as a set of classes. Discuss the species, their behavior and properties.
Explain the principles of test drive development.