Amazon interview question

To build a efficient keypad.