Workday interview question

Tell me about a situation when your code failed and what did you do to code it right?