Pinterest ML Engineer Interview
Anonymous User
3637

Started with ML Theory Questions which I answered well

Found the following questin pretty hard. Not sure if leetcode has a similar question. Appreciate if anyone can solve it or link to relevant questions.

Given calendars of two people, return the list of open slots from both calendars. The calendars need not necessarily be sorted. I kept switching back and forth between calculating empty and busy slots and felt lost after a while.

  • Times are represented as floating point numbers in the range [0.0-24.00]
  • You can assume the day starts at 0.0 and ends at 24.00 , so all open slots in that range should be calculated

Example :
p1 = [[8.0-9.0], [10.0-11.5], [11.5-12.5]]
p2 = [[3.5-4.5] , [2.5-3.5], [9.0-10.0], [10.0-10.5]]
output = [[0.0-8.0], [12.5-2.5], [4.5-24.0]

Comments (8)