Monday, August 30, 2010

Minimum diff between dates of a week

Problem statement:
The UI contains a set of checkboxes. Each signifies a day. The list starts from a Sunday and goes upto a Saturday. The task is to find out the minimum difference between the selected days.

Eg:
If Mon, Thur and Fri were selected, then the minimum days between the selected days would be 1 (Thu and Fri).

Take into consideration that if Sun and Sat were selected, the difference would be 1. :)

Thursday, August 5, 2010

Scratch

Bangalore is a crowded place and therefore traffic is a killer. Today when I was coming to the office, I overtook a car guy right on the side. I took the at-most care in not touching his vehicle. The guy comes out after a couple of minutes and blasts me. He says that I had scratched his vehicle, 2 times ! I start think when I had done so and if I had done it wouldn't I know ? He goes back after lecturing me about responsibility and stuff and I take it. After I overtook him, there was a guy on an old bike, who came in quite fast. He had also overtook me, took his bike on the pavement and had gone further. The guy must have probably scratched him and then taken it further to avoid a clash.

To the car guy:
It was good that you were very calm during the whole incident. But before you start giving lectures and blaming people, you would want to make sure that you have got the right person. You would also want to check your eyes.