Question Details
Problem Given a list of transaction amounts in chronological order, find the longest contiguous subarray where the standard deviation of amounts is at most sigma_max. This represents the longest "stable" trading period. Example: Note: Use population standard deviation (divide by n, not n-1). Approach Brute force O(n^2): for each subarray recompute mean and std. Maintain running sum and sum of squares for O(1) incremental updates: std = sqrt(sum_sq/n - (sum/n)^2). Follow-ups Is a two-pointer / sl…
Full Details
🔒
Unlock all Codesignal questions
Full insider details, leaked discussions, and candidate experiences.
or every company, $100/year →About This Question
This is a reported interview question from a codesignal interview.
It covers the following topics: Q4, Two Pointers, Sliding Window, General Coding Assessment, Coding, Arrays .
More Codesignal Interview Questions
InterviewDB
AI-Assisted Code Review Assessment - Coding Interview
InterviewDB
Array Mutation Operations - Coding Interview
InterviewDB
Array Triplets with Pythagorean Property - Coding Interview
InterviewDB
Banking System Simulation - Industry Coding Framework Interview
InterviewDB
Bubble Popping Game Simulation - Coding Interview