* Describe the design of a most-recently-used list, such as the "Recent Files" menu in Microsoft Word. It has two public methods, getlist() and access(str), which retrieve the list and mark an item as accessed, respectively. The list has a maximum number of items it can hold, say 5, and it should not have duplicates. Describe the data structure used and the running time of both public methods.
Software Engineer Intern Interview Questions
664,899 software engineer intern interview questions shared by candidates
Write a program the generates the power set of a set of numbers
The accent of the interviewer was very hard to understand. Given an array with N - 2 elements (two missing) from 1 to N, find the two missing elements in linear time and constant memory usage.
Merge Linked list
Given an input vector X, first determine the sum of 2^(of each element), then give the shortest vector Y's length which elements' sum equals the input vector. Require some binary-related logic.
Write a function Brackets(int n) that prints all combinations of well-formed brackets. For Brackets(3) the output would be ((())) (()()) (())() ()(()) ()()()
Write a function to get maximum consecutive sum of integers from an array.
You are given an n by n array filled with '0's, and you have to set randomly X number of '1's in that array. Looping and generating x random number doesn't work as you might get the same random number (especially as X gets closer to n*n, collisions will become more likely in which case you'll loop for a very long time before filling all the '1's). All positions must have the same probability to get selected, and the array might be huge.
Find the minimum depth of binary search tree
Find the min and max in an array. Now do it in less than 2n comparisons. (they were looking for the solution that finds both max and min in about 3/2 n comparisons).
Viewing 121 - 130 interview questions