Given an array a contains all digits 0-9 a = [1, 4, 2, 1] # which represents 1421 Add one to the number and return the array return a = [1, 4, 2, 2] # which represents 1422
Software Engineer Interview Questions
466,538 software engineer interview questions shared by candidates
Write a function to multiply two arbitrarily large integers.
Tell me about yourself?
Given a string, remove all chars from the string that are present in say another string called filter.
Given an integer, if the number is prime, return 1. Otherwise return its smallest divisor greater than 1. e.g. if n = 24, its divisors are [1, 2, 3, 4, 6, 8, 12, 24]. The smallest divisor greater than 1 is 2.
List of n number with k numbers missing. How do you identify the missing numbers? What is the run time?
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}
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.
Viewing 601 - 610 interview questions