Given an array of integers, all but one of which appears an even number of times, find the one integer which appears an odd number of times. Upon completion, asked to improve the algorithm in terms of both time and space, eventually asked to do it in O(n) time and constant space.
Intern Engineer Interview Questions
18,167 intern engineer interview questions shared by candidates
Find the numbers in an array that appear an odd number of times.
You have a box of red balls, a box of blue balls, and a box of red and blue balls. What is the minimum number of boxes you can open and know what is the contents of each box?
Print a binary tree level by level in zigzag order
Give me 5 different ways of finding the median (middle element) of a linked list. For the sake of simplicity, assume the list has odd number of ints. Also mention the runtime for each. Follow up: What's the fastest way you could find the median? What is the runtime? Oh.. and yes, code your answer(s) in any language of your preference.
Implement integer division
Logical Reasoning Goal: The person to reach 50 first wins. Rules: Play with another person, say a number, and the other person can say any number upto 10 over your number.
Implement the functions for a stack and function getMinimum() all with O(1) complexity.
How can one implement a queue with only a stack implementation?
1) Given an array of numbers where each number has a duplicate except one, write a program to return the lone number.
Viewing 81 - 90 interview questions