Problem Statement
Welcome to the Levels.fyi Hackathon! We have handcrafted debugging problems based on historical issues, and your task is to identify and fix them. An editorial with references to these incidents will be shared shortly after the contest ends.
The NumbersService.is_present method performs a binary search on a sorted list of integers called numbers to find a specific value. However, something isn't working correctly. Please investigate and address this issue.
The VideoService tracks views on videos and computes statistics with the data. However, the code is resulting in a runtime error. Even after fixing the runtime error, the service is taking too much time to return the responses. Please investigate and address these issues.
The VideoService is now being used by a very busy backend service. However, the service is currently returning incorrect view counts, which was not the case earlier. Please investigate and address this issue.
A new requirement requires us to delete videos older than a year. For this purpose, LifecycleService.get_expiry_date takes a date string as input (format: YYYY-MM-DD) and returns the date after 1 year. For some reason, this is not working correctly. Please investigate and address this issue.
Note: The problem may have multiple correct solutions, any of them will be accepted.
Having VideoService data in memory was causing memory leaks and server crashes given the amount of data the service was handling. We recently migrated to using a database (SQLite in this case). While adding and getting views are working as expected, bulk additions are taking too much time. Please investigate and address this issue.
You don't need to write the driver code; you only need to fix the errors and run. To keep things interesting, we have hidden stdout and stderr!
Track your progress on the leaderboard!