45 Common Coding Interview Questions

45 Common Coding Interview Questions was originally published on Forage.

student coding on laptop

A coding interview can be nerve-racking, but it’s an essential part of the technical interview process to demonstrate your programming skills and knowledge of coding concepts. While the exact questions a technical recruiter might ask vary depending on what kind of role you’re applying for, there are some common coding interview questions you can prepare for to ace the interview. We’ll cover:

Programming Interview Questions

A coding interview typically starts with an assessment of your computer programming skills. This assessment might be a whiteboard challenge or coding test.

What Is a Whiteboard Challenge?

A whiteboard challenge is when you’re given a coding challenge during a live interview. You solve the problem in front of the interviewer and explain your process as you work on the challenge.

You can use the UMPIRE method to approach these problems:

U: Understand the problem
M: Match the problem with the interviewer
P: Plan your approach and solution
I: Implement your solution
R: Review your solution
E: Evaluate your solution

To prepare for a whiteboard challenge, “practice talking through your problem-solving process,” says Archie Payne, president of CalTek Staffing, an IT and technical staffing firm. “Interviewers don’t just want to see that candidates can complete the test task, they also want to get insights into how candidates approach the process. A good way to prepare is to pretend you’re teaching a programming class, and practice how you’d explain and demonstrate key concepts to someone who doesn’t know them.”

It’s less about solving everything right the first time (or even at all) and more about learning how you approach problems and solve challenges. 

And what happens if you don’t know the answer? Don’t panic.

“Be honest that this is a gap in your knowledge,” Payne says. “Take a moment to think critically about the problem and the ways you’d likely approach it, then explain that process to the interviewer. Hiring managers don’t necessarily expect entry-level candidates to have all the answers, but they do want to hire someone who’s self aware about what they do and don’t know, and willing to learn and try new things.”

What Is an Independent Coding Test?

An indepdent coding test focuses on your ability to code and solve problems within a given time frame. You may have an independent coding test after your whiteboard test or before as part of a screening. 

The company will give you a link to a common code editor, and you can choose what programming language you want to write in. Before you start the test, you’ll know how long you have to complete it and whether you’ll be able to leave the platform during the test. Make sure you do the test in a quiet environment where you won’t have distractions.

To prepare for this part of the interview, “​​simulate interview conditions,” Mohit Maheshwari, co-founder at NMG Technologies, a full-service IT company, says. “Practice coding on a whiteboard or a blank sheet of paper, as this is how you will be doing it during the interview. Get used to writing code without the aid of an IDE [integrated development environment] or compiler.” 

jpmorgan logo

JPMorgan Chase Software Engineering

Practice basic programming skills with a Python project.


Enroll Now

Avg. Time:
5 hours

Skills you’ll build:
Python, Git, React, Typescript, technical communication


Enroll Now

Common Programming Interview Questions

What questions will you get in a whiteboard challenge or independent coding test? Here are some examples:

  1. How do you reverse a string?
  2. How do you determine if a string is a palindrome?
  3. How do you calculate the number of numerical digits in a string?
  4. How do you find the count for the occurrence of a particular character in a string?
  5. How do you find the non-matching characters in a string?
  6. How do you find out if the two given strings are anagrams?
  7. How do you calculate the number of vowels and consonants in a string?
  8. How do you total all of the matching integer elements in an array?
  9. How do you reverse an array?
  10. How do you find the maximum element in an array?
  11. How do you sort an array of integers in ascending order?
  12. How do you print a Fibonacci sequence using recursion?
  13. How do you calculate the sum of two integers?
  14. How do you find the average of numbers in a list?
  15. How do you check if an integer is even or odd?
  16. How do you find the middle element of a linked list?
  17. How do you remove a loop in a linked list?
  18. How do you merge two sorted linked lists?
  19. How do you implement binary search to find an element in a sorted array?
  20. How do you print a binary tree in vertical order?

Forage Find

LeetCode is a great resource for practicing these types of questions. You can create a free account and practice hundreds of coding questions you might get in an interview.

Conceptual Coding Interview Questions

The recruiter or hiring manager will also ask conceptual coding interview questions to learn whether you’re familiar with the concepts you’ll be working with. 

“Expect questions on basic data structures such as arrays, linked lists, trees, and graphs, as well as common algorithms like sorting and searching,” Maheshwari says.

To prepare for these questions, refamiliarize yourself with these concepts. Then, you can practice by explaining them clearly to someone who doesn’t have technical knowledge.

Examples of these questions include:

  1. What is a data structure?
  2. What is an array?
  3. What is a linked list?
  4. What is the difference between an array and a linked list?
  5. What is LIFO? 
  6. What is FIFO?
  7. What is a stack?
  8. What are binary trees?
  9. What are binary search trees?
  10. What is object-oriented programming?
  11. What is the purpose of a loop in programming?
  12. What is a conditional statement?
  13. What is debugging?
  14. What is recursion?
  15. What are the differences between linear and non-linear data structures?

>>MORE: Learn explanations of common software engineering technical concepts with entry-level software engineering interview questions (and answers).

General Coding Interview Questions

Outside of programming questions and questions about technical concepts, you might answer questions about your general experience, like how you learned to code, behavioral interview questions, and how you keep your skills fresh. 

Examples of general common coding interview questions include:

  1. What programming languages do you have experience working with?
  2. Describe a time you faced a challenge in a project you were working on and how you overcame it.
  3. Walk me through a project you’re currently or have recently worked on.
  4. Give an example of a project you worked on where you had to learn a new programming language or technology. How did you go about learning it?
  5. How do you ensure your code is readable by other developers?
  6. What are your interests outside of programming?
  7. How do you keep your skills sharp and up to date?
  8. How do you collaborate on projects with non-technical team members?
  9. Tell me about a time when you had to explain a complex technical concept to a non-technical team member.
  10. How do you get started on a new coding project?

“Be prepared to explain your expertise in the languages you know and what types of projects you’ve completed using them,” Payne says. “​​The ability to troubleshoot and correct issues as you go is a key skill for programmers at all career levels. The best answer will focus on the steps you take to diagnose and fix issues, rather than the intricate details of the specific problem you’re describing.”

Common Coding Interview Questions: The Bottom Line

Programming interview questions generally come in three different forms: practical coding tests, questions about technical concepts, and general questions about your experience. To ace a coding interview, prepare carefully for each section: practice problems, review concepts, and use the STAR method to shape answers about your experience.

Are you getting ready for a coding interview? Practice sample coding problems with matrices and arrays and learn what hiring managers look for in technical interviews with Girls Who Code’s Technical Interview Prep.

Image credit: Canva

The post 45 Common Coding Interview Questions appeared first on Forage.