How to Structure your Interview Answers[Technique Tuesdays]
When practicing for your mock interviews, make sure you run through this checklist.
What is up you amazing people,
I know a lot of you have been very consistent with using the information given by this newsletter. How do I know this? Take a look at my analytics
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F730c5064-fd76-45c7-a016-f66caae54e79_234x261.png)
The fact that there have been more unique email opens than I have sent clearly shows that my readers have been going back and refering to past material. This is fantastic since the ideas I discuss show up repeatedly, so going back and reinforcing the pattern is crucial.
As anyone familiar with my system knows, I place a large emphasis on Mock Interviews. Leetcode is great, but it doesn’t get you into the habit of asking clarifying questions, coding up your solution in one go, or explaining your thought process to another person. These are all crucial in your interviews.
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfeea362-5946-4ee5-be9a-772211ee8b35_234x331.png)
That changes today. I will go over the system that I recommend that my students use to structure their answers during their interviews. A lot of you have really appreciated the clarity and logical progression of my solutions to Leetcode Style problems. This is the structure I use to come up with the solutions. Play around with this process, and integrate this into your interviews for amazing results.
1. Edge/Base Cases
By far the easiest way to get started on any challenging coding problem. Look at the corner/edge cases and resolve them immediately. It can be as simple as checking for certain conditions and returning the appropriate values. But this is generally a good starting point. This is helpful not only in recursion but in all kinds of complex problems. Why do we do this first?
Three reasons:
Harder problems can get pretty overwhelming. Solving the more obvious edge cases will get your mind warmed up to the main problem. The edge cases can give you a good launching-off point for your main problem. Taking the low-hanging fruit first will also get you going and give you momentum. This is crucial in a high-pressure situation like an interview.
Often, what messes people up are edge cases. Many people try to solve the general problem first. As they do this, they end up missing the corner cases that need to be handled efficiently.
These cases can provide a few hints. This is especially true for recursive problems.
I typically recommend that my students explore these cases while asking the interviewers clarifying questions. Clarifying questions are questions about the constraints of the problem, that can often reveal certain attributes about the nature of the problem/solution.
You will see me do this implicitly in the first steps. As I explore the ins and outs of a problem, I often build up the details from Base Cases. For details, look at our post on building recursive solutions.
2. Running through your hypothetical solution by hand
Imagine you had a working black box code. If you printed the state at each moment, what would it look like? Going through some simple cases by hand will help you get an intuition for how the problem might be solved. For example, let’s take a question where we must interleaf a stack with itself using only a queue. So a stack (1,2,3,4,5) becomes (1,5,2,4,3). Google loves this question. I was able to solve this question by just taking a small stack and running through what a solution would do. Not HOW (what we have to solve). Just WHAT it would look like.
This method is a way to avoid getting stuck. Imagine there’s a question that’s very hard. You have no idea how to proceed. Just working through some possible ways your code could work will allow your mind to focus. This is much better than sitting there and awkwardly scratching at a possible solution (or even worse, freezing up). Combined with your base cases, you might even be able to generate some pseudocode.
Writing Psuedocode/actual code
This is where your knowledge and practice come in handy. When you have worked out the “WHAT” of your solution, we can get to the HOW. You can chip off little pieces at a time, figuring out the solution incrementally. This is where practices like modularity and encapsulation are useful. There are no tricks to this section., so I won’t waste too much time on it. Nor should I have to tell you why this is important.
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e02e18-55cb-43c4-a6d5-22852bb88376_243x372.png)
Exploring Tradeoffs
This is a section that a lot of people miss. However, this is something that can really set you apart. Imagine you have a working, efficient code. Now is when you can score a lot of brownie points with your interviewers. How? Start talking about other possible ways you would solve it. Could we solve it using another data structure? Could we increase time complexity, but save space? Are there alternative data structures that could be used? You don’t have to give specifics. This is where you can be high level. You’ve already demonstrated your technical implementation skills. If you solved something recursively, now is also a good time to talk about how you might solve it iteratively or vice versa. Now is when you get bonus points for creativity and knowledge. And sometimes, you might have missed the optimal solution. This process will make you more likely to catch it.
***Special Request***
This newsletter has received a lot of love. If you haven’t already, I would really appreciate it if you could take 5 seconds to let Substack know that they should feature this publication on their pages. This will allow more people to see the newsletter.
There is a simple form in Substack that you can fill up for it. Here it is. Thank you.
https://docs.google.com/forms/d/e/1FAIpQLScs-yyToUvWUXIUuIfxz17dmZfzpNp5g7Gw7JUgzbFEhSxsvw/viewform
To get your Substack URL, follow the following steps-
Open - https://substack.com/
If you haven’t already, log in with your email.
In the top right corner, you will see your icon. Click on it. You will see the drop-down. Click on your name/profile. That will show you the link.
You will be redirected to your URL. Please put that into the survey. Appreciate your help.
In the comments below, share what topic you want to focus on next. I’d be interested in learning and will cover them. To learn more about the newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous and will take 2 minutes of your time. It will help me understand you better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
Happy Prep. I’ll see you at your dream job.
Good things take time,
Devansh <3
To make sure you get the most out of Technique Tuesdays, make sure you’re checking in the rest of the days as well. Leverage all the techniques I have discovered through my successful tutoring to easily succeed in your interviews and save your time and energy by joining the premium subscribers down below. Get a discount (for a whole year) using the button below
Reach out to me on:
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
Get a free stock on Robinhood. No risk to you, so not using the link is losing free money: https://join.robinhood.com/fnud75