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?
Engineer Developer Interview Questions
466,953 engineer developer 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.
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.)
Given an large list of unsorted numbers, find the smallest number. You can access the list only 3 numbers at a time, and keep moving forward 1 number at a time.
Given a integer , return corresponding ASCII char representation without using language building in feature. ex. input interger 1234, return "1234" in string or characters
implement a O(1) min function for Stack
How would you implement a stack with the additional operation of getMin?
Given a stream of integers of unknown (possibly large) length, how would you pick one at random? Now prove its random.
Viewing 281 - 290 interview questions