PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Coinbase

Implement Plus One

Last updated: Apr 2, 2026

Quick Overview

This question evaluates proficiency in array manipulation, elementary arithmetic operations such as carry propagation, and careful handling of edge cases while meeting time and space complexity constraints.

  • medium
  • Coinbase
  • Coding & Algorithms
  • Data Scientist

Implement Plus One

Company: Coinbase

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Given an integer represented as an array of digits `digits`, where the most significant digit comes first, return the array representing the integer plus one. Assume: - `digits` contains only values from `0` to `9` - the integer has no leading zeros unless it is exactly zero Examples: - `[1, 2, 3] -> [1, 2, 4]` - `[4, 3, 2, 1] -> [4, 3, 2, 2]` - `[9, 9, 9] -> [1, 0, 0, 0]` Implement the solution in Python. Aim for `O(n)` time and `O(1)` extra space apart from the returned array.

Quick Answer: This question evaluates proficiency in array manipulation, elementary arithmetic operations such as carry propagation, and careful handling of edge cases while meeting time and space complexity 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
Mar 17, 2026, 12:00 AM
Data Scientist
Onsite
Coding & Algorithms
2
0
Loading...

Given an integer represented as an array of digits digits, where the most significant digit comes first, return the array representing the integer plus one.

Assume:

  • digits contains only values from 0 to 9
  • the integer has no leading zeros unless it is exactly zero

Examples:

  • [1, 2, 3] -> [1, 2, 4]
  • [4, 3, 2, 1] -> [4, 3, 2, 2]
  • [9, 9, 9] -> [1, 0, 0, 0]

Implement the solution in Python. Aim for O(n) time and O(1) extra space apart from the returned array.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Coinbase•More Data Scientist•Coinbase Data Scientist•Coinbase Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ 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.