Ask for clarifications on user input, constaints….etc
Discuss multiple approaches and trade-offs (i.e discussed a brute force solution and its time complexity as well as an improvement and the new time complexity and provably another sub-optimal approach)
Agree on one of the approaches above before you started coding? Did you get the buy-in of your interviewer?
Once you started coding, did you communicate often saying what each line is doing?
Did you do a dry run of your code? Like using a test case and updating the variables as you go like you would with a debugger?