Object-oriented design interview questionMedium

Design a Social Networking Platform

Design a social networking domain model covering users and profiles, friendship requests and symmetric friendships, and posts with a visibility setting, comments, and reactions — enforcing symmetric friendship, unique requests, author ownership, and visibility-based read authorization.

1. Problem Statement

Design a social networking platform: users become friends via a request-and-accept handshake, and publish posts that are visible to the public, only to friends, or only to themselves, and that others can comment on and react to according to that visibility. Start by clarifying scope and the core objects.

2. Live Coding Format

Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.

3. Key Focus Areas

  • 1
    Friend request handshake and symmetric friend graph
  • 2
    Unique pending request per pair and no self-friend
  • 3
    Post visibility and read authorization
  • 4
    Author ownership, comments, and per-user reactions

4. What Strong Candidates Should Demonstrate

  • Model users, symmetric friendships, and a request handshake with correct authorization.
  • Enforce post visibility (PUBLIC/FRIENDS/ONLY_ME) for reads, comments, and reactions.
  • Enforce author-only post mutation and one-reaction-per-user semantics.
  • Separate the social graph and content model from feed generation.

Want interactive feedback?

Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.

Continue to Dashboard

Core Concepts

Hidden because they name the technique, which a real interviewer would not tell you.

Show core concepts
Object-Oriented DesignGraph ModelingAuthorizationAccess Control

Continue preparing

Build a complete software engineer mock interview plan

Related Object-Oriented Design

Design a Vending Machine Controller

Design a vending machine that manages inventory, accepts money, supports product selection and cancellation, returns change, and enforces a clear transaction state machine.

Related Object-Oriented Design

Design an Expense Management System

Model the core domain objects, state transitions, approval policies, and audit history for an employee expense management system.

Related Object-Oriented Design

Design a Role-Based Password Validator

Design an extensible validator that applies different password policies to regular users, administrators, and super administrators, handles Unicode input, and rejects passwords on a forbidden or breached-password list.

Related Object-Oriented Design

Design a Rare Book Condition Management System

Model the core domain objects for tracking physical condition assessments of rare library books, with immutable scan history and structured condition report generation.