Longest Turbulent Subarray shows up often in coding rounds. Here is how I talk through it when the interviewer is watching.
Scan comparing sign flips of adjacent differences; reset when the comparison is not opposite.
O(n).
Treating equals as a valid flip.
Time yourself: two minutes to explain, ten to code, three to test edges. Disclosure: I work on Linkjob AI. I also keep a practice cheat sheet at Linkjob.