## Recent Interview Questions

More Questions »- 0of 0 votes
Sort an unsorted array containing o's and 1's. For eg: [0,1,1,1,1,0,0,1]. Do it in-place as well as in O(n) time. While sorting you are not allowed to change the original ordering of same element.

- 0of 0 votes
Given a random function with equal probability of getting 1 or 0 ie 50% each. write a custom function which uses the above random function such that your function should return 1 with 75% probability and 0 with 25% probability

- 0of 0 votes
Given a list of numbers of odd length, design an algorithm to decide whether it's possible to remove any number from the list and split the remaining numbers into two sets of equal length with the same sum.

Example:

Input: [1, 1, 1, 1, 1]

Output: Yes

Input: [1, 2, 2]

Output: No

- 0of 0 votes
Given a string return the longest palindrome that can be constructed by removing or shuffling characters.

Example:

'aha' -> 'aha'

'ttaatta' -> ' ttaaatt'

'abc' -> 'a' or 'b' or 'c'

'gggaaa' -> 'gaaag' or 'aggga'

Note if there are multiple correct answers you only need to return 1 palindrome.

- 0of 0 votes
A matrix is "Toepliz" if each descending diagonal from left to right is constant. Given an M x N matrix write the method isToepliz to determine if a matrix is Toepliz.

Example:

Input:

67892

46789

14678

01467

Output:

True