InterviewDigestInterviewDigest

OA Practice Workspace

Online Assessment2026-08-17

Stack-based problem (modified Stock Span)

AI-Expanded — inferred from the question title, not from the original candidate report

Given an array of integers representing daily stock prices, calculate the "span" for each day, defined as the maximum number of consecutive days immediately preceding the current day for which the price was less than or equal to the current day's price. Implement an efficient solution using a monotonic stack to ensure the time complexity is linear, O(n), rather than the naive quadratic approach.

Context & Summary

First round consisted of multiple-choice questions and coding problems for shortlisting candidates.

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.