โ† Amazon questions

Sort first array according to second array

Filed under Amazon

Given two arrays, sort the first array such that the relative order of elements follows the order in the second array. Elements not in the second array should be appended at the end in sorted order.

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.