Archicise
Exercise

Design a REST API for Social Media

Design a RESTful API for a social media platform with posts, comments, likes, follows, and real-time notifications.

Functional Requirements

  • User profiles and authentication
  • Posts with media attachments
  • Comments and nested replies
  • Likes and reactions
  • Follow/unfollow relationships
  • News feed generation
  • Notifications

Non-Functional Requirements

  • Handle viral content with millions of interactions
  • Real-time updates for notifications
  • Efficient feed generation
  • Media upload handling
  • Rate limiting per user

Questions to Consider

  • How do you model the social graph efficiently?
  • What's the best approach for feed pagination?
  • How do you handle real-time updates in a REST context?
Your Solution

Social Graph Resources

Design resources for users, relationships, and social connections. Consider follow/follower endpoints, blocking, and privacy controls.