PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Coinbase

Implement basic pagination for a list

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competence in array indexing, boundary-condition handling, and simple pagination logic, focusing on correct subarray extraction and off-by-one considerations within given size constraints.

  • medium
  • Coinbase
  • Coding & Algorithms
  • Software Engineer

Implement basic pagination for a list

Company: Coinbase

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given: - A zero-indexed array of items `items` (you can assume it fits in memory). - An integer `pageSize > 0`. Design and implement a pagination helper that supports the following operations: 1. Initialize the paginator with the array and `pageSize`. 2. Given a **page number** `pageIndex` (0-based), return the subarray of items that belongs to that page. - Page 0 contains items with indices `[0, pageSize - 1]` (if they exist), - Page 1 contains `[pageSize, 2 * pageSize - 1]`, and so on. 3. If `pageIndex` is out of range (no items on that page), return an empty list. Assume: - `0 <= pageIndex` - `1 <= pageSize <= 10^5` - `0 <= len(items) <= 10^6` Define the interface and implement the core method(s) for pagination. Focus on clean indexing and handling boundary cases correctly.

Quick Answer: This question evaluates a candidate's competence in array indexing, boundary-condition handling, and simple pagination logic, focusing on correct subarray extraction and off-by-one considerations within given size constraints.

Related Interview Questions

  • Implement an In-Memory Database - Coinbase (hard)
  • Implement a Coin-Constrained Jump Strategy - Coinbase (hard)
  • Implement Game Physics and Block Mining - Coinbase (hard)
  • Compute Total Manual Distance - Coinbase (medium)
  • Implement a Flappy Bird Jump Agent - Coinbase
Coinbase logo
Coinbase
Dec 8, 2025, 6:30 PM
Software Engineer
Technical Screen
Coding & Algorithms
12
0

You are given:

  • A zero-indexed array of items items (you can assume it fits in memory).
  • An integer pageSize > 0 .

Design and implement a pagination helper that supports the following operations:

  1. Initialize the paginator with the array and pageSize .
  2. Given a page number pageIndex (0-based), return the subarray of items that belongs to that page.
    • Page 0 contains items with indices [0, pageSize - 1] (if they exist),
    • Page 1 contains [pageSize, 2 * pageSize - 1] , and so on.
  3. If pageIndex is out of range (no items on that page), return an empty list.

Assume:

  • 0 <= pageIndex
  • 1 <= pageSize <= 10^5
  • 0 <= len(items) <= 10^6

Define the interface and implement the core method(s) for pagination. Focus on clean indexing and handling boundary cases correctly.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.