← Amazon questions

Next smallest element

Filed under Amazon · Also reported at Goldman Sachs

Given an array of integers, find the next smaller element for each element in the array. For any element that does not have a smaller element to its right, output a default value like -1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.