1 Answers
You can use similar logic that was used here: https://mockinterview.co/index.php/question/sql-given-two-tables-friend_request-requester_id-sent_to_id-time-request_accepted-acceptor_id-requestor_id-time-find-the-overall-acceptance-rate-of-requests/
- Define the success ratio and schema first
- Sent table (S) = message_id, sender_id, time
- Receive table (R) = message_id, received_id, time
- Assuming success ratio is the % of messages delivered successfully then you can write SQL to:
- Remove recent data (like last 24 hours) — this is your threshold after which you consider the message not delivered!
- Count(R.message_id) / Count(S.message_id)
Your Answer