Q: You are given two arrays of size m and n. Find the common elements between those arrays. Say, arr1 = {2, 5, 3} and arr2 = {5, 1, 2}. The common elements between those arrays are as follow: ans = {2, 5}
Software Engineers Interview Questions
419,648 software engineers interview questions shared by candidates
You have 2 jars and 50 black beads and 50 white beads. How many would you put of each color in each jar so that if a bead was randomly selected from both jars, you had the greatest chance they would match? You have to put all of the beads in the jars.
Write a function in Java that will take a sorted array of ints, possibly with duplicates, and compact the array removing all the duplicate numbers. That is, if the contains the numbers - 1, 3, 7, 7, 8, 9, 9, 9, 10, then when the function returns, the contents should be - 1, 3, 7, 8, 9, 10. Be sure your answer is as efficient as possible. Describe the efficiency of your algorithm using big O notation.
Given a BS tree, give the median number in the tree with O(1) space.
Some probability question 1) given a rand5() function which provide a random number between 1-5 at equal probability. Write a rand7() fuction to provide a random number between 1-7 with equal probability...
I have three water jugs, one with 10 liters another with 5 and another with 6, how do i get 8 liters on the first one?
How would you code up a custom rectangle detector?
Given a set of points (x,y) and an integer "n", return n number of points which are close to the origin
Given 2 numbers. Find if they are consecutive grey code sequences
Reverse an integer without using string operations.
Viewing 631 - 640 interview questions