Implement basic pagination for a list
Company: Coinbase
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
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.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([1,2,3,4,5], 2, 0)
Expected Output: [1, 2]
Explanation: First page.
Input: ([1,2,3,4,5], 2, 2)
Expected Output: [5]
Explanation: Partial final page.
Input: ([1,2], 2, 3)
Expected Output: []
Explanation: Out of range.
Hints
- Use deterministic tie-breaking for prompts with multiple valid outputs.
- For design-style APIs, simulate operations with explicit inputs.