Popular Programming Interview Questions

Nov 28, 2021

8 Min Read

In your interviews with software engineers, what question have you found to be particularly useful? What is it about this specific question that makes it so valuable? You’re searching for a particular question, not simply an interviewing technique like “make them create code.”

The question isn’t productive, but there is some excellent response. You rephrased to include “sharing experiences” and “asking why,” which should consist of “encourage lengthier replies.”

Looking back, the query and answers are still not that helpful. The responses don’t seem to convey the “why” and only list the questions.

Examine this example code and suggest improvements?

It’s not the same, but you believe it’s a great question. So you’ve never used C# or.NET before, correct? This is a workstation. Find a way to query this DB and output a list of Customers with orders, organized by name. You may utilize any resource.

The only question you’ve ever had that tested your learning capacity.

  • Was that pre-StackOverflow?
  • Isn’t this a question you would like to ask?

This is a great question. Nothing can rescue them if Google can’t figure out simple language structures. That’s good, and it demonstrates their ability to learn a new programming language. You may use it for interview questions:

  • Anyone can copy-paste crappy.net code from MSDN.
  • An issue of behavior, not coding:

Tell me about a moment when you found yourself unable to complete all of your tasks on time. Thus, what? What happened?

That’s why. It seems useless.

The idea is that you learned a lot from the developer’s response. First, if they don’t acknowledge having been in this circumstance, they’re either lying or have no expertise in genuine projects. Second, you don’t want to employ someone who talks about how hard they’d work to remedy the issue. Most of the problems you find on projects stem from poor communication. You want to employ communicators.

Your inquiry is broader (“tell me about a time when something went wrong, and what you did in response”). One respondent swore up and down that nothing had ever gone wrong for him. You didn’t employ him.

What drew you to programming?

An excellent method to check whether they like programming and to break the ice.

When interviewing Java experts, you inquire about hashcode(), equals(), and their connection. Anyone unfamiliar with the topic will be adding difficult-to-find defects to your project.

You’ll also inquire about the relative merits of ArrayList and LinkedList. This should demonstrate that they are aware of and consider the performance consequences of their code.

You also like to hear their perspective on a technical issue (Maven’s utility, checked vs. unchecked exceptions, etc.) and then play devil’s advocate to see how effectively they can defend it.

You prefer LinkedList and ArrayList. People believe ArrayLists should be eliminated on SO. Nevertheless, you can think of several scenarios when they outperform LinkedList.

“Did you read a good technical book recently?” “How do you keep your information current?”

Two interviewers once asked you what a list and a map were. After your stunned expression, they apologized (and then you answered their question, and both went on with the interview, of course).

Many folks haven’t read a technical book since high school. And if you haven’t read a book since high school, you’ve probably never heard of unit tests, design patterns, or solid principles.

This is one of your favorite interview questions. Blogs, Wikipedia, and SO are lovely places to get tech news. But you don’t believe you can fully understand difficult things (like Knuth’s books) by reading blogs.

If you had to select between two developers, you’d choose the eager one to learn new complicated topics even if they want more cash. It’ll pay off eventually.

You seldom read technical books, but you understand TTD and specific design patterns. You learned more from SO (for example, factory pattern) and professional blogs like Jon Skeet than from a crappy book. None of the books you’ve read addressed why FxCop and StyleCop checks are crucial for writing reusable source code (nor even mentioned those tools).

To you, not reading technical books means a lack of ambition and mediocrity.

Reverse the list. Repeat in linear time. Do it in continuous time and space.

Do you consider yourself lucky?

This came up in an interview with one of Bruel & Kjaer’s founding members. Successful individuals often think of themselves as fortunate. They perceive setbacks as chances to develop and share their fortune with others (Lucky people bring more luck).

Unlucky people are more likely to be a problem on your team.

Preparation meets opportunity, not a four-leaf clover.

You’d like to upvote this. “Give me fortunate generals!” Napoleon cried. It’s the one you’ve always used.

Explain your prior projects

Then question them about their part in the initiatives and why they took specific choices. Instead of turning the interview into SATs, you talk to them. That was always enough to determine a developer’s suitability for a role.

You’ve only ever been hired for a position when you already understood the language, so language-specific questions aren’t beneficial. You’re not a fan of syntax (how would you sort cotton candy in a corral full of ravenous Zebras?); hence you never ask such things. Yes, you do. But it’s not often clear what the candidate’s role was (Project manager? Lead coder? Admin developer? Especially while working on significant projects with numerous employees.

What career would you choose if you could have any?

One thing only: a sincere effort to address it. The only inadequate response is to chuckle and tell the interviewer it’s the world’s most cliched question. (No hiring for me.)

Your all-time favorite question is put up here:

Why apply to be a [Internet Development Engineer III] at [HugeCorp] if you want to be a [Rock Star]?

It works best if people genuinely respond boldly. This is a rare chance for someone to shine by claiming “the hours are better” or “your career will endure longer than the normal rock star.”

It’s not only that there was no incorrect response. So, unless they are applying for some super excellent dream job, the answer is no. And if you’re interviewing for your ideal career and haven’t used it yet, you should consider why not.

Then ask yourself, “Why aren’t you applying for the ideal job?” — In your case, it’s a “damned if you do, damned if you don’t” dilemma. If someone has a dream job in mind, they may not be ready to take it on yet and need more experience. Why is it a problem?

You’ve declined job offers from organizations that asked silly, irrelevant questions like this. The interviewer is attempting to prove how intelligent they are than the interviewee rather than interrogating them. Their arrogance comes out forcefully. Asking over a drink is another thing.

Your point is well taken. But inquiring about someone’s aims and desires is reasonable. Unhappy individuals aren’t productive. Therefore you want to know whether you have suitable employment for them.

A clichéd question like this also helps self-select away persons who can’t cope with the customers at your work. The work pays well enough to compensate for the bad conduct. So it’s the perfect question.

It’s not anything you hold against them. This allows them to be open and honest about their job goals. If an interviewee feels “damned if they do, damned if they don’t,” they aren’t the right fit for the position. If you’re not prepared to put your neck out there and provide an honest response, that’s already a negative mark against you.

How do you handle method errors? Or How do you set up error handling in a web application?

You’re constantly shocked at how many devs can answer positively to the first question but know how to answer negatively to the second you’ve even talked with a few folks who couldn’t articulate how their current project handled errors.

Something along these lines:

Multiply a number by seven without using the *, /, or + operators. He didn’t mention “or,” for example. Is it only to measure interest in nitty-gritty minutiae, or does your codebase need knowledge of bit-twiddling? You believe you have just detonated a logic bomb in the trapdoor. Isn’t it just (x 3) – x? Or, to put it another way: x -(-x) – (-x) -(-x) -(-x) -(-x).

The following is similar to David’s but differs slightly:

Take a peek at some sloppy production code from a previous version that you subsequently corrected and enhanced. Would you mind explaining what it works? Would you please tell me where the issues are (correctness and style)? Please tell me how you would improve and repair it.

This distinguishes between folks who can build new code and those who can deal with old codebases. You were once asked the difference between the regexps /a*/ and /a*?/.

When it comes to recursion, you like to ask a few questions. Does the? Stand for greedy, zero, or one? You have encountered both syntaxes. Which dialect do you speak? That was almost 11 years ago, and it was perl5. Yes, it was a case of greedy vs. non-greedy. You’re shocked at how many people get this question wrong: How would you look for anything in an unsorted list?

It’s a complicated question: What is the definition of a match? Do you have any experience with partial list ordering? What kind of list is this? Is it possible to sort the items? What is the length of the list? What is the cost of comparing vs. checking for a match in terms of computation? Different responses to these questions may alter the best course of action.

How often will this search take place? Could that be a performance bottleneck?

Start with the first or last item, compare them, and continue to the next if there isn’t a match. The only issue is whether you care about numerous competitions or stop searching after the first one. If you wish to offer some context, you may say: It doesn’t matter for linked lists, but if you also want to extract matches from indexed lists, I’d traverse the list in reverse order to avoid changing the index outside the loop condition. It’ll probably be a combination of Java, C#, and pseudocode.

Design a dictionary that is as performant as feasible using non-exotic containers. That also enables you to enumerate the keys in the order they were added to the dictionary since it was initially constructed, rather than in “random” order. There are just too many questions about this one. Is it reasonable to rely just on two hash tables or a hash table plus an array list: One to keep track of the orders and the other to keep track of the rankings? Is it necessary that items be removed? (This complicates things.) Does it count as re-adding a value if it is updated? You have 20-30 minutes to speak, so you begin by saying, “Please feel free to contact us at any time with any queries.” you’d be pleased to give you a clue or correctly point you if you’re stuck. You would argue the individual does not comprehend data structures if they are still spinning their wheels. When defining what you want, you’d rather keep it open-ended and see where it leads.


Stay Connected with the Latest