Do you guys write commented code during coding interviews?
Commented code isn't clean code
Comment the current values of variables as you go. Living debugging
Clean code yes. Code with comments no. If you have to write comments you're not writing good highly-readable code.
Word
Very much no.
I only write clean comments, no code. Now you know why I haven't gotten into FAANG yet.
Lol
Depends. If it’s on a whiteboard, no. If it’s on a coderpad, especially over phone/VC, then yes. It helps the interviewer follow along.
It's an interview, the interviewer is trying to gather data points on you, do you really want them to guess if they don't understand everything right away, and have that decide whether you're hired or not? When a candidate has his code in well arranged blocks, with high level summary comments telling me what he's doing, that makes it easier to follow and analyze what he's thinking/his logical process for me as an interviewer. Then I can bring that up at the debrief as a strength for cleanliness, maintainability and organizational skills which gives him way better odds of being hired, whether or not his code was perfect or even correct.
I write comments and replace them with code