← Google questions
CodingReported in a candidate post, Jun 2021

1-D array Dynamic Programming with space optimization

Filed under Google

Given a 1-D array of numbers, solve a dynamic programming problem to find an optimal subsegment or value, and optimize the space complexity from O(n) to O(1) where applicable.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Google questions

Collected from public candidate posts and coding forums. Updated Nov 2026.