9 Common Coding Interview Questions and the Skills They Test For

[ad_1]

Technical coding questions are some of the most intimidating aspects of the software development interview process. Though the questions may look quite different for different companies, most companies subject interviewees to some version of it.

Coding interview questions aren’t meant to be tools of terror. Each of the questions interviewers ask is trying to gauge something specific about candidates, whether it’s simple coding prowess, systems knowledge, familiarity with design principles, or just the ability to collaborate with others — including the interviewer.

Built In asked three individuals familiar with the software engineering recruitment process to talk about nine common coding interview questions and the skill sets they are measuring for. Questions were sourced from popular practice coding interview websites such as LeetCode, as well as coding interview prep textbooks.

Interviewers sometimes have different opinions about coding problems and their effectiveness in testing for specific skills, but one thing is clear — companies want candidates who engage with interviewers, ask for clarification, and don’t give up. Just work with the interviewer and let all your knowledge and creativity shine through. Most likely, that’s exactly what they’re looking for in a candidate.

9 Common Coding Interview Questions

  • Merge two sorted linked lists and return it as a sorted list.
  • Given a roman numeral, convert it to an integer.
  • Given an array of integers, every element appears twice except for one. Find that one.
  • Given a binary tree, print the bottom view from left to right.
  • Given an expression string x, examine whether the pairs and the orders of “{”,“}”,“(”,“)”,“[”,“]” are correct in the expression. For example, the function should return “true” for “[()]{}{[()()]()}” and “false” for “[(])”.
  • Given two numbers M and N, find the position of the rightmost different bit in the binary representation of numbers.
  • What’s the runtime (BigO) of the following code?
  • Design a parking lot using object-oriented principles.
  • If you were designing a web crawler, how would you avoid getting into infinite loops?

 

Merge two sorted linked lists and return it as a sorted list.

Josh Tucholski
Josh Tucholski, Tech Elevator.

Josh Tucholski, director of curriculum and instruction at coding bootcamp Tech Elevator

What skillset is this testing for? A lot of the time, you’re not necessarily encountering a specific problem with a linked list. But you are encountering problems like what this is asking, where perhaps the developer has to get data from two separate APIs and find some way to present it together in a sorted fashion. They might be solving the exact same problem, just not using a linked list. We can also generalize this problem by saying, “Alright, we have two lists of numbers that are sorted. How would we go about producing a third one where it includes all of them?”

Is this a good interview question? There’s yet to be a scenario in my professional development career where I’ve encountered a linked list, but the algorithm is what’s really important here. If I gave you two things in sorted order, could you find a way to merge them in another sorted order? 

Some companies that are maybe not as familiar with alternative education options for software development, or that are more fundamentally rooted in solving deep algorithmic problems, might leverage questions like this. In the markets that we’re in at Tech Elevator in the Midwest, we actually don’t have a lot of questions like this. Out of a class of 40 or 50 students, there might be one student that has been given a question with a linked list, for example.

Further ReadingI’m a Hiring Manager. Here’s My Advice for Software Developers Entering the Job Market.

 

Given a roman numeral, convert it to an integer.

Cody Daig
Cody Daig, Galvanize.

Cody Daig, technical mentor at Galvanize

What skillset is this testing for? Once you see the solution, it can be very easy to figure out — however, getting to that solution is often a struggle for most people. Because you have to think not only about where you’re at, but the next value in that Roman numeral. So, for example, four is “IV.” And so you can’t just go, “‘I,’ that’s one, ‘V,’ that’s five — boom, we’re at six!” Actually, you’re at four. So how do you differentiate between adding and subtracting not only looking at where you’re at but where you’re going? So it’s kind of got those two different pieces there.

Is this a good interview question? It depends on the knowledge of the interviewee going into the question here. I make the assumption that most of the time people know Roman numerals, and that can be an incorrect assumption, because not everyone actually knows or understands Roman numerals. So if you are coming into it not even knowing Roman numerals, it’s a challenging one. In general, I would say you’re not at that much more of a disadvantage, as long as you’re upfront and honest, like, “Hey, I’ve never worked with Roman numerals before.”

 

Given an array of integers, every element appears twice except for one. Find that one.

Anil Kadimisetty
Anil Kadimisetty, Chainalysis.

Anil Kadimisetty, director of engineering at Chainalysis

What skillset is this testing for? Not every interview candidate who gets selected actually solves a problem. That actually doesn’t matter that much. Because in the real world, a single individual does not know the answers to everything they’re trying to solve. You are going to only succeed when you’re able to collaborate with others, get others feedback and act on that. When you get stuck, what do you do? If someone is giving you a hint, are you responding well to the hint? That means you’re probably great at collaborating later on when you come here.

Is this a good interview question? At Chainalysis, we’re about cryptocurrency. In an interview, if we ask about that — because that’s what we do on a day-by-day basis — most people would fail, because no one really knows about cryptocurrencies. 

So what you do is, you use the most abstract way of asking about those things without mentioning the topics, which are domain specific. If you abstract the domain knowledge out of it, you will come down to a basic problem like this. So that’s what this is. It’s actually making the hiring bar common across all candidates with different domain experiences. This is a good equalizer.

 

Given a binary tree, print the bottom view from left to right.

Josh Tucholski
Josh Tucholski, Tech Elevator.

Josh Tucholski, Tech Elevator

What skillset is this testing for? A lot of people will bring up trees when they talk about database structure and design — it’s not like tables and keys, it’s more like underlying indexes and how those get managed. You’re getting into the realm of a database administrator, or a database developer who’s very specialized into fine-tuning databases.

If I had a student encounter this problem, I’d encourage them to work with the interviewer, rather than just giving up. They might want to basically go down into the level of how they would structure this problem in their code. They might talk about classes that they might use or various other data collections that they’ve worked with and explain how they might solve the problem.

Is this a good interview question? Someone who’s entering into a junior position often lacks prior experience professionally, where they can stand out and say, “Here is what I’m capable of doing.” And so we sometimes default to these questions to demonstrate that candidates have a foundational understanding? Unfortunately, these questions assume that one has had a foundational computer science education.

There are other ways to measure that. Have them either speak through a project that they specifically worked on, or give them some code and ask them to explain it to you, because that gets at their communication capability to explain what code is doing. When they walk through code, do they gloss over a number of things? Or do they get very specific?

 

Given an expression string x, examine whether the pairs and the orders of “{”,“}”,“(”,“)”,“[”,“]” are correct in the expression. For example, the function should return “true” for “[()]{}{[()()]()}” and “false” for “[(])”.

Cody Daig
Cody Daig, Galvanize.

Cody Daig, Galvanize

What skillset is this testing…

[ad_2]

Read More:9 Common Coding Interview Questions and the Skills They Test For