Katkat

Generate Friendship List with Acceptance Dates Using Pandas

RobloxData Scientist · Onsite

Last updated

This question evaluates proficiency in data manipulation and relational reasoning using Python/pandas, focusing on transforming event logs into canonical pairwise relationships and extracting activation timestamps.

friend_events

requester_idaccepter_idrequest_dateaccept_date
122024-01-012024-01-02
232024-01-032024-01-05
322024-01-042024-01-05
212024-01-062024-01-07
412024-01-082024-01-09
Scenario

After launching a social feature, product wants a list of confirmed friendships with the date they formed.

Question

Given friend request logs, write Python/pandas that returns each distinct user pair once (smaller id first) and the acceptance date when the friendship became active.

Hints

Filter accepted rows, sort ids, drop_duplicates.