Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.29 KB

File metadata and controls

29 lines (21 loc) · 1.29 KB

#Exercise 1 Your client has asked you to write some TV scheduling software. Given an input of a TV schedule file tv_schedule_1.csv and a unix timestamp, output the name of the TV show that should be currently playing.

##Extra info/Assumptions

  • The items in tv_schedule_1.csv are in chronological order with oldest items first
  • The TV schedule is for a single channel; when one show finishes, the next one starts
  • There are no clashes in the file tv_schedule_1.csv
  • It is not possible to know the end time of a TV show, because of shows such as live sporting events. Therefore we only know the start-time of the TV show.
  • The currently playing show is the latest show to have started playing after a given timestamp.

##Example For example, given the inputs:

  • tv_schedule_1.csv
  • 1453805100

The output should be "Homes Under the Hammer" which started at 1453802400, or 26th January 2016 at 10:00. The input timestamp 1453805100 converts to 10:45 on 26th January 2016. The next show, "Wanted Down Under", starts at 1453806000, or 26th January 2016 at 11:00.

##Exercise 1.1 For the input timestamp 1453809600 what program is playing?

##Exercise 1.2 For the input timestamp 1453833360 what program is playing?

##Exercise 1.3 For the input timestamp 1453780800 what's the behaviour of your program?