Qn given a list of numbers JobIds 1, 2, 3, 7, 8, 5, 4 You have to implement 3 functions
1. start(jobId) job id will be submitted in sorted order
2. ack(jobid) this will return jobids that are completed not necessary in sorted order
3. getCurrentWaterMark() this should return the hight continious jobid that is successful
eg: [1, 2, 3, 7, 8, 5, 4] if
ack(1), ack(2), ack(3)
getCurrentWaterMark() -> should return 3
ack(7), ack(8)
getCurrentWaterMark() -> should return 3
ack(4)
getCurrentWaterMark() -> should return 4
This is a LC Easy but My bain was not braining in the interview and I used min heap insted of set :(Comments (0)


