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?