In a kingdom far far away, the King decided that the time
has come to find a husband for his princess daughter. The
King wanted to find a worthy lad for his princess, so he
promised to give his daughter away to the first young (or
old) man who would solve the puzzle that has stumped the
best of his court mathematicians for years. The puzzle is
very simple: in a palace, there are 25 rooms arranged in a
square--5 rows of rooms with 5 rooms in each row. In every
room there is a light switch which not only switches on/off
the light in that room, but also switches the lights in the
adjacent rooms--the room to the right, to the left, the
room above and the room below. Initially, all of the
lights are turned off. The goal is to turn the lights on
in every room of the palace.

Answers were Sorted based on User's Feedback



In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / ananya

X1X1X Superman,if u on 4 lights,then switches of the
10101 room denoted by X will not be turned on.
X1X1X
10101
X1X1X
.........................................................
U have to on 7 lights

The room of which light need to on is indicated by 0,

11011
01110
11011
01110
11011

Is This Answer Correct ?    37 Yes 5 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / daniela

1 1 0 0 0
1 1 0 1 1
0 0 1 1 1
0 1 1 1 0
0 1 1 0 1

1 - switch on the light

Is This Answer Correct ?    8 Yes 3 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / max

00600
10003
00500
20004
00700

Need to switch on 7 lights.

Is This Answer Correct ?    6 Yes 3 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / pradip biswas

11111
10110
11111
11111
10110


0 indicates rooms you need to switch lights on... Its simple....

Is This Answer Correct ?    2 Yes 0 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / alphy

only 1 light need to switch on, gradually the remaining all
will become on.

1 0 0 0 0
0 0 0 0 0
0 0 0 0 0---->
0 0 0 0 0
0 0 0 0 0

1 1 0 0 0
1 0 0 0 0
0 0 0 0 0---->
0 0 0 0 0
0 0 0 0 0

1 1 1 0 0
1 1 0 0 0
1 0 0 0 0----> like this
0 0 0 0 0
0 0 0 0 0

Is This Answer Correct ?    12 Yes 11 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / tirupathi

X1X1X Superman,if u on 4 lights,then switches of the
10101 room denoted by X will not be turned on.
X1X1X
10101
X1X1X
.........................................................
U have to on 7 lights

The room of which light need to on is indicated by 0,

11011
01110
11011
01110
11011


Hi Ananya can you please explain this.

Is This Answer Correct ?    1 Yes 1 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / sharmesh kumar

Hi Ananya,

I have doubt in your solution as well.

.........................................................
U have to on 7 lights

The room of which light need to on is indicated by 0,

11011
01110
11011
01110
11011

.........................................................
Suppose the room are numbered like
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

Now,if room no. 3,6,10 were switched-on, this will switch-on
lights in the room (2,8,4);(1,7,11);(5,9,15) in that order
respectively. Now when 13th room light is lit, it will
switch-off the light of room no. 8 as well. So, if we follow
your approach, at last the lights from room no.s 8 & 18 will
be OFF.

Is This Answer Correct ?    1 Yes 1 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / dolly

7 is the correct answer which is provided by Md.Answer no:5

Is This Answer Correct ?    0 Yes 0 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / pradip biswas

Sorry I did not understand the problem before ... My solution is wrong.

Is This Answer Correct ?    0 Yes 0 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / guest

Switch on the first room light

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Puzzles Interview Questions

In training for a competition, you find that swimming downstream (with the current) in a river, you can swim 2 miles in 40 minutes, & upstream (against the current), you can swim 2 miles in 60 minutes. How long would it take you to swim a mile in still water?

2 Answers  


How will you differentiate a 5 rupee(indian currency)or any five currency coin?Answer me how will you differentiate????? This question is asked in a college appitute test.Any one know help me plzzzzz!!!!!!!!!!!!!

2 Answers  


You are seat in one room having switch board containing 3 switchs & its connection to bulb in another room (only one is right connection).terms- you can turn on max 2 buttons and once you can go to see the answer which is right one?

7 Answers  


Question asked in Infosys Campus Recruitment Held at Pragathi. On an iceland few customs are there .Men always speak truth, no women tells consecutive truth or false i.e. If first statement is true ,second is false and vice versa. same with children also. There was a family couple and a child. A passenger asked the child ?are you a boy or a girl? the boy spoke german. one of the parent said ? he is a boy? the other said ?he is a girl? ?he is lying?. (i)The kid is boy or girl (ii)who spoke the first mother/father

25 Answers   Infosys,


Three friends went to hotel for breakfast . After having breakfast total bill was Rs 25 . Each one contributed Rs 10. So total was Rs 30 . 30 is paid. waiter gave Rs 5 back to them . Three friend gave Rs 2 tips to waiter . From remaining Rs 3 each one took one rupee. As each one contributed ten . And each friend recieved one rupee back. Means each one had breakfast in nine rupee. So three friend had breakfast in 9+9+9=27. And Rs 2 is given to tips to waiter. So total money for breakfast for three friend was 27+2=29. Where is remaining one rupee?

5 Answers   IIT,






in a village 4000 people watch a tv.in which 1500 watch A channel.2000 watch B channel and 2500 watch C Channel.500 people watch A and B channel.800 watch A and C Channel.1000 watch B and C Cahnnel.find maximum people who watch maximum no of channels?

9 Answers   Siemens,


There are 3 persons X, Y and Z. On some day, X lent tractors to Y and Z as many as they had. After a month Y gave as many tractors to X and Z as many as they have. After a month Z did the same thing. At the end of this transaction each one of them had 24. Find the tractors each originally had?

1 Answers  


1/3 rd of the contents of a container evaporated on the 1st day. 3/4th of the remaining contents of the container evaporated on the second day. What part of the contents of the container is left at the end of the second day?

2 Answers  


A cube is divided into 125 pieces.. then four columns are removed then coloured all side black.. i) how many 0 side painted cubes? ii) how many 1 side painted cubes? iii) how many 2 side painted cubes? iV) how many 3 side painted cubes? V) how many 4 side painted cubes?

7 Answers   Stairway Engineering, Tata Elxsi,


3 blocks are chosen randomly on a chessboard. What is the probability that they are in the same diagonal?

3 Answers  


agar aapne kabhi kisi se saccha pyar kiya hai to is gaane ko complete karo K---N -O --H--T - --G--T---I-A J---N T--S-- S----H--

2 Answers  


What is the smallest whole number that, when divided by 2, leaves a remainder of 1; when divided by 3, leaves a remainder of 2; and so on, up to leaving a remainder of 9 when divided by 10?

24 Answers   ASD Lab, Athena Health Care,


Categories