Imprivata interview question

LC problems, basic to medium level