Showing posts with label placement questions. Show all posts
Showing posts with label placement questions. Show all posts
Three people check into a hotel. They pay £30 to the manager and go to their room. The manager suddenly remembers that the room rate is £25 and gives £5 to the bellboy to return to the people. On the way to the room the bellboy reasons that £5 would be difficult to share among three people so he pockets £2 and gives £1 to each person. Now each person paid £10 and got back £1. So they paid £9 each, totaling £27. The bellboy has £2, totaling £29. Where is the missing £1?


Ans:

We have to be careful what we are adding together. Originally, they paid £30, they each received back £1, thus they now have only paid £27. Of this £27, £25 went to the manager for the room and £2 went to the bellboy.

Try it for three weightings

You have 12 coins, one of which is fake. The fake coin is indistinguishable from the rest except that it is either heavier or lighter, but you don't know which. Can you determine which is the fake coin and whether it is lighter or heavier using a balance scale and only 3 weightings?



Ans:

One solution is to label the coins with the letters FAKE MIND CLOT and weigh the coins in the following three combination:

MA DO -- LIKE
ME TO -- FIND
FAKE -- COIN

Logic will now allow you to find the fake coin based on the three results. For instance, if the results were left down, balanced, left down, we could work out which coin is fake in the following way:

From the middle weighing we know that the coins METOFIND are all normal. So one of the coins ACKL is fake. Therefore looking at these coins one at a time in the other two weighings, we can see that:

A - appears on the left twice and could be fake.
C - appears only once, therefore can't be fake (otherwise the first weighing would be balanced).
K - appears on opposite sides, so it can't make the left side go down both times.
L - appears only once, therefore can't be fake (otherwise the third weighing would be balanced).

Therefore the only possibility is A, which must be heavier. Any other combination of ups and downs will allow you to use the same logic to find the fake coin.

Matthew Shelborn frequently has to travel for his company, which gives him a chance to meet many people from all parts of the USA. In April, Matthew flew to five different US cities on business and he flew a different airline each time. During each trip he chatted with the person next to him, and no two people he talked to were in the same profession.

From the information, can you determine the date Matthew made each flight (each was on a Monday exactly one week apart starting on April 2nd), the airline he flew, his destination, and the profession of the person who sat next to him on each flight?

1. Three consecutive flights were, in order from first to last, the flight Matthew took with WTA Airways, the flight where he sat next to the teacher, and the flight he took to Atlanta.

2. Matthew sat beside the sports coach on a flight some time earlier in the month than the one he took to Seattle.

3. The week he flew Air Express was some time earlier in the month than the trip to Boston, which was some time earlier in the month than the trip where he sat next to the ballet dancer.

4. It wasn't on the trip to San Diego where Matthew sat next to the doctor.

5. Matthew didn't fly Skyways on his trip to Seattle, and he didn't fly WTA Airways on the trip where he sat next to the sports coach.

6. Atlanta was not Matthew's destination on the trip where he made the acquaintance of the ballet dancer.

7. The Fly America flight was exactly two weeks before the flight where Matthew passed the time chatting with the attorney.

Dates: April 2nd, April 9th, April 16th, April 23rd, April 30th
Airline: Air Express, Fly America, MidUSA Air, Skyways, WTA Airways
Destination: Atlanta, Boston, Chicago, San Diego, Seattle
Seat Mate: Attorney, Ballet Dancer, Doctor, Sports Coach, Teacher



Ans:

Date Airline Destination Seat Mate
April 2nd WTA Airways Chicago Doctor
April 9th Fly America San Diego Teacher
April 16th Air Express Atlanta Sports Coach
April 23rd Skyways Boston Attorney
April 30th MidUSA Air Seattle Ballet Dancer
The trip to Atlanta (1), the trip where Matthew sat next to the ballet dancer (3), and the trip where Matthew sat next to the attorney (7) were among the last three trips [April 16th, 23rd, and 30th (intro)], and the trip to Atlanta wasn't the one where he met the ballet dancer (6) or the attorney [he flew WTA Airways exactly two weeks before the one to Atlanta, and he flew Fly America exactly two weeks before he sat by the attorney (7), thus, these three are separate flights, in some order. He didn't sit by the teacher on the trip to Atlanta (1), so the flight were he sat by the teacher was on one of the first two flights [April 2nd and April 9th (intro)], but it wasn't first [after WTA Airways](1), therefore, April 2nd flight was the WTA Airways flight, the one where he sat by the teacher was the April 9th flight, and the one to Atlanta was the April 16th flight, and he sat by the ballet dancer and attorney on the April 23rd and

April 30th flight, in some order. He didn't sit beside the sports coach on the WTA Airways flight (5) so that wasn't April 2nd, he sat beside the sports coach on the Atlanta flight [April 16th] and it was the April 2nd flight where he sat next to the doctor. April 2nd [first flight, WTA Airways, doctor] wasn't to Seattle (2), Boston (3), or San Diego (4), that flight was to Chicago. The April 9th flight wasn't to Seattle [after sports coach which was April 16th] or to Boston [after Air Express, which would have to be April 2nd, but WTA Airways was April 2nd (1)](3), thus, on April 9th he flew to San Diego. Boston wasn't the last destination (3), so it was his destination on April 23rd and Seattle was his destination on April 30th. Boston [April 23rd] was before the one where he sat by the ballet dancer (3), so he sat by the ballet dancer on April 30th flight to Seattle, and it was on the April 23rd flight to Boston that he sat by the attorney. Since he sat by the attorney on the April 23rd flight, then he flew Fly America on the 9th [exactly two weeks before](7). He flew Air Express before the flight when he flew to Boston [April 23rd](3) so he flew Air Express on the 16th. He didn't fly Skyways to Seattle [April 30th](5), thus, he flew Skyways to Boston on the 23rd and his last flight that month was on MidUSA Air (intro).

minimum possible steps: Switching & entering

There are 2 separated rooms, one having 8 bulbs and the other having 8 switches.
You have to find out which switch is of which bulb, in minimum possible steps.
Switching & entering into the room once is defined as ONE STEP



Ans
Since we have 8 bulbs and 8 switches, we only need to find out 7 bulb/switch pairs and then we should know the 8th pair.

With the remaining 7 switches, I choose to switch on two at a time (switching everything else off before each step), like this:

1&2
2&3


And then we should be able to pair switches 1, 2 and 3 to their respectful bulbs with bulb no. 2 being the one lit in both steps and bulbs no. 1 and 3 lit in their respectful steps, and then continue with the same method:

4&5
5&6


Having figured out switches 4,5 and 6 also, we only need to flick switch number 7 to see which one that links to. And as stated previously we should also know by then that bulb no. 8 is the one that was never turned on.

Anybody that can do it in fewer steps?

I'm at work right know, which I should really be getting back to but looking forward to working on a formula for this problem later I'm thinking something - 1, then modulus 3 and then the rest dived by three?


WAIT! - Strike everything above

Having written this post I wondered if turning on three bulbs at a time would work better.... and yeah.... I'm guessing we could do it in 4 steps... :P

Turning on:
Step 1: 1 & 2 & 3
Step 2: 3 & 4 & 5 Giving us the bulb linked to no. 3 (lit first two steps)
Step 3: 5 & 6 & 7 Giving us bulb no. 5 (lit in step 2&3) AND bulb no. 4 (only lit in step 2)
Step 4: 7 & 8 & 1 Same as above, giving no. 6 (only lit in step 3), no. 7 (lit in steps 3&4), no. 8 (the only one first lit in step 4) and bulb 1 (lit in steps 1 and 4)

I could have just turned on switch 7&1 with switch 8 then being linked to the one bulb never lit. Better yet, the same algorithm could be used to link 9 switch/bulb pairs, then with the 9th bulb never being lit.

I then decided to write out the steps in respect to number of odds and even numbers, as so:
1 - odd number 1 = O1
2 - even number 1 = E1
3 - odd number 2 = O2
4 - even number 2 = E2...

With this notation, the steps for the above problem (with 8 or 9 bulbs that is) would be:
O1 & E1 & O2
O2 & E2 & O3
O3 & E3 & O4
O4 & E4 & O1

As some might notice, the number of steps required to pair X switches/bulbs is the same as the number of even numbers counting up to (and including) X. And because an even number divided by two gives us the number of even numbers counting up to that number, all we need to do is to subtract one from the number if X is an odd number, and I would guess the best mathematical notation for that would by x - modulus(x/2), right?

So the the number of steps required to pair X switches to X bulbs is (x - modulus(x/2)) / 2

So, for example, to figure out 13 switch/bulb pairs, we would need:
(13 - modulus(13/2)) / 2
(13 - 1) / 2
12 / 2 = 6 steps

Microsoft job interview include 98 questions as follows:

Microsoft job interview include 98 questions as follows:

1. Riddles Microsoft interview

It include 18 interview questions about riddles such as:
. Why is a manhole cover round?
. How many cars are there in the USA?

2. Algorithms Microsoft interview

It include 36 interview questions about Algorithms such as:
. Describe advantages and disadvantages of the various stock sorting algorithms?
. Implement an algorithm to reverse a linked list. Now do it without recursion?

3. Thinkers Microsoft interview

It include 14 interview questions about thinkers such as:
. Why do you want to work at Microsoft?
. If you are going to receive an award in 5 years, what is it for and who is the audience?

4. Applications Microsoft interview

It include 10 interview questions about applications such as:
. If you could add any feature to Microsoft Word, what would it be?
. How would you go about building a keyboard for 1-handed users?

5. Microsoft phone interview

It include 20 phone interview questions such as:
. How would you design a toaster? (sometimes elevator).
. How would you debug your toaster? (sometimes elevator).

Source: Microsoft interview questions

Which of the following statements are true?

Which of the following statements are true? [ with your own reasoning, of course! ]

1 This is a numbered list of twelve statements.
2 Exactly 3 of the last 6 statements are true.
3 Exactly 2 of the even-numbered statements are true.
4 If statement 5 is true, then statements 6 and 7 are both true.
5 The 3 preceding statements are all false.
6 Exactly 4 of the odd-numbered statements are true.
7 Either statement 2 or 3 is true, but not both.
8 If statement 7 is true, then 5 and 6 are both true.
9 Exactly 3 of the first 6 statements are true.
10 The next two statements are both true.
11 Exactly 1 of statements 7, 8 and 9 are true.
12 Exactly 4 of the preceding statements are true.





Ans.
1,8,10,11,12

Logic:

1 is anyways true.
Assume that 12 is true.So we are left with 3 more statements from 2 to 11 which can be true.
We put 10 as true which makes 11 true, 12 is already true(we have assumed).If 11 is true then either 7,8,9 should be true. Only 8 satisfies the condition.

Where lies the flaw in the logic?

You can imagine an arrow in flight, toward a target. For the arrow to reach the target, the arrow must first travel half of the overall distance from the starting point to the target. Next, the arrow must travel half of the remaining distance.

For example, if the starting distance was 10m, the arrow first travels 5m, then 2.5m.

If you extend this concept further, you can imagine the resulting distances getting smaller and smaller. Will the arrow ever reach the target?

Ponder this?

Imagine a prisoner in a prison. He is sentenced to death and has been told that he will be killed on one day of the following week. He has been assured that the day will be a surprise to him, so he will not be anticipating the hangman on a particular day, thus keeping his stress levels in check.

The prisoner starts to think to himself, if I am still alive on Thursday, then clearly I shall be hanged on Friday, this would mean that I then know the day of my death, therefore I cannot be hanged on Friday. Now then, if I am still alive on Wednesday, then clearly I shall be hanged on Thursday, since I have already ruled out Friday. The prisoner works back with this logic, finally concluding that he cannot after all be hanged, without already knowing which day it was.
Casually, resting on his laurels, sitting in his prison cell on Tuesday, the warden arrives to take him to be hanged, the prisoner was obviously surprised!

Ponder this?

Find the numbers

I'm thinking of two integer numbers, each of them is more than 1 and their sum is less than 100.

I tell my friend CEan - Ash the sum of these two numbers, and another friend, CEan - MaRo, product of these two numbers.

Then such a dialog took place:

Ash: I can't determine what are these numbers.
MaRo: Ah, i knew you wouldn't be able to do this.
Ash: Oh, then i know what they are!
MaRo: Oh, then i know them too!

Can you determine the numbers?













Ans:
Assumption : Both numbers should be more than 1

since Ash and Mac knew sum and other the product...but they never exchange information abt sum/product....

if numbers are 2,2

Ash knows 4....but basic priciple is both numbers are more than one so
1,3(it differs because...one number is equal to one)
2,2

and Mach know 4...
so it can be
1,4 (it differs because...on number is equal to one)
2,2
............................
if numbers are 2,3

Ash knows 5....but basic priciple is both numbers are more than one so
1,4(it differs because...one number is equal to one)
2,3

and Mach know 6...
so it can be
1,6 (it differs because...on number is equal to one)
2,3

1 < x < y and x+y < 100 [x,y are the numbers].

But, is the answer, right?

Think harder!

Try this lock puzzle

You want to get through a security door, where you have to enter 3 digits as password, where each digit can be any from 0 to 9. The checking mechanism is, however, defective, and so will let you in if any 2 of your digits match with the password's. e.g. if the password is 087 and you enter 057, then you will be let in. You don't have much time and hence want to make as few tries as possible. What is the minimum number of tries in which you can definitely enter, and what are they (you need not give explicitly, if you describe a pattern).