← Amazon questions

Match Keys and Locks

Filed under Amazon

Given N distinct keys and N distinct locks of varying sizes, design an algorithm to pair each key with its corresponding lock. You can only compare a key with a lock to see if it is smaller, larger…

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.