InterviewDB Question

Friends Invitation - Viral Referral System with Reward Tracking

Question Details

Problem Design a friends invitation and reward tracking system. When user A invites user B who signs up, A earns a reward. If B then invites C who signs up, A also earns an indirect reward (one level deep only). Implement: invite(inviter_id, invitee_email) - record invitation. signup(email, user_id) - register the user and trigger rewards. get_rewards(user_id) -> int - total reward credits earned. get_invitees(user_id) -> List[str] - list of successfully signed-up direct invitees. Example: Follo…

Full Details

🔒

Unlock all Two Sigma questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a two sigma interview during the phone round.

It covers the following topics: Coding, Onsite, Phone .