Social Feed
Design the data and logic of a tiny social network with users, posts, comments and likes.
Project 8Advanced
๐งฉ Problem statement
Design the data and logic of a tiny social network with users, posts, comments and likes. Design it completely in pseudocode first: plan the data, split the work into functions, write the logic, dry-run it and test it.
๐ Requirements
- Users
- Posts
- Comments
- Likes
- A feed sorted by newest
๐ฅ Inputs
- Actions by users
๐ค Outputs
- Each user's feed
๐ Rules
- A user can like a post only once
๐ง Constraints
- Feed shows at most 20 posts
๐งญ Suggested approach
- Restate the problem in your own words
- List the data you must remember (variables, lists, maps)
- Write one FUNCTION per feature
- Write the main program that calls them
- Dry-run with the Run button
- Test normal cases and edge cases
๐ง Required concepts
- Data structures
- Algorithms
- Complexity
โ๏ธ Pseudocode editor ยท dry-run tool ยท test cases
Design your solution here. Use Run to dry-run it step by step. Hints unlock one at a time โ try on your own first!
๐งช Edge cases to test
- Empty input
- Very large values
- Repeated or duplicate entries
๐ Challenge extensions
- Add a feature of your own
- Make it work for 10ร more data โ what changes?