Atidan interview question

Basic coding and how to improve its efficiency