Warning: Work in Progress...
This is a discussion on Interview Question's at Microsoft within the General Knowledge forums, part of Education & Career category; Classic: If a bear walks one mile south, turns left and walks one mile to the east and then turns left again and walks one mile north and arrives at ...

Advertisement
Want to advertise? Learn how to remove ads

Notices

Tags : microsoft, questions, interview
Thread Tools   Switch to Linear ModeSwitch to Hybrid ModeSwitch to Threaded Mode
TiNNi's Avatar
TiNNi
Senior Member
Posts/Threads: 150/9
Credits/Banked: 9,977/0.00
Thanks: 37
Thanked 28 Times in 26 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Rep Power/Points: 48/1401
TiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this point
Default Interview Question's at Microsoft, Posted June 18th, 2006, 01:17 PM #1 (permalink) |
Classic: If a bear walks one mile south, turns left and walks one mile to the east and then turns left again and walks one mile north and arrives at its original position, what is the color of the bear.

1. Given a rectangular (cuboidal for the puritans) cake with a rectangular piece removed (any size or orientation), how would you cut the remainder of the cake into two equal halves with one straight cut of a knife?


2. There are 3 baskets. one of them have apples, one has oranges only and the other has mixture of apples and oranges. The labels on their baskets always lie. (i.e. if the label says oranges, you are sure that it doesn't have oranges only,it could be a mixture) The task is to pick one basket and pick only one fruit from it and then correctly label all the three baskets.

3. You have 8 balls. One of them is defective and weighs less than others. You have a balance to measure balls against each other. In 2 weighings how do you find the defective one?

4. Why is a manhole cover round?

5. How many cars are there in the USA?

6. You've got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?

7. One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they collide, how far will the bird have traveled?

HINT. Think relative speed of the trains.

8. You have two jars, 50 red marbles and 50 blue marbles. A jar will be picked at random, and then a marble will be picked from the jar. Placing all of the marbles in the jars, how can you maximize the chances of a red marble being picked? What are the exact odds of getting a red marble using your scheme?

9. Imagine you are standing in front of a mirror, facing it. Raise your left hand. Raise your right hand. Look at your reflection. When you raise your left hand your reflection raises what appears to be his right hand. But when you tilt your head up, your reflection does too, and does not appear to tilt his/her head down. Why is it that the mirror appears to reverse left and right, but not up and down?

10. You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

11. If you had an infinite supply of water and a 5 quart and 3 quart pail, how would you measure exactly 4 quarts?

12. You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?

13. Which way should the key turn in a car door to unlock it?

14. If you could remove any of the 50 states, which state would it be and why?

15. There are four dogs/ants/people at four corners of a square of unit distance. At the same instant all of them start running with unit speed towards the person on their clockwise direction and will always run towards that target. How long does it take for them to meet and where?

16. (from Tara Hovel) A helicopter drops two trains, each on a parachute, onto a straight infinite railway line. There is an undefined distance between the two trains. Each faces the same direction, and upon landing, the parachute attached to each train falls to the ground next to the train and detaches. Each train has a microchip that controls its motion. The chips are identical. There is no way for the trains to know where they are. You need to write the code in the chip to make the trains bump into each other. Each line of code takes a single clock cycle to execute.
You can use the following commands (and only these);
MF - moves the train forward
MB - moves the train backward
IF (P) - conditional that's satisfied if the train is next to a parachute. There is no "then" to this IF statement.

Algorithms and Programming

1. Given a rectangular (cuboidal for the puritans) cake with a rectangular piece removed (any size or orientation), how would you cut the remainder of the cake into two equal halves with one straight cut of a knife ?

2. You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.

3. Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].

4. Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all. [ This one had me stuck for quite some time and I first gave a solution that did have floating point computations ].

5. Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

6. Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

7. Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

8. How many points are there on the globe where by walking one mile south, one mile east and one mile north you reach the place where you started.

9. Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.

10. What are the different ways to implement a condition where the value of x can be either a 0 or a 1. Apparently the if then else solution has a jump when written out in assembly. if (x == 0) y=a else y=b There is a logical, arithmetic and a data structure solution to the above problem.

11. Reverse a linked list.

12. Insert in a sorted list

13. In a X's and 0's game (i.e. TIC TAC TOE) if you write a program for this give a fast way to generate the moves by the computer. I mean this should be the fastest way possible.

14. I was given two lines of assembly code which found the absolute value of a number stored in two's complement form. I had to recognize what the code was doing. Pretty simple if you know some assembly and some fundaes on number representation.

15. Give a fast way to multiply a number by 7.

16. How would go about finding out where to find a book in a library. (You don't know how exactly the books are organized beforehand).

17. Linked list manipulation.

18. Tradeoff between time spent in testing a product and getting into the market first.

19. What to test for given that there isn't enough time to test everything you want to.

20. First some definitions for this problem: a) An ASCII character is one byte long and the most significant bit in the byte is always '0'. b) A Kanji character is two bytes long. The only characteristic of a Kanji character is that in its first byte the most significant bit is '1'.

Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).

21. Delete an element from a doubly linked list.

22. Write a function to find the depth of a binary tree.

23. Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

24. Assuming that locks are the only reason due to which deadlocks can occur in a system. What would be a foolproof method of avoiding deadlocks in the system.

25. Write a routine that prints out a 2-D array in spiral order!
And Then God Created The Beauty, Mother Of All Human, Eve
| Reply With Quote
Bubla's Avatar
Bubla
Moderator
Posts/Threads: 1,327/156
Credits/Banked: 594,735/0.00
Thanks: 364
Thanked 618 Times in 413 Posts
Blog Entries: 8
Nominated 2 Times in 2 Posts
TOTW/F/M Award(s): 0
Rep Power/Points: 323/26131
Bubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond reputeBubla has a reputation beyond repute
Default Posted June 18th, 2006, 04:19 PM #2 (permalink) |
I will never go 4 a microsoft interview.....
~*~*~I Love Walking In The Rain Because Nobody Can See Me Crying!~*~*~
| Reply With Quote
TiNNi's Avatar
TiNNi
Senior Member
Posts/Threads: 150/9
Credits/Banked: 9,977/0.00
Thanks: 37
Thanked 28 Times in 26 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Rep Power/Points: 48/1401
TiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this pointTiNNi is an unknown quantity at this point
Default Posted June 19th, 2006, 02:09 PM #3 (permalink) |
Lol bubla, neither me. but still I'll like to solve this problem ( havnt done anyone yet ).
And Then God Created The Beauty, Mother Of All Human, Eve
| Reply With Quote
Reply  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Display Modes
Linear Mode Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Advertisement
Want to advertise? Learn how to remove ads


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Office 2007 Eros Reviews 19 May 2nd, 2008 06:29 AM
Interview Tricks Bubla Education & Career 4 February 17th, 2006 03:20 PM
Microsoft Live JUBAiR Internet, Web, Network & Security 1 February 16th, 2006 03:12 AM
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright ©2005 - 2008, doshomik.net
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
All times are GMT +7. The time now is 08:57 AM.