ThoughWorks Screening Puzzle

You are planning a big programming conference and have received many proposals which have passed the initial screen process but you're having trouble fitting them into the time constraints of the day -- there are so many possibilities! So you write a program to do it for you.

· The conference has multiple tracks each of which has a morning and afternoon session.
· Each session contains multiple talks.
· Morning sessions begin at 9am and must finish by 12 noon, for lunch.
· Afternoon sessions begin at 1pm and must finish in time for the networking event.
· The networking event can start no earlier than 4:00 and no later than 5:00.
· No talk title has numbers in it.
· All talk lengths are either in minutes (not hours) or lightning (5 minutes).
· Presenters will be very punctual; there needs to be no gap between sessions.

Note that depending on how you choose to complete this problem, your solution may give a different ordering or combination of talks into tracks. This is acceptable; you don’t need to exactly duplicate the sample output given here.

Test input :-
------------

Writing Fast Tests Against Enterprise Rails 60min
Overdoing it in Python 45min
Lua for the Masses 30min
Ruby Errors from Mismatched Gem Versions 45min
Common Ruby Errors 45min
Rails for Python Developers lightning
Communicating Over Distance 60min
Accounting-Driven Development 45min
Woah 30min
Sit Down and Write 30min
Pair Programming vs Noise 45min
Rails Magic 60min
Ruby on Rails: Why We Should Move On 60min
Clojure Ate Scala (on my project) 45min
Programming in the Boondocks of Seattle 30min
Ruby vs. Clojure for Back-End Development 30min
Ruby on Rails Legacy App Maintenance 60min
A World Without HackerNews 30min
User Interface CSS in Rails Apps 30min

Test output :-
-------------

Track 1:
09:00AM Writing Fast Tests Against Enterprise Rails 60min
10:00AM Communicating Over Distance 60min
11:00AM Rails Magic 60min
12:00PM Lunch
01:00PM Ruby on Rails: Why We Should Move On 60min
02:00PM Common Ruby Errors 45min
02:45PM Accounting-Driven Development 45min
03:30PM Pair Programming vs Noise 45min
04:15PM User Interface CSS in Rails Apps 30min
04:45PM Rails for Python Developers lightning
04:50PM Networking Event

Track 2:
09:00AM Ruby on Rails Legacy App Maintenance 60min
10:00AM Overdoing it in Python 45min
10:45AM Ruby Errors from Mismatched Gem Versions 45min
11:30AM Lua for the Masses 30min
12:00PM Lunch
01:00PM Clojure Ate Scala (on my project) 45min
01:45PM Woah 30min
02:15PM Sit Down and Write 30min
02:45PM Programming in the Boondocks of Seattle 30min
03:15PM Ruby vs. Clojure for Back-End Development 30min
03:45PM A World Without HackerNews 30min
04:15PM Networking Event

Calsoft Labs Interview Question

Three friends, Peeta, Eugene and Harry plans to visit an art exhibition of Leonardo Da Vinci. While going to the exhibition Peeta says that Leonardo has at least four paintings of Rembrandt. Eugene denies with his statement and tells that he has less than four paintings of Rembrandt. Harry says that he does not know exactly too but he knows that there is at least one Rembrandt by Leonardo.

Now only one of the three friends is correct. Knowing the fact, how many Rembrandt does Leonardo has?

Yahoo Interview Question

Once in a prison with 100 prisoners, the Warden introduces a strange but interesting challenge to all the prisoners. This challenge can even grant them the freedom and thus every one of the prisoners becomes quite excited.

The warden selects one prisoner everyday randomly from the lot and moves him into a pitch black room with a bulb and a witch that controls the bulb. The prisoner can carry out three different actions in the room - He can switch on the bulb, switch it off or do nothing and sit idle. A prisoner can be picked up more than one time.

Now the warden introduces the twist in the challenge. He tells them that the prisoners can put a stop to the process any day they feel that every one of them has been confined to that room at least once. If the prisoners are correct, then every single one of them will be set free. But if they have put up a wrong judgment, all of them will be killed.

Seeking it to be the only chance of freedom, the prisoners take up the challenge. They are given some time to discuss regarding it before the process could begin. How will they plan things so that they are finally set free?

Intel Interview Question

In a party, there are five people and a whole round cake lying at the center of table. Only four people will make a cut and take their piece and the last one will get the remaining piece on the table.

How can they make sure that everyone gets a 1/5th of piece?

Infogain Interview Question

This is a famous probability puzzle in which you have to choose the correct answer at random from the four options below.

Can you tell us whats the probability of choosing correct answer in this random manner.

1) 1/4
2) 1/2
3) 1
4) 1/4