Halloween Sale
Unlock all premium questions for over 30% off
Build the Longest Spike Sequence
Medium
Question
We use the word spike for a run of numbers that keeps climbing (each value bigger than the one before) and afterwards keeps dropping (each value smaller than the one before). The peak, the largest value, is shared by the rising part and the falling part. So [3, 8, 9, 4, 1] is a spike, while [2, 4, 4, 9, 1] is not, since its rising part repeats the value 4 and therefore does not go strictly up.
...
Asked at:Microsoft
More Microsoft interview questions
- Lowercase Before Uppercase Letter Countmedium
- Minimum Adjacent Swaps for Ball Groupingmedium
- Valid Clock Time Combinationsmedium
- Office Gift Delivery Schedulerhard
- Recent Search History Systemhard
- Largest Shared BST Valuemedium
- Minimum Coins to Cover All Amountsmedium
- Group Elements by Common Propertiesmedium
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.