Make a data model
Make data model with a complexity in O(result).
Data :
- User
- Name
- ImageUrl
- Description
- Statistics (Number of followers/follows/posts)
- Post
- ImageUrl
- Description
- Statistics (Number of likes)
User have a list of posts, a list of followers, a timeline (list of follows's posts). Post have a user.
Supported requests :
- List of follows's posts in DESC Timestamp (newer to older)
- List of posts liked by the user
- List of followers
- List of follows
- List of user's posts
- User's information
- Update a post
- Update a user
- Like/Unlike a post
- Follow/Unfollow a person
- Search a person
Don't forget to manage contention