Exercise - Practice questions

Completed

In this exercise, we'll look at how to answer questions. By practicing how you answer, you learn to structure your thoughts and will hopefully be perceived in a favorable way.

Set a time for practice

Practice makes perfect. You improve through repetition. Schedule time each day before your interview to practice some questions in front of a mirror or with a friend.

For example, decide to practice interview questions each day between 3:00 PM and 4:00 PM.

Select your topic

There are many types of questions that you can practice. For example:

  • Code questions about algorithm or architecture
  • Questions about how you would act in a certain situation

Take an example of some code you've written and challenge yourself to explain it verbally in five minutes.

For example, take a parser for a calculator and explain what the task was, what the challenges were, and how you approached those challenges.

Structure your answer

It's a challenge to be clear and to the point. To practice clarity, use a structure where you identify key points that you want to make and the order in which you want to make them.

Practice structuring your explanation minute by minute. Select a problem and use the following template to describe it:

  • Here's the problem that this code is designed to solve.
  • Here's how I went about deciding how to build it.
  • Here's a challenge I faced when building it.
  • Here's how I solved the challenge.
  • Here's what I learned by completing this code.

Here's an example output:

The problem: The task was about designing a calculator. The input is taken from the command line. First I needed to find out if there were any considerations like what operators it should support and how the input happens, if numbers and operators are input separately.

Answer: Input is in the form of an expression 1 + 1

How I decided: I started by writing a test. The test would help me verify when the code would eventually work but would also help me consider edge cases.

Knowing the input was an expression meant that I needed to divide the expression into tokens, numbers, and operators. Then I needed to encode in which order operators should be applied to solve an expression like 2 * (3+2). Finally, I needed to perform the calculation.

Challenge: The challenge was in realizing how to parse the tokens, selecting a data structure to store the expression and then computing the expression.

How I solved it: I decided on a binary tree as data structure with the operators as top nodes and the values as leaves. Then I could compute the expression via recursion.

What I learned: I learned the importance of always starting with a test and gradually building out the test suite with happy paths and edge cases. I also learned that selecting an appropriate data structure is key to solving the problem in a straightforward way.

Pay attention to your body language

Another important part of communication is body language. How you say things and what your inflections are can make a big difference in how you're perceived.

Challenge yourself to observe your body language as you speak. Try to ensure that you always look confident in your answers.

Pay attention to whether you're sitting or standing with a straight back. Don't have hands in your pockets. Look the interviewers in the eyes.