System design · HLD
Tinder
Functional req
1. User can create profile with preference (age range, interests ) and specify a max distance
2.user can view a stack of potential match
3.user can swipe left/right for a yes or no
4.user gets a match notification if there is a mutual match
Non-functional
1.string consistency on a match , if a user swipe yes for a person already swiped yes, user who swiped just now gets instant notification and then the other user
2.avaiablity for a view of potential match
3.system should be able to handle 20M DAU and ~100 swipes per user per day
4load the potential match with low latency (<200ms)
5avoid showing repeated users , that has been already swiped previously
Enties
User- profile with preferences and max distance
Swipe - expression of yes or no , for user swiping for a target user (directional)
Match - store the users which are matched (bi-directional)
Api
// create a profile
POST /profile -> userID
{
"Name" : "" ,
"Age" : "" ….
"minage " :
"maxAge" :
"interset" :
"Distance" :
}
//view stack
GET /feed ? lat={}&long={}&distance={} -> User[]
//swipe right left
POST /swipe/{userID}
{decision : "Yes" || "NO" }
https://claude.ai/public/artifacts/0ec553ce-160a-4fe6-ac50-71e6af9b9330