Suppose you have a matrix of numbers. How can you easily compute the sum of any rectangle (i.e. a range [row_start, row_end, col_start, col_end]) of those numbers? How would you code this?
Software Engineer Entry Interview Questions
664,915 software engineer entry interview questions shared by candidates
Find Kth smallest element in a BST.
Generate a new array from an array of numbers. Start from the beginning. Put the number of some number first, and then that number. For example, from array 1, 1, 2, 3, 3, 1 You should get 2, 1, 1, 2, 2, 3, 1, 1 Write a program to solve this problem.
Write a function that takes 2 arguments: a binary tree and an integer n, it should return the n-th element in the inorder traversal of the binary tree.
Nothing unexpected, I solved all the problems but I think I was too slow on the first one, which goes like: Given an array of numbers, they are arranged so that the a[0] is in the 1st bucket, a[1]a[2] are in the 2nd bucket, a[3]a[4]a[5] is in the 3rd bucket and so on. The question is then: given a number, you need to return if it is in any bucket or not.
How many unique handshakes if each person in a group of 10 give handshakes out to each and every other individual. (a) 100 (b) 50 (c) 45 (d) 20 (e) 10
Given a string with parenthesis like "()()(()(()()", check to see if there are matching pairs. If there are matching pairs, return true, else return false. For example, ()()() returns true, ()()()) returns false.
Given a integer , return corresponding ASCII char representation without using language building in feature. ex. input interger 1234, return "1234" in string or characters
1. Given a 3 array like below NSArray *a = [1,3,4,5]; NSArray *b = [-1,3,0,9]; NSArray *c = [0,31,32,22,6]; Find the elements from the three array which existing in atleast 2 arrays. Eg: [3, 0] Because 3 is presented in array a, b and 0 is presented in array b, c respectively. -(NSArray)find2ElementsAtleastPresentIn2Arrays:(NSArray*)aList b::(NSArray*)bList c::(NSArray*)cList{ // -- your code here. }
Given a sorted array, where each element but one occurs only once, return the element that repeats. (For example, given 1, 2, 3, 3, 4, return 3. Given 1, 2, 3, 4, 6, 6, 7, 8, 9, return 6.)
Viewing 331 - 340 interview questions