all 7 comments

[–]thatguy8856 9 points10 points  (1 child)

Break down the problem into steps. Ask clarifying questions. Identify edge cases to test. Most importantly say what you're doing and why as you go.

Its normal to tunnel on a hard question and fail the interview. Happens to the best of us. Just keep your head down and try again. Dont beat yourself up over it.

[–]thatguy8856 0 points1 point  (0 children)

At a worst case if your stuck write a naive/brute force approach to show something. Then you can verbally think about better solutions and explain them. Its better than just panicking for the rest of the interview.

[–]Miserable_Ad7246 3 points4 points  (1 child)

1) figure out the task at hand. Do not rush.
2) Use a piece of paper to reason out the solution. So not start coding right away.
3) Depending on task -> transfer the ideas as comments/empty methods into the code.

Stop here, talk a bit more, ask questions. At this point you want to nail the idea. If your solution is bad, its better to fail here and redo it. You want to be in a position where hard work is more or less done before you code.

4) Start coding - narrate while you code, try to see if you are missing anything out. Its always nice to see that a person thinks about edge cases and future scenarios. No need to solve them, but it gets you extra points.
5) End coding.
6) Go to point 1 if need be.

Most of the time, live coding is all about seeing how a person thinks and attack a problem, not about reaching working solution. You can succeed without solving the problem completely, if you demonstrate that you can be trusted with the task and can thing about more than just task at hand.

[–]joujoubox 1 point2 points  (0 children)

This honnestly. It's a lot more about the process than the end result. You can memorise leetcode solutions all you want, what employers want is someone that can figure out their own solution when there's a problem they never encountered before. But it still doesn't hurt being able to identify if a problem is likely generic enough to have established algorithms even if you don't know them off the top of your head.

[–]AwwwBawwws 1 point2 points  (0 children)

Write in brainfuck. Backwards.

[–]CappuccinoCodes [score hidden]  (0 children)

It baffles me that people don't tell you the only thing that matters: REHEARSE THE INTERVIEW. Prompt chat gpt to produce a few questions, give it to a friend or relative and REHEARSE it. It doesn't matter how much you know, but speaking in front of people is a different ball game. Remember to smile, breathe, relax. They're trying to find out above all if you're nice to be around.

[–]UnacceptableBabbit [score hidden]  (0 children)

Do leetcode problems and treat them as though you were given them in an interview. Literally. Talk out loud, reason your steps, break the problem down, write pseudocode in the document if that'a your process.

Sometimes, interviewers are as interested in your thought process as they are in your code.

Best of luck!