
Data Scientist Interview Questions from Gojek, Meta & Walmart
In this article, we will walk through real-world data scientist interview questions asked at these companies. Each question is solved and explained in detail, covering both the logic and the underlying concepts. Whether you are preparing for interviews or seeking to strengthen your data science fundamentals, this comprehensive guide will help you master essential topics.
You have a sequence of logs from a driver that are timestamps which the app keeps sending every 15 seconds, e.g., [10, 25, 40, 100, 115, 130, ...]. If the gap between consecutive logs is more than 15 seconds, then the driver is considered offline. Find the number of hours the driver was online.
The driver app is expected to send a "heartbeat" log every 15 seconds. If the interval between two consecutive logs exceeds 15 seconds, it means the driver was offline in between. The task is to compute the total online duration from the log timestamps.