Given array of stick lengths, return number of turns it takes to have no sticks left. Each turn you remove sticks of smallest length and cut that length from the rest of the sticks.
Software Engineers Interview Questions
429,728 software engineers interview questions shared by candidates
If you have a ransom letter and magazines, can you construct the ransom letter from the words in the magazine.
Use singly linked list to implement the cache (LRU) algorithm. How would you do?
Find the length of the longest chain of consecutive integers in an unsorted set in linear time.
given an arrya of numbers see if you can get to index with 0 in it from an index by jumping through the array using the values in the array. So if you have [1,2,1,0,3] you can get to 0, from 0 by jumping 0, you can get to 0 from 3, by jumping 3 index down to 2 and then jumping 2 index up to 0...
Find the median of unsorted array in O(nlog n ) time. You need to know that particular mathematical algorithm, anything slower your answer is rejected.
Given a binary tree, which is not necessarily balanced, print the nodes in the tree in a level-wise manner. Also, nodes on the same level should be printed on a single line. A modification of the question was added later in which I cannot really add a "level" variable in the structure of the node in the tree.
Got asked two questions: 1 - Return the length of the longest sequence of increasing numbers in an unsorted array 2 - Print out a Binary Tree level by level
Implement a method called printNonComments() which prints out a extract of text with comments removed. For example, the input: hello /* this is a multi line comment */ all Should produce: hello all You have access to a method called getNextLine() which returns the next line in the input string.
1. Tell me about yourself 2. Given each abc letter has a value (a=1, b=2, ... , z=26), compute the number of ways one can decode a given integer. e.g. 23 --> 2 [ 2, 3 ; 23 ], 456 --> 1 [ 4, 5, 6 ], 123 --> 3 [ 1, 2, 3 ; 1, 23 ; 12, 3 ]
Viewing 721 - 730 interview questions