I was asked a pretty straight forward brain teaser during my last phone interview, which they said they don't normally do, but because I put that I was a logical problem solver on my resume they couldn't resist the opportunity to. It was the following "There are 20 different socks of two types in a drawer in a completely dark room. What is the minimum number of socks you should grab to ensure you have a matching pair?"
Software Developer C Net Developer Interview Questions
709,974 software developer c net developer interview questions shared by candidates
You have 17 red and 17 blue balls, and you remove 2 at a time. If the two are the same colour, add in one extra blue ball. If they are different colours, add in an extra red ball. What colour is the final ball removed?
1.Given a string, write a function that return if it is Palindrome. This wasn't asked directly but from interviewer example i was need to understand that this function must ignore all spaces and special symbols. 2. Given an array, write a function that return true if any 3 elements of this array can sum to 0. My first solution was the simplest and far from best which result in O(n^3). Then interviewer asked me to improve to improve it to O(n^2). This give me a hint that i can use Hash to reduce complexity.
Given an array of numbers, nums, return an array of numbers products, where products[i] is the product of all nums[j], j != i. Input : [1, 2, 3, 4, 5] Output: [(2*3*4*5), (1*3*4*5), (1*2*4*5), (1*2*3*5), (1*2*3*4)] = [120, 60, 40, 30, 24] You must do this in O(N) without using division.
To find and return the common node of two linked lists merged into a 'Y' shape.
Suppose we can translate numbers into characters: 1->a, 2->b, ...26->z given an integer, for example, 11223, output every translation of the number.
Add two binary numbers (Input as a string)
I got a few C++ questions, then a question on sorting algorithms then a brainteaser. The brainteaser went as follows: Three people are given hats. Each hat is either red or blue, chosen at random. Each person can see the other 2 hats, but not their own. They each must simultaneously either guess their own hat's color, or pass. No communication is allowed, although they can agree on a strategy ahead of time. What strategy will give them the best chances of at least one person guessing right, and nobody guessing wrong?
Develop an algorithm for finding the shortest distance between two words in a document. After the phone interview is over, take a few hours to develop a working example in C++ and send it to the manager.
Find the first index of the substring. Condition: Do not use java library function or regular expressions. And measure the performance of your implementation with the standard java library function. Examples: String 1: “abcdefg” String 2: “bcd” Should return 1 String 1: “abcdefg” String 2: “x” Should return -1
Viewing 81 - 90 interview questions