Interview Question

Interview San Mateo, CA

The VCR Plus feature was described. In the TV programming

  guide each program/show/movie had its own code. When user wanted to program the VCR to record a particular show she just had to enter the program code from the guide - no need to enter the start and end time. I was asked to design this feature. How can it be achieved?
analytical skills, logic, algorithm

Interview Answer

3 Answers


Assuming that TV shows start and end at the 1 min interval (ie won't need to set the start to 1:35:28), there are 1440 mins in 24 hours. One solution would be to have an 8 digit VCR Plus code: xxxxyyyy The first 4 digits will be the start time, second 4 digits will be the end time. This will take 8 bytes of space.

Tazzy531 on Jul 15, 2009

That solutions assumes one channel. 1 digit for the day of the week. Assuming a max of 1000 channels, 3 digits for the channel number. 4 digits for the start time. Assuming the maximum show length is 1000 minutes, 3 digits for the record time. 11 digits. This could be optimized further if you restrict program start times to the nearest 5 or 15 minute interval, and record times to 5 or 15 minute intervals.

TryThis on Jan 6, 2010

Actually the VCR+ has 30 minute resolution. It packs the info into binary bits, then converts from binary to decimal, saving digits. The Java code is here:

maxzed2k on Feb 11, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.