Connection Invite Acceptance Rate by Source in Pandas

Last updated: November 29, 2026

Quick Overview

Given an invitations DataFrame and a responses DataFrame, compute for each invite source (People You May Know, search, profile page) the share of invitations accepted within seven days of being sent.

LinkedIn
Data Manipulation (SQL/Python)
Data Scientist
LinkedIn
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Given an invitations DataFrame and a responses DataFrame, compute for each invite source (People You May Know, search, profile page) the share of invitations accepted within seven days of being sent.

LinkedIn data science screens often include a short pandas exercise on network growth data, and invitation acceptance is a core health metric for People You May Know. The interviewer checks joins that keep non-responders, time-window logic and handling of messy response histories.

What the Interviewer Expects
  • Uses a left join so invites without a response count in the denominator
  • Handles invites with several responses (ignored, then accepted)
  • Applies the seven-day window correctly, with NaT treated as not accepted
  • Groups and computes the rate cleanly
  • Mentions censoring for invites sent in the last seven days
Key Topics to Cover
pandas merge
groupby aggregation
time windows
missing data
acceptance rate
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you add a confidence interval per source?
  • How would you exclude invites sent less than seven days ago?
  • What if the same sender re-sent an invite to the same recipient?
  • How would you compute median time to accept by source?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

invites(invite_id, source, sent_at) and responses(invite_id, status, responded_at) where status is accepted or ignored. Invites with no response have no row in responses. A member can ignore...

Approach

Reduce responses to the first acceptance time per invite, left join onto invites, flag acceptance within the window and average by source. Missing acceptance becomes NaT, and comparisons with NaT ...


Submit Your Answer
Markdown supported