Interview Question
Software Engineer / DevelopersTeam: SDE
Country: India
n=number of people in room.
handshakes= sum from 0 to (n-1)
in general the sum of all integers up to an integer 'x', sum = x(x+1)/2
Let the inter x = n-1:
handshakes=66=(n-1)n/2
132=(n-1)n
you can use quadratics or if you know up to your 12 times tables you see that the anser is 132=11*12
and so n=12.
There are 12 people in the room
I don't see the point of this question. Is the problem to make all pieces different? Otherwise I would say there are two optimal (though optimal is not defined) solutions: 4 2 x 2 squares, or 4 triangles created by the two diagonals. Note to gixxer6er: squares *are* parallelograms.
Is this supposed to be a programming question?
Sheesh. Inadequate customer specifications! :-)
What we have to optimize on? There can be multiple solution to this problem. Like one solution can 4 2x2 squares etc.
- deadman September 15, 2012