Fall SalePremium questions, over 25% offUnlock all premium questions for over 25% 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
- Office Gift Delivery Schedulerhard
- Group Elements by Common Propertiesmedium
- Largest Shared BST Valuemedium
- Minimum Coins to Cover All Amountsmedium
- Recent Search History Systemhard
- Count Distinct Elements in Each Windoweasy
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.