Design a Professional Networking App's Core
Model profiles, two-way connections built from requests, posts with a connections feed, and skill endorsements, then implement the connection flow.
Design the core objects of a professional networking app in the style of LinkedIn, then implement its central flow in code.
For this exercise, assume each user has a profile with a name, a headline, work experience entries and a list of skills. A user sends a connection request to another user, who can accept or decline it; the sender can withdraw it while it is pending.
Connections are two-way: once accepted, both users are connected, and either can remove the connection later. There can be only one pending request between two people, in either direction, and a user cannot connect to themselves.
If A sends a request to B while B already has a pending request to A, the two are connected at once. Users write text posts. A user's feed shows posts from their connections, newest first, ten at a time. A user can endorse a skill on a connection's profile once; endorsements are removed if the connection ends.
Also assume everything runs in one process with in-memory storage. Messaging, job postings, search, company pages, likes and comments, and privacy settings are out of scope.