Virtusa interview question

Can you explain a time when you had to solve a complex problem in code, and how you approached debugging and optimization?