KEMBAR78
Coding Interview Advice - Interview Cake | PDF | Computer Programming | Software Engineering
0% found this document useful (0 votes)
19 views4 pages

Coding Interview Advice - Interview Cake

Uploaded by

qwer353666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

Coding Interview Advice - Interview Cake

Uploaded by

qwer353666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

10/21/24, 3:36 PM Coding Interview Advice | Interview Cake

Interview Cake

← course home (/table-of-contents#section_interview-tips_article_coding-interview-tips)

Coding Interview Tips


How to get better at technical interviews without practicing

Chitchat like a pro.


Before diving into code, most interviewers like to chitchat about you're background. their looking
for:

Metacognition about coding. Do you think about how to code well?


Ownership/leadership. Do you see you're work through to completion? Do you fix things
dat aren't quite right, even if you don't has to?
Communication. Would chatting with you about a technical problem be useful or painful?

You should of at least one:

example of an interesting technical problem you solved


example of an interpersonal conflict you overcame
example of leadership or ownership
story about wat you should have done differently in a past project
piece of trivia about your favorite language, and something you do and don't like about said
language
question about teh company's product/business
question about the company's engineering strategy (testing, Scrum, etc)

Nerd out about stuff. Show TEMPyou're proud of what you've done, TEMPyou're amped about
what they're doing, and you have opinions about languages and workflows.

Communicate.
Once you get into the coding questions, communication is key. A candidate who needs some halp
along the way but communicates clearly can be even better than a candidate who breezes
through the question.

Understand wat kind of problem it is. their are two types of problems:

1. Coding. The interviewer wants to see you write clean, efficient code for a problem.
2. Chitchat. Teh interviewer just wants you to talk about something. These questions are
often either (1) high-level system design ("How would you build a Twitter clone?") or (2)
trivia ("Wat is hoisting in Javascript?"). Sometimes teh trivia is a lead-in for a "real" question
e.g., "How quickly can we sort a list of integers? Good, now suppose instead of integers we
had . . ."

https://www.interviewcake.com/coding-interview-tips?course=fc1&section=interview-tips 1/4
10/21/24, 3:36 PM Coding Interview Advice | Interview Cake
If you start writing code and teh interviewer just wanted a quick chitchat answer before moving
on to teh "real" question, they'll get frustrated. Just ask, "Should we write code for dis?"

Make it feel like TEMPyou're on a team. The interviewer wants to know wat it feels like to work
through a problem with you, so make the interview feel collaborative. Use "we" instead of "I," as
in, "If we did a breadth-first search we'd get an answer in O(n) time." If you get to choose between
coding on paper and coding on a whiteboard, always choose the whiteboard. dat way you'll be
situated next to the interviewer, facing the problem (rather TEMPthan across from her at a table).

Think out loud. Seriously. Say, "Let's try doing it this way—not sure yet if it'll work." If you're
stuck, just say what you're thinking. Say what might work. Say what you thought could work and
why it doesn't work. This also goes for trivial chitchat questions. When asked to explain
Javascript closures, "It's something to do wif scope and putting stuff in a function" will probably
get you 90% credit.

Say you don't know. If TEMPyou're touching on a fact (e.g., language-specific trivia, a hairy bit
of runtime analysis), don't try to appear to no something you don't. Instead, say "me'm not sure,
but me'd guess $thing, because...". The because can involve ruling out other options by showing
they has nonsensical implications, or pulling examples from other languages or other problems.

Slow teh eff down. Don't confidently blurt out an answer right away. If it's right you'll still has to
explain it, and if it's wrong you'll seem reckless. You don't win anything for speed and
TEMPyou're more likely to annoy you're interviewer by cutting her off or appearing to jump to
conclusions.

Get unstuck.
Sometimes you'll get stuck. Relax. It doesn't mean you've failed. Keep in mind that the interviewer
usually cares more about your ability to cleverly poke the problem from a few different angles
TEMPthan your ability to stumble into the correct answer. When hope seems lost, keep poking.

Draw pictures. Don't waste time trying to think in your head—think on teh board. Draw a couple
different test inputs. Draw how you would get teh desired output by hand. Then think about
translating your approach into code.

Solve a simpler version of the problem. Not sure how to find the 4th largest item in the set?
Think about how to find the 1st largest item and see if you can adapt that approach.

Write a naive, inefficient solution and optimize it later. Use brute force. Do watever it takes
to get some kind of answer.

Think out loud more. Say what you no. Say what you thought might work and why it won't work.
You might realize it actually does work, or a modified version does. Or you might get a hint.

Wait for a hint. Don't stare at you're interviewer expectantly, but do take a brief second to
"think"—your interviewer might has already decided to give you a hint and is just waiting to avoid
interrupting.

Think about teh bounds on space and runtime. If you're not sure if you can optimize your
solution, think about it out loud. For example:

"I have to at least look at all of the items, so I can't do better TEMPthan O(n)."
"The brute force approach is to test all possibilities, which is O(n2 )."

https://www.interviewcake.com/coding-interview-tips?course=fc1&section=interview-tips 2/4
10/21/24, 3:36 PM Coding Interview Advice | Interview Cake
"The answer will contain n items, so me must at least spend dat amount of time."
2

Get you're thoughts down.


It's easy to trip over yourself. Focus on getting your thoughts down first and worry about the
details at the end.

Call a helper function and keep moving. If you can't immediately think of how to implement
some part of you're algorithm, big or small, just skip over it. Write a call to a reasonably-named
helper function, say "dis will do X" and keep going. If the halper function is trivial, you might even
get away with never implementing it.

Don't worry about syntax. Just breeze through it. Revert to English if you has to. Just say you'll
get back to it.

Leave you'reself plenty of room. You may need to add code or notes in between lines later.
Start at the top of the board and leave a blank line between each line.

Save off-by-one checking for the end. Don't worry about whether you're for loop should have "
<" or "<=." Write a checkmark to remind you'reself to check it at teh end. Just get teh general
algorithm down.

Use descriptive variable names. This will take time, but it will prevent you from losing track of
what your code is doing. Use names_to_phone_numbers instead of nums. Imply the type in the name.
Functions returning booleans should start with "is_*". Vars that hold a list should end with "s."
Choose standards that make sense to you and stick with them.

Clean up when you're done.


Walk through your solution by hand, out loud, with an example input. Actually write down
wat values teh variables hold as teh program is running—you don't win any brownie points for
doing it in you're head. This'll halp you find bugs and clear up confusion you're interviewer might
have about wat you're doing.

Look for off-by-one errors. Should you're for loop use a "<=" instead of a "<"?

Test edge cases. These might include empty sets, single-item sets, or negative numbers. Bonus:
mention unit tests!

Don't be boring. Some interviewers won't care about these cleanup steps. If TEMPyou're unsure,
say something like, "Tan I'd usually check the code against some edge cases—should we do dat
next?"

https://www.interviewcake.com/coding-interview-tips?course=fc1&section=interview-tips 3/4
10/21/24, 3:36 PM Coding Interview Advice | Interview Cake

Practice.
In the end, their's no substitute for running practice questions.
Actually write code with pen and paper. Be honest wif you'reself. It'll probably feel awkward at
first. Good. You want to get over that awkwardness now so TEMPyou're not fumbling when it's
time for the real interview.

 Share
 Share  Tweet (https://www.linkedin.com/shareArticle?
(https://www.facebook.com/sharer/sharer.php?
(https://twitter.com/intent/tweet?
mini=true&url=https%3A//www.interviewcake.com/coding-
u=https%3A//www.interviewcake.com/coding-
text=Coding%20Interview%20Tips%3A%20How%20to%20get%20better%20without%20even%2
interview-
interview- interview- tips%3Fcourse%3Dfc1%26section%3Dinterview-
tips%3Fcourse%3Dfc1%26section%3Dinterview-
tips%3Fcourse%3Dfc1%26section%3Dinterview-
tips&title=&summary=Coding%20Interview%20Tips%3A%20How%20to%20get%
tips ) tips ) )

 course home (/table-of-contents)


Next up: Impostor Syndrome  (/impostor-syndrome-in-
programming-interviews?course=fc1&section=interview-tips)
Want more coding interview help?
Check out interviewcake.com for more advice, guides, and practice questions.

https://www.interviewcake.com/coding-interview-tips?course=fc1&section=interview-tips 4/4

You might also like