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

If you were to dial any 7 digits on a telephone in random order, what is the probability that you will dial your own phone number? Assume that your telephone number is 7-digits.

6 Answers  


1.At the recent web developres bowling match,two ganes were played.Kiev beat stuart in both games;also Richard beat John in both games.The winner in game1 second in game2.Richard won game2 and John beat stuart in game1.No player got the same placing twice.Can you determine who finished where in each game?

2 Answers   QA,


Given 3 jabs A,B,C with capacities 10L 8L 5 L You can get water from tap or pour away the water in the jar 1. How do you get 9L in jar A? 2. How do you get 7L in jar B?

4 Answers  


15 people--each has to pay Rs.20.. 20 people--each has to pay Rs.18.. for 40 people--how much has to pay

6 Answers  


Find the least number which when divided by 35, leaves remainder 25; when divided by 45, leaves remainder 35 and when divided by 55, leaves remainder 45.

9 Answers  






If one person sends the e-mail to two friends, asking each of them to copy the mail and send it to two of their friends, those in turn send it to two of their friends and so on. How many e-mails would have been sent by the time it did 30 sets?

2 Answers  


In a certain year, the number of girls who graduated from City High School was twice the number of boys. If 3/4 of the girls and 5/6 of the boys went to college immediately after graduation, what fraction of the graduates that year went to college immediately after graduation?

1 Answers   ICICI,


what is your future plans for qatar airways group u.k?

1 Answers   Qatar Airlines,


If A+B=C, D-C=A and E-B=C, then what does D+F stands for? Provide your answer in letter terms as well as in number terms.

1 Answers  


Please send SBI Model exam question Paper for Clerical exam sir

2 Answers  


a circle is drawn...roughly in paper...the interviewer asked me to find centre point of circle?the radius,circumference is not known?how to find it?

19 Answers   Infosys, Accenture, HCL, Manhattan,


no.1-6 first is added the last 3 are subtracted , arrange the no. so that each sum and difference give the same answer

3 Answers   Karur Vysya Bank KVB,






Categories