PrepZone Logo
PrepZone

Pagination and Filtering APIs

Offset, cursor, and filter design for list endpoints.

Why this matters

  • Offset pagination — detailed pointwise breakdown in the section below.
  • Cursor pagination — detailed pointwise breakdown in the section below.
  • Filters — detailed pointwise breakdown in the section below.
  • PaginatedResult type — detailed pointwise breakdown in the section below.
  • Production Java structure interviewers expect in backend LLD.
Dependency direction
Controller / FacadeHTTP or API entry
Serviceuse cases, orchestration
Domainentities, rules, invariants
Repositorypersistence port
Dependencies point inward — domain never imports infrastructure.

Overview

Offset, cursor, and filter design for list endpoints. Study each section below in order — every list is interview-ready reference material.

Offset pagination

Points to cover

  • Definition — what Offset pagination means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

Cursor pagination

Points to cover

  • Definition — what Cursor pagination means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

Filters

Points to cover

  • Definition — what Filters means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

PaginatedResult type

Points to cover

  • Definition — what PaginatedResult type means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design
Java
// CampusOS — apply "Offset pagination" on paper first, then in code
public final class ApiPaginationFilteringExample {
    // 1. Name entities from the problem statement
    // 2. Draw relationships before writing methods
    // 3. Introduce patterns only when a force appears
}

Quick recall

Everything you need if you only revisit this box.

  1. Offset pagination — review this slice before mock interviews.
  2. Cursor pagination — review this slice before mock interviews.
  3. Filters — review this slice before mock interviews.
  4. PaginatedResult type — review this slice before mock interviews.

Test yourself

Answer these before moving on — recall is what makes it stick.