Question 9 - Time for a response on a messaging application


The following data science interview question is testing for your ability to interpret a 'real life' dataset and quickly extract an insight. This particular question asks for a solution in Python (using Pandas), but it would also be common to solve this in SQL or R.

Below is a table schema for a P2P messaging application. The table contains send/receive message data for the application's users.


Column Name Data Type Description
date string date of the message sent/received, format is 'YYYY-mm-dd'
timestamp integer timestamp of the message sent/received, epoch seconds
sender_id integer id of the message sender
receiver_id integer id of the message receiver

Using python (pandas), how would you find the fraction of messages that get a response within 5 minutes? For simplicity, let's limit data to March 1, 2018.



Ace your next data science interview

Get better at data science interviews by solving a few questions per week