Design a Social Feed Read API
Define reader-bound feed-page methods and typed results that preserve one stable traversal across changes and failures.
For this exercise, assume authenticated readers use a social application whose existing authority owns users, follow relationships and immutable text posts. A reader opens a feed containing their own posts and posts from the users they currently follow, ordered by descending unique server creation sequence.
They then request continuation pages. Every traversal uses one captured eligible-post set and sequence boundary; later posts or follow changes appear only in a new traversal. A returned page is an immutable value with post ID, author ID, text, creation sequence and an optional opaque continuation.
Repeating a valid continuation returns the same page.
For this exercise, use a page size from 1 through 20 and at most 1,000 eligible posts in a captured traversal. A larger eligible set returns an explicit too-large outcome rather than silent truncation. IDs are opaque ASCII values of at most 64 bytes and each text post is at most 2 KiB of UTF-8.
A traversal expires five minutes after it is opened. A continuation is bound to its authenticated reader, traversal and position; a caller cannot change those values. Invalid or expired continuation, unauthorized or unknown reader, unavailable authority or missing retained traversal have explicit outcomes.
Unavailable data is never represented as a successful empty page. An exhausted successful traversal returns an empty page with no continuation.
Design cohesive responsibilities, method definitions, immutable response values and interactions. Do not implement the methods or design a distributed backend. Publishing posts, changing follows, ranking customization, likes, comments, media, persistence architecture and push delivery are outside this exercise.
Explain how the read boundary and retained state can meet the contract, and what the API reports when that evidence cannot be established.
All operations, ordering, snapshot, bounds and failure policies above are declared practice choices; the report supplied only a social-feed API design task with method definitions and returned results, explicitly without coding.