Communication
Treat the interview as a collaborative problem solving exercise and work with your interviewer as a partner.
Think out loud
Yes, this is unnatural, but it’s another skill that you need to practice.
Your interviewer wants you to succeed and will have several hints prepared in case you get stuck. Make sure they know what you are thinking at all times so they can give you a hint as early as possible. Treat it like a brainstorming or problem solving exercise with a coworker.
It’s not a quiz where all that matters is getting the right answer at the end. The way you analyze a problem is equally as important.
Pay attention to everything your interviewer says
The one difference between problem solving with a coworker and problem solving during an interview is that your interviewer knows the right answer. This means everything they say will be relevant.
If they ask questions, they are most likely pointing out a flaw or trying to lead you in the right direction.
If they make a suggestion, listen. I’ve flat out said “try using a hashmap” to a candidate who told me it wasn’t going to work.
Ask questions
Many problems are deliberately phrased ambiguously to test the candidate. Ask for clarification on inputs or other conditions, even if it’s just to verify assumptions you think are safe.
Also, don’t be afraid to ask your interviewer for help. Ask if you’re on the right track, ask if your solution sounds good, ask if there’s any issues with starting to code, etc.
If you were at work, you would be expected to reach out to unblock yourself instead of struggling on your own. Bring that mindset into the interview.
Hints are normal
I’ve given my interview questions to candidates of all levels and I almost always give at least one hint to help them find the answer.
In fact, I deliberately chose my main problem because it’s difficult enough that most candidates do get stuck.
Software engineering is full of tough problems with no obvious solutions. I want to see how candidates handle this situation, how they are able to analyze a problem, and most of all, how well they work with others to build towards a solution.
Feedback and collaboration are crucial parts of software development. If a candidate ignores hints or reacts in a hostile manner (surprisingly common), it makes me concerned about how they would react to feedback in a work environment.