← Amazon questions

Sort an array according to the order defined by another array

Filed under Amazon · Also reported at MetLife

Sort elements of a target array based on the relative ordering of elements specified in a reference array. Elements not present in the reference array should be sorted in ascending order at the end of…

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.