Browsing the archives for the interview tag

10 Famous Microsoft Interview Puzzles

Here is a list of 10 famous puzzles which have been asked on a Microsoft Interview. They are not in any specific order. Clock Hands How many times a day do the minute and hour hands of a clock overlap? Answer Is Your Husband a Cheat? A certain town comprises of 100 married couples. Everyone in […]

Trains and Birds

Question: A train leaves City X for City Y at 15 mph. At the very same time, a train leaves City Y for City X at 20 mph on the same track. At the same moment, a bird leaves the City X train station and flies towards the City Y train station at 25 mph. […]

5 Comments

Clock Hands

Question: How many times a day do the minute and hour hands of a clock overlap? Answer: Did you think the answer was 24 times? Well if you did, it’s time you think again. Let’s do some math. In T hours, the minute hand completes T laps. In the same amount of time, the hour hand […]

21 Comments

10 Google Interview Puzzles

Here is a list of 10 puzzles which have been asked on a Google Interview. They are not in any specific order. Reverse a Linked-List Reverse a Linked-list. Write code in C. Answer Challenge – Equal Probability between 1 and 7 Write a method to generate a random number between 1 and 7, given a […]

My Tech Interviews

Hello everyone, Welcome to My Tech Interviews. A blog which helps people prepare for a software technical interview. My Tech Interviews This blog is dedicated to helping people prepare for a technical interview, mainly for a software interview. It contains various types of questions like puzzles and programming tasks. These questions are not posted for […]

Tunnel Trouble

Question: A man needs to go through a train tunnel to reach the other side. He starts running through the tunnel in an effort to reach his destination as soon as possible. When he is 1/4th of the way through the tunnel, he hears the train whistle behind him. Assuming the tunnel is not big […]

Number of Ones

Question: Write a function that determines the number of bits set to 1 in the binary representation of an integer. Answer: Going by the brute force approach, it would be easy to come up with the following solution. If the least significant bit of a number is 1, it will return a result of 1 […]

Three Switches

Question: You are standing outside a room next to three switches, all of which are off. Each switch operates a different light bulb in the room. The room door is closed, so you cannot see which switch operates which bulb. You are only allowed to go into the room once. Determine which switch operates which […]

0 Comments

C Keywords – Review

Static Static keyword can be used for both variables and functions. By default, functions and global variables defined in a file are available for use in other files. However, if the static keyword is used, they are restricted to the current file only. They will not be available in other files even if the extern […]

Singly Linked List – Delete Node

Question: You are given a pointer to a node (not the tail node) in a singly linked list. Delete that node from the linked list. Write code in C. Answer: To delete a node, you have to redirect the next pointer of the previous node to point to the next node instead of the current one. Since […]