InterviewDB Question

Highest Temperatures - Sliding Window Maximum on a Temperature Series

Question Details

Problem Given a list of daily temperature readings and a window size k, return the highest temperature recorded in each consecutive window of k days. Example: Approach Use a monotonic deque. Maintain indices of temperatures in decreasing order. For each new element, pop the back of the deque while it holds smaller values. Pop the front if it slides out of the window. The front always holds the current max. Time: O(n). Space: O(k). Follow-ups How does the deque approach work - walk through the in…

Full Details

🔒

Unlock all C3 AI 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 c3 ai interview during the phone round.

It covers the following topics: Coding, Queue, Phone, Sliding Window .