Match a job Paths Subjects Questions Quizzes Pricing
Overview Read Practice

Practice — API Design & Service Communication (6 questions)

Pro content

Sign up free, then start a 14-day Pro trial — no card needed.

Intermediate Open Free

Paginating a 200M-Row Activity Feed Permalink →

A social app exposes GET /users/{id}/feed backed by a Postgres table feed_items(id BIGSERIAL, user_id, created_at, payload) with ~200M rows. Today it uses ?page=N&size=50 (offset pagination). Users report that when they scroll during busy periods they sometimes see the same post twice, and the p99 latency of deep pages (page 400+) is over 2 s.

  1. Explain both symptoms mechanically — why duplicates appear and why deep pages are slow.
  2. Redesign the endpoint using cursor pagination: specify the query parameters, what the cursor encodes, the SQL the server runs, and the index it needs.
  3. What do you lose by switching, and when would you keep offset pagination anyway?

Share this question

Intermediate Open Pro

Making POST /payments Safe to Retry

Unlock this question →
Intermediate Open Pro

Choosing a Real-Time Transport

Unlock this question →
Intermediate Open Pro

REST, gRPC or GraphQL for a New Platform

Unlock this question →
Intermediate Open Pro

Building a Robust Webhook Consumer

Unlock this question →
Intermediate Open Free

A Billion Requests a Day Is How Many Per Second Permalink →

Your API serves 1 billion requests per day.

What's the average requests-per-second — and what number should you actually design for?

Show the conversion, and finish the sizing: how many app servers is that, roughly?

Share this question

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.