← Goldman Sachs questions
CodingReported in a candidate post, Sep 2024

Product of the last k integers from a stream

Filed under Goldman Sachs

Design an algorithm that takes a stream of integers and returns the product of the last k integers after each new number, with O(1) time per query expected. Only the approach was discussed. Here the…

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 Goldman Sachs questions

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