Mastodon

5 Ways to Use AI for Coding Interview Prep (Without Cheating)

MacBook Pro with a mobile phone resting on the keyboard and a notebook

The Age of AI is here

The reports that software engineering is dead are greatly exaggerated. Far from being all replaced by robots, it turns out that we engineers are still quite necessary. Still, it’s obvious that generative AI is upending everything. And the trend isn’t slowing down anytime soon.

For a moment, it seemed like AI might be the silver bullet for those dreaded technical interviews too. You know, the kind that unlocks FAANG fame and fortune. One now-infamous individual even made an AI tool to help him cheat. And though his offers got rescinded, we have to ask the question. How long before someone finds a way to “LeetCheat” oneself to an offer?

For those of us with our morals and ethics intact, there’s a better way. In this article, I’ll discuss five strategies for using AI to make you better at interviews.

Why AI helps your coding interview prep

It wouldn’t surprise me if your first thought about using AI for interview prep is to ask it for the optimal answer. And sure, you could do that. But that won’t help you actually get better.

What actually helps is having a good problem-solving process and knowing your tools.

As I’ve said countless times, technical interviews are a collaborative problem-solving exercise. It’s an exercise between at least two living, intelligent, and complex individuals.

But what if you don’t have another person to practice with? Enter generative AI and LLM tools.

Whether you use ChatGPT, Gemini, Claude, Grok, or something else, you’ve got the most intelligent rubber ducks ever invented at your disposal.

Use them.

The strategies I’ve devised rely on good problem-solving principles. If you don’t know what they are, then go read my hit article on How to Practice LeetCode Problems.

I’ll wait.

OK, let’s begin.

Strategy #1: Use AI to check your articulation of the problem

You can’t solve a problem you don’t understand. As an interview coach, I teach my clients to start by “repeating the question” in their own words. This buys you time to think about what you need to do in the next steps. It also bootstraps your understanding of the problem. Most importantly, it allows your interviewer to confirm your understanding of the prompt. That feedback is vital to your ability to move forward.

If you don’t have a human being to practice with, then use an LLM to double-check your articulation of the problem. Here’s how.

  • Read the problem, then hide it from view.
  • Then, write out the prompt in your own words.
  • Lastly, ask an LLM to compare your version to the original prompt and critique it.

Here’s what the prompt would look like:

You are a technical interviewer for a tech company. Compare my version of the problem statement to the original and tell me if it is an accurate paraphrase. Note any details I’ve added or omitted

Strategy #2: Use AI to practice asking relevant questions

Becoming an inquisitive individual takes practice and discipline. Most of us suck at it. The good news is we can get better.

As with the previous strategy, consider the problem and write out your own list of questions. The aim is to figure out what information you need to brainstorm effectively. The key is to focus on asking not too few and not too many questions. Remember, you’re on the clock in a real interview.

Once you have your list, ask an LLM to assess it against the original problem statement. Again, you want to know if there are questions that you either didn’t need to ask or that you should have asked. It’s most important to understand why a question might or might not be relevant.

Watch the accompanying video on YouTube and leave a comment!

Strategy #3: Use AI to get brainstorming feedback

The hardest part of any technical interview is the brainstorming phase. Most people can at least generate a naive solution. But coming up with more than one or an optimal solution is tough work. It’s where your knowledge of tools and the problem-solving execution intersects.

In a real interview, your interviewer will guide you on how you might solve the problem. You can also get their buy-in before choosing a specific solution to code. But if you’re practicing alone, then it’s all on you.

No biggie, though; the chatbots are at the ready!

The key here is to prompt the LLM for feedback on your ideas without giving you the answer. Be careful, though; some LLMs are more eager than others and might slip and give away the farm. Here’s how the prompt could look:

Without giving away the answer, provide brief feedback on whether my idea solves the problem in two or three sentences. Use leading hints and questions to help me find better solutions on my own.

Remember, your real interviewer won’t be as generous with information as an LLM tool will be. Avoid letting it do a full breakdown unless you want that kind of help or are just starting out.

Strategy #4: Use AI to double-check Big O analysis

For those of you uncomfortable with Big O, this strategy can be game-changing. You must know Big O well to get an optimal solution in DSA interviews. With AI, you have a tool that won’t think you’re stupid for getting the runtime complexity wrong.

I should note that generative AI is an incredible tool for learning. Using it to simplify or explain concepts suitable to your tastes means you learn better and faster. This is one of the most useful strategies of the five.

You can also use LLMs to generate code that illustrates a specific time or space complexity. That way, you’ll learn how to recognize those complexities in your code with greater ease.

Strategy #5: Use AI to hint at bugs in your code

Most times, you aren’t going to have an IDE or compiler in your real interview. So, don’t rely on that in your practice. Learn to assess the completeness and accuracy of your own code without the help of tools.

A good interviewer will not tell you whether your solution is wrong outright. Rather, they will hint at test cases that will break due to a bug in your solution. They will expect you to step through the code to see if you can figure it out on your own.

Using AI to give you hints on things that may not be easy to spot on your own is clutch. Again, without letting it give you the answer, ask for test cases that you can use to help spot bugs in the code. Then, practice walking through the code yourself to find any issues and fix them.

Next steps

I’m sure there are plenty of other ways that you can use AI to assist you in interview prep. I hope this gives you a great start.

And remember, even though LLMs are a great tool, make sure to practice with real human beings. Artificial intelligence is still no replacement for actual intelligence.