Winter SalePremium questions, over 25% offUnlock all premium questions for over 25% off
Best Window For Target Count
Medium
A log analysis tool searches for the most frequent occurrence of a specific error code within a fixed-size window of log entries. Given an integer array codes, an integer targetIndex (the position of the error code to search for), and an integer windowSize, find the starting index of a contiguous subarray of length windowSize that contains the maximum number of occurrences of codes[targetIndex]. On ties, return the smallest starting index.
Function: bestWindowForTargetCount(codes: list<int>, targetIndex: int, windowSize: int) -> int
...
More Microsoft interview questions
- Digit Replacement Maximizermedium
- Combine N-ary Treeshard
- OA [CodeSignal] Prime Jumpsmedium
- Bounded Repeat Substringmedium
- Non-Adjacent Team Selectionhard
- Rate Limiterhard
- Design Rate Limitermedium
- Object Oriented Design - Notification Servicemedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.