InterviewDigestInterviewDigest

OA Practice Workspace

Technical2026-08-13

Find all the indices in an array where the element is greater than both its immediate neighbours

AI-Expanded — inferred from the question title, not from the original candidate report

Given an array of integers, identify all indices where the element at that position is strictly greater than its immediate left and right neighbors. For the purpose of this problem, assume the elements at indices outside the array boundaries are negative infinity, meaning the first and last elements can be considered peaks if they are greater than their single existing neighbor.

Context & Summary

Online Assessment

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.