Advice > Software engineering

47 Coding interview examples with answers (in Python, Java, C++, Etc.)

By Max Serrano Last updated: July 27, 2023 How we wrote this article
a laptop split screen, with code on one side and a video call participant on the other

One of the best ways to prepare for coding interviews is by studying coding mock interview examples. 

There are a lot of free videos out there, but it’s hard to know what language they’re actually using without watching them.

In the article below, we’ve listed the best mock interviews available on YouTube for the most common coding language. 

We hope this list saves you time!

Click here to practice coding interviews with FAANG engineers

1. Python coding interview examples

2. Java coding interview examples

3. C++ coding interview examples

4. Javascript coding interview examples

5. SQL coding interview examples

6. How to prepare for coding interviews

One of the main challenges of coding interviews is that you have to communicate what you are doing as you are doing it. Having to think, code, and communicate your thoughts to the interviewer all at the same time is not easy.

With that in mind, don't let the first interview you do be the real thing. Instead, we highly recommend getting some mock interviews under your belt. 

6.1 Practice with peers

If you have friends or peers who can do coding mock interviews with you, that's an option worth trying. It’s free, but be warned, you may come up against the following problems:

  • It’s hard to know if the feedback you get is accurate
  • They’re unlikely to have insider knowledge of interviews at your target company
  • On peer platforms, people often waste your time by not showing up

For those reasons, many candidates skip peer mock interviews and go straight to mock interviews with an expert. 

6.2 Practice with experienced coding interviewers

In our experience, practicing real coding interviews with experts who can give you company-specific feedback makes a huge difference. If you're still canvassing expert coaching services for coding interviews, check out our guide to the best coding interview coaching websites.

Or you can skip straight to finding a coding interview coach here, so you can:

  • Test yourself under real interview conditions
  • Get accurate feedback from a real expert
  • Build your confidence
  • Get company-specific insights
  • Save time by focusing your preparation

Landing a job at a big tech company often results in a $50,000 per year or more increase in total compensation. In our experience, three or four coaching sessions worth ~$500 make a significant difference in your ability to land the job. That’s an ROI of 100x!

Click here to book coding mock interviews with experienced FAANG interviewers.
 

Related articles:

Young woman draws her system design diagram on whiteboard during system design interview
Software engineeringSep 24, 2025
System Design Interview Questions & Prep (from FAANG experts)
Learn all about commonly asked system design interview questions, with sample answer outlines from FAANG coaches. Get expert insights on interview expectations at every level, interview best practices, and how to prepare.
Read more
A group of software developers working from laptops sit around a wood table
Software engineeringJul 30, 2025
Amazon SDE 2 Interview (questions, process, prep)
Ace the Amazon SDE 2 interviews with this guide. Learn more about the role, interview process, recommended tips for interview prep, and sample questions sourced from real candidate data.
Read more
Amazon machine learning engineer interview guide
Software engineeringJul 23, 2024
Amazon Machine Learning Engineer Interview (questions, process, prep)
Complete guide to Amazon machine learning engineer interviews. Learn more about the role, the interview process, practice with example questions, and learn key interviewing and prep tips.
Read more
Big O and complexity analysis
Software engineeringJan 18, 2022
Complete guide to big-O notation and complexity analysis
Detailed explanation on big-O complexity analysis, including high quality diagrams, example problems, and a handy cheat sheet. The finale of our coding prep series to help you ace your software engineer interview.
Read more
preparing for a Google coding interview
Software engineeringMar 26, 2025
Google Coding Interview (questions and prep)
Learn everything you need to know about Google coding interviews: how they work, coding interview example questions from real candidates, an answer framework you can use, and a prep plan you can follow to ace your interviews.
Read more
Breadth first search interview questions
Software engineeringNov 09, 2021
44 breadth-first search (BFS) interview questions [easy, medium, hard]
44 breadth-first search interview questions, all with links to high-quality solutions, plus an interview preparation guide. Part 2 of our algorithms questions series to help you practice for your software engineer interview.
Read more
How to get a job at Google - happy woman
Software engineeringJan 21, 2025
How to get a job at Google in 7 steps (hard but possible!)
Step-by-step guide to how to get a job at Google, from application stage and trying to get a referral, to what to expect from the interview process, including insider insights.
Read more
The google logo in neon
Software engineeringOct 10, 2023
6 Google resume examples (+ tips on optimizing for Google)
6 real examples of resumes that worked for Google. Plus, all the info you need to optimize your resume/CV for Google, including tips, a checklist and a step-by-step guide.
Read more