Rearden Commerce
Work in HR? Unlock Free Profile

Rearden Commerce Principal Engineer Interview Question

I interviewed in San Mateo, CA and was asked:
"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?"
Tags: analytical skills, logic, algorithm
Add Tags [?]

Part of a Principal Engineer Interview Review - one of 38 Rearden Commerce Interview Reviews

Answers & Comments

of 0
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
of 0
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
of 0
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

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.