CCA Skills Series: Day 3 - Technical Interview Day
Published by: Daniel Liu
Source: CCA - Fumi in a technical Interview
Image by Vania Sanusi
Introduction:
Following Fumi’s gruelling and exhausting behavioural interview, Fumi receives a call from the recruiter and ... Fumi’s made it through! Alas, Fumi must face one last hurdle, the dreaded live technical interview that seeks to differentiate purely cultural-fit candidates from those possessing the whole package, socially and technically. Technical interviews at the intern/graduate level are not supposed to be a cakewalk and often test a candidate’s problem-solving abilities through coding challenges, system design questions or domain-specific case studies.
Fumi recalls a quote from reading cracking the coding interview: “Practise, practise, practise. The more you code and solve problems, the better you’ll become at technical interviews”. Fumi begins to feel an urge to code, but the question now becomes, how do you practise in a way that best replicates the real interview environment?
Technical Interview Approach:
Before Fumi can begin practising, Fumi must first understand some generally accepted steps for navigating a technical interview that enables the interviewer (usually an engineer) to better understand Fumi’s approach. After all, what is it worth producing the correct solution if no one understands your methodology?
Let us imagine Fumi and Michael (the interviewer) have introduced themselves to one another on Zoom and Michael has asked Fumi to open any code/text editor and solve the following problem “Given an integer n, for every positive integer, the task it to print ‘FizzBuzz’ if i is divisible by 3 and 5, print ‘Fizz’ if i is divisible by 3, print ‘Buzz’ if i is divisible by 5 and print ‘i’ as a string if none of the aforementioned conditions are true”.
Step 1: Take down notes.
Purely an optional step, but taking down notes while the interviewer explains the question can offer a better understanding and avoid having to be reminded of certain components of the question, which can happen during a time-stricken and often stressful technical interview. What notes you decide to take down is completely up to you, but I would highly recommend summarising the main requirements of the task or rewording the question in a way that makes sense to you through comments at the top of the code editor, enabling easy access as you write up a solution.
For Fumi’s problem, it may be worthwhile to note the following:
```
// For positive integers, FizzBuzz = 3 & 5, Fizz = 3, Buzz = 5, i = other (print ... = if divisible by ...)
```
Step 2: Clarify your understanding of the question.
Now comes an extremely important step that could dictate your whole interview: clarifying and probing the problem. Firstly, it would be a good idea to recite the question back in a way that makes sense to you, ensuring everyone is on the same page during the interview. You can think of technical interviews like a straight line; you keep moving along the line, and if you get off track, the interviewer is there to help pull you back on track. The interview is there to help you, so do not be afraid to ask questions.
In Fumi’s case, it may look something like this:
“Can you confirm that if the input is a multiple of 3, print fizz, if multiple of 5, print buzz, if multiple of 15, print fizzbuzz and otherwise, print the number itself?”
Step 3: Clarify assumptions.
Next, it is important to begin probing the problem and asking questions you may have around assumptions about the input (such as whether it is sorted), edge-cases (such as handling nulls), time complexity and whatever else you may find relevant to the question. The idea is to think about what you are currently assuming about the problem or solution and have it clarified so that you do not run into avoidable mistakes after you have implemented the solution.
For Fumi’s problem, it may look something like this:
“I have a few clarification questions. Firstly, you mentioned the expected output for positive integers, but what should I output when n is 0 or a non-positive integer? Secondly, is there a specific output format that is required with spacing or capitalisation? Finally, can you clarify whether this problem is inclusive or exclusive of the numbers you provided?”
These clarification questions are essential for accentuating a candidate’s critical thinking, showing initiative to identify potential challenges or ambiguities and communication skills by clearly presenting thoughts as opposed to rushing into an implementation.
Step 4: Walk through an example input.
Once you have a sense of the problem and have clarified any lingering assumptions, walk through an example test case, which will help ensure you are on the right track. From cracking the coding interview, “Use examples and test cases to validate your solutions. This can help catch errors and ensure your code works as intended.” For Fumi’s problem, it may look something like:
```
Can I confirm that if the input number was 15, it would print “FizzBuzz” since it is divisible by both 3 and 5, but if the input number was 20, it would only print “Buzz” since it is divisible by only 5?
```
Step 5: Walk through a rough solution.
Now, give yourself some time to think through a rough, step-by-step solution and obtain confirmation that your approach is viable. One of the worst things you could do during a technical interview is to waste precious time on implementing your solution, just to realise your approach was wrong all along. Remember, the interviewer is more than just an assessor; think of them as your pair programming partner who does not have any fingers to type the solution themselves. It is highly recommended that you write down some pseudocode to make your solution clearer and to be able to refer back to the pseudocode throughout your implementation.
For Fumi’s problem, it may look something like this:
```
I think I am going to go about solving the problem in this manner:
· Firstly, if a number is divisible by both 3 and 5, print “FizzBuzz” to printing “Fizz” or “Buzz” since being divisible by both 3 and 5 implies they must also be divisible by 3 or 5.
· Secondly, if a number is divisible by 3, print “Fizz”.
· Thirdly, if a number is divisible by 5, print “Buzz”.
· Otherwise, print the number itself as a string.
Does this seem correct, and if so, can I start coding now?
```
Step 6: Implement your solution in code.
Implementing your solution is simple enough, especially after you have gone through the effort of ensuring your approach is correct through the previous steps. However, what can be difficult is explaining your thought process as you bring your solution to life through code. Will you pass the technical interview by coding your solution in silence? Never.
It is extremely important to offer an insight into your thoughts at every stage of the implementation, whether it be explaining why you are using a particular complex function or the logic behind your code, annunciate what you are thinking as you code. For most, this feels completely unnatural at first and requires a conscious effort to pronounce every step of your solution in its entirety. However, with enough practice, you will start to get the hang of it.
One aspect that interviewees are often confused about is when to annunciate your thoughts. Of course, it is not expected that you will be communicating 100% of the time, but should you explain your thinking before, during or after you implement a part of your solution? The truth is, do whatever you are most comfortable with. Good interviewers should understand the stress that comes along with undertaking an interview and will respect that everyone goes about explaining their code in different ways. The key is to actually explain your thinking for the different steps of your implementation.
For Fumi’s problem, a portion of the explanation might come before implementing the code:
```
Fumi: Firstly, I will consider the case where the input is divisible by both 3 and 5, printing FizzBuzz as per the requirements.
Implementation (in Python):
# Check if i is divisible by both 3 and 5
if i % 3 == 0 and i % 5 == 0:
print(“FizzBuzz”)
```
One way of ensuring your overall implementation will work is through iteratively testing your code as you write it. It is much easier to find issues as you go than to write out a 50-line solution, only to realise that there exists a bug somewhere.
Step 7: Check your code and wrap-up.
After you have implemented your solution in its entirety, you should quickly read through it, make sure the logic makes sense and identify potential mistakes. Then, write out a few test cases, especially ones that cover potential edge cases and execute your code, using the test cases to ensure your solution is viable. Testing your code demonstrates reliability, problem-solving skills and adherence to best practices. Finally, if time permits, either implement or explain potential changes that could make your solution more efficient or readable (such as with naming variables).
Step x: What happens if your code does not work?
It is quite common to have moments where you are unsure of the required logic or have no clue how to implement a certain part of your solution. Uncertainties are completely fine and in fact, can demonstrate your ability to work collaboratively with the interviewer in coming up with something that meets the requirements of the question.
Interviewers are often trained to understand when an interviewee is stuck and will provide increasingly larger hints that should guide the interviewee on the right path. If not, it is generally acceptable to simply ask for a hint after you have given your problem some thought and are certain you need a hint to continue. It is better to have used a hint to come up with a working solution than to leave the problem unsolved.
Technical Interview Preparation:
What types of questions can you expect during the technical interview?
Now that Fumi has a grasp on how to apply themselves during a technical interview, Fumi must prepare for the interview itself. The question now becomes, how can Fumi prepare for a technical interview?
Truth be told, different companies will likely present different questions during their technical interview. However, you will find that the generally accepted approach to answering such questions in these technical interviews will be very similar to what Fumi just learnt. The following details two types of technical interview formats that are common at an intern/graduate level:
1. DSA: Solving algorithmic problems involving data structures and algorithms, which are the types of questions often offered on the Leetcode platform. These interviews are typical of software engineering, software development, infrastructure and machine learning engineering interviews.
2. Data Wrangling/SQL: Retrieving the required data through either Python, R or SQL and potentially producing informative visualisations which can be found on the HackerRank platform. These interviews are typical of data science and analytics interviews.
How can you prepare for these questions using the aforementioned platforms?
The best way to prepare is to perform mock technical interviews with friends or colleagues. Challenge one another to solve questions from Leetcode and HackerRank under timed conditions and offer one another advice on where to improve. Identify whether your friend or colleague is fleshing out their solution using the seven steps offered above, and let them know your honest thoughts. The more practise you have, the better prepared you will be for the real technical interview.
General Tips:
Will you have to do a technical interview in the first place?
It is important to note that a large majority of companies in Australia will not make their candidates undertake a technical interview at the intern/graduate level. The types of companies that will certainly require technical interviews at an intern/graduate level are:
1. Technology Companies: These are software companies whose main focus is in building software products for their customers. Think Canva, Atlassian, Google, Amazon and Microsoft.
2. HFT companies: These are trading companies that rely heavily on technical innovation for trading and analytics. Think Jane Street, Optiver, Citadel, IMC and Akuna Capital.
It is evident that whether you will be required to undertake a technical interview entirely depends on the company you interview with. Consider your future career aspirations and take that into account when deciding whether you will need to prepare for a technical interview. For example, those looking to get into consultancies will almost certainly never undertake a technical interview.
Can I use generative AI?
It is best practice to avoid using any forms of generative AI (ChatGPT, Gemini etc) during the interview. Interviewers want to know that you can think for yourself and find solutions without prompting AI. If you are ever stuck on how to approach the question, seek clarification from your interviewer in the form of a rephrasing of the question or hints. If you ever forget a particular function or library that is necessary to implement your solution, ask to search for online documentation. Interviewers understand and respect that no one remembers everything and will not look unfavourably on interviewees who search for online documentation.
Manage your time well.
Remember that the interview will always be timed. Do not rush yourself, but also take into account that you will often have multiple questions to be answered that are often independent of one another. Use your time wisely, and do not spend too much time on a single question, especially if you have a working solution.
Ask questions during the general Q&A.
Most technical interviews will wrap up with a dedicated general question and answer session. Be prepared to ask the interviewers some questions, whether about themselves or the company to show your enthusiasm.
Use meaningful, descriptive variable names.
Readability is a huge component of the interview. It not only demonstrates good coding practises but may help the interviewer understand your code better, especially if you become stuck or run into issues during the implementation of your solution.
During the Interview, do not forget to:
· Ask clarifying questions to test your assumptions. For example, “can you clarify whether this problem is inclusive or exclusive of the numbers you provided?”
· Consistently ask whether the interviewer is following along with your solution. Communication is key to ensuring you are both on the same page.
· Think out loud and explain decisions.
· Do not be afraid to ask questions, especially when you are stuck.
· Listen to hints given by your interviewer and review your code carefully. For example, the interviewer may ask, “are you sure that your code works for the FizzBuzz case.”
Useful Resources:
Practise technical problems:
· Leetcode
· Commonly asked Leetcode questions
Interview best practises:
This article is published by CCA, a student association affiliated with Monash University. Opinions published are not necessarily those of the publishers. CCA and Monash University do not accept any responsibility for the accuracy of information contained in the publication.