Design a Social Gifting Feature

Medium45 min
1 / 30
understanding10 min read

Problem Statement: Virtual Gifting Is a Payment System Wearing a Social Costume

Frames gifting as four coupled planes: commerce, social graph, live real-time, and trust. The ledger is the spine.

Problem statement

Design a social gifting feature that lets users send virtual gifts—stickers, badges, animated items, and purchased premium gifts—to each other inside a social platform. A sender spends coins or real money; a recipient receives a notification, a profile or feed moment, and, for monetized creators, convertible earnings; live audiences see the gift as a real-time overlay and leaderboard movement. The feature spans coin purchase, catalog browsing, atomic value transfer, delivery fan-out, earnings accounting, refunds, and fraud control.

The distinctive engineering fact is that gifting is simultaneously three systems that hate each other. It is a payment system, where a double-spend or lost posting is money and therefore requires serializable, double-entry, idempotent semantics. It is a social fan-out system, where one gift can produce a recipient notification, a feed story, and a broadcast to hundreds of thousands of live viewers, which demands eventual consistency and coalescing. And it is a real-time system, where the overlay must appear within half a second during a live stream even while the ledger is still committing. A strong answer keeps these planes separate and defines exactly which one may degrade first.

Why the problem is distinctive

A like or a comment can retry invisibly. A gift cannot: the sender's balance decreased, so every retry path must be idempotent and every failure must reconcile to a durable truth. A feed post can be eventually visible; a gift overlay that lands ten seconds late destroys the social moment and the whale's willingness to spend. And unlike pure virtual reactions, purchased gifts touch real money, app-store fees, chargebacks, anti-money-laundering rules, and creator payouts, so the design must include compliance and fraud as architecture, not as an afterthought.

Public operating baseline versus design assumptions

Public evidence shows the category is real and large. TikTok reports more than one billion monthly users and runs a two-currency live gifting economy where purchased coins become gifts and creators accumulate diamonds that cash out through payment providers. Twitch documents that each bit cheered pays the streamer one US cent and supports community sub gifting that bursts fan-out randomly across a channel's viewers. Meta's Stars program likewise pays creators one cent per star on Live and Reels, and its earlier Facebook Gifts experiment (2012-2014) showed that physical-goods gifting failed where virtual goods succeeded. These are cited public facts used for context only.

For capacity planning this answer explicitly assumes a mature platform with 500M MAU, 120M DAU, 10M gift sends per ordinary day, a 6x holiday peak, 1.5M concurrent live viewers at peak, and 3 postings per gift. Unless tied to a citation, every number is a stated design assumption, target, or budget.

The four architectural planes

  1. Commerce plane: payment providers, app-store IAP receipt validation, coin wallet, double-entry ledger, creator earnings, payouts, refunds, chargebacks.
  2. Social plane: catalog, gift metadata, feed stories, profile showcases, notification fan-out over the social graph.
  3. Live real-time plane: room-scoped WebSocket overlay broadcast, gift animations, leaderboards, coalescing under hot rooms.
  4. Trust plane: purchase and send velocity rules, collusion and money-laundering detection, content moderation of gift notes at the architecture level, enforcement ladder, audit.

The interview win is stating early: the ledger is the source of truth; overlays, notifications, and leaderboards are projections that may lag, coalesce, or shed load, but never define balance.

Key Highlights

  • Gifting is a payment system, a social fan-out system, and a real-time system coupled by one durable ledger.
  • A gift retry must be idempotent because the sender's balance decreased; invisible retries are not acceptable.
  • Public facts: TikTok two-currency gifting at 1B+ MAU; Twitch 1 cent per bit; Meta 1 cent per star; Facebook Gifts (physical) shut down.
  • Assumed design scale: 500M MAU, 120M DAU, 10M sends/day, 6x holiday peak, 1.5M concurrent live viewers.
  • Overlays, notifications, and leaderboards are projections; the double-entry ledger is the only balance truth.
Lead With the Ledger
State in the first two minutes that balances live in a double-entry ledger with serializable per-account semantics, and that overlays and leaderboards are disposable projections. This instantly separates your answer from a generic social feed design.
Do Not Draw a Toy Counter
Modeling coins as a mutable integer column updated by blind increments invites double-spend under retries and races. Interviewers probe exactly this; show postings, invariants, and idempotency instead.

Section Rescue Kit

Buzzwords to use:

Double-Entry LedgerProjection

Safe statements:

  • "I will separate money truth from social presentation: the ledger is serializable, the overlays are eventual."
  • "Before choosing services, let me state which outputs may degrade first when the platform is under holiday load."
Design a Social Gifting Feature - System Design | WinJob | WinJob