Designing a Dating App (Tinder/Bumble) - Mock Interview Notes

Jun 27, 2024

Designing a Dating App (Tinder/Bumble) - Mock Interview Notes

Session Overview

  • Interviewer: Unnamed
  • Interviewee: Yen Lee, Senior Software Engineer at TikTok
  • Objective: Design a dating app similar to Tinder or Bumble

Key Functionalities & Requirements

  1. Profile Creation
    • Bio setup
    • Preferences
    • Photos/Videos
    • Optional: Super like features
    • Important Components:
      • Images/Videos upload
      • Bio information
      • Preferences and filters
  2. Feed/Recommendation
    • Local user recommendations
    • Active user prioritization
    • Profile matching algorithms
  3. **Matching
    • Mechanism for users to match (e.g., swipe right)
    • Notification when matched
  4. Messaging
    • Private messaging after matching
    • Exchanging texts, photos, and videos
  5. Additional Considerations
    • System monitoring & logging (optional due to scope)
    • Subscription model for monetization

Traffic & Storage Estimations

  • Estimated Users: 50 million
  • Active Users: 1 million per day
  • New Profiles: 500k per day
  • Matches: 1 billion per day
  • Storage Requirement:
    • Profile Photos: ~300-600TB
    • Messaging Data:
      • 200 million messages daily
      • 10 million photos uploaded daily

Detailed Design Components

Profile Creation Process

  • Client Perspective: Flow
    • Users answer questions (JSON format)
    • Upload images/videos
    • Store data in NoSQL database
    • Encode and resize images for storage efficiency
  • Profile Data Format:
    • Profile ID (string)
    • User ID (string)
    • Preferences (JSON)
    • Bio information
    • Photo IDs (list of strings)
    • Last Login information for activity status

Feed/Recommendation System

  • Requirements:
    • Local users
    • Active users
    • Balance between too many and too few matches
    • Low latency prioritized over real-time recommendations
  • Geo Sharding for Locality
    • Using latitude and longitude for database sharding
    • Relies on services like Google S2 for shard management
    • Recommendation Flow:
      • Client requests recommendation list
      • Geo Sharding Mapper retrieves local shards
      • Filters profiles based on preferences and activity
      • Returns a limited number of profiles (e.g., 50)
  • Recommendation Service Tasks:
    • Filter profiles based on preferences & active status
    • Ensure profiles don't exceed a set limit
    • Balance matches across users

Considerations for Optimization

  • Scalability:
    • Load balancers
    • Memory caches (e.g., Redis)
  • Storage & Processing Efficiency:
    • Image resizing/encoding
    • NoSQL databases for flexibility and scale

Conclusion & Tips for Interviewees

  • Key Interview Strategy:
    • Start broad, cover core functionalities
    • Dive deep into individual components
    • Balance deep dives with broad coverage
  • Interviewer Role:
    • Guide the discussion
    • Keep interviewees on track when needed

Final Thoughts

  • Focus on a balanced approach between low latency and quality recommendations.
  • Prioritize user experience (e.g., low waiting time for recommendations).
  • Be prepared to discuss core functionalities distinctively and integratively.