Ansoft interview question

Programming algorithm