Amazon interview question

Had a question on dictionary