What are the most interesting software engineer job interview questions you've ever asked or been asked?

Updated on : January 20, 2022 by Tripp Brewer



What are the most interesting software engineer job interview questions you've ever asked or been asked?

In the past, I've asked some weird questions to see how well the person would fit into today's development culture. Example:

It is the middle ages. A woman is sitting on the side of a giant scale, with a carrot tied to her nose. How can you know that she is a witch?

To which the interviewee replied: "Because it looks like one."

And that was the correct answer.

I tend to avoid programming-type questions and ask mental-type questions. For example, what are the strengths and disadvantages of using open source projects? push your change over to the main development distro and get it accepted as a retained feature ... having to redo the customizations each update can turn into a bit of an albatross, and good to know in advance if the person sees that guy loads).

From my experience, the best programming questions are those that have multiple approaches with different tradeoffs. Watching someone tackle the same problem under different constraints can teach you a lot about the person's attitude and skills. I'll give a concrete example and then explain why I think it's a great question.


Problem **: Let's say you have a list of N + 1 integers between 1 and N. You know there is at least one duplicate, but there may be more. For example, if N = 3, your list could be 3, 1, 1, 3 or it could be 1, 3, 2, 2. Print a number that appears in the list plus t

Keep reading

From my experience, the best programming questions are those that have multiple approaches with different tradeoffs. Watching someone tackle the same problem under different constraints can teach you a lot about the person's attitude and skills. I'll give a concrete example and then explain why I think it's a great question.


Problem **: Let's say you have a list of N + 1 integers between 1 and N. You know there is at least one duplicate, but there may be more. For example, if N = 3, your list could be 3, 1, 1, 3, or it could be 1, 3, 2, 2. Print a number that appears in the list more than once. (That is, in the first example, you can print '1' or '3'; you don't have to print both.)

Pause here if you want to think about the problem because I am about to reveal the solution.

Here's an idealized conversation:

Interviewer: states the problem

Candidate: Well I guess the most obvious approach is to compare every number on the list to every other number until a duplicate is found.

Interviewer: That is a good start. What are the spatial and temporal complexities of that solution?

Candidate: O (n ^ 2) time and O (1) space.

Interviewer: Great. Okay, let's say the list is quite large, so you need something that is faster than O (n ^ 2).

Candidate: Hm, I guess you could loop through the list and use a hash to keep track of the values ​​I've seen so far. Once I find a number that is already in the hash, I'm done.

Interviewer: That's a good idea, but must it be a hash since all inputs are integers between 1 and N?

Candidate: Ah, I guess you could use a boolean array and use the integer values ​​as indices.

Interviewer: What are the spatial and temporal complexities of that solution?

Candidate: O (n) time to traverse the list and O (n) space for the array / hash.

Interviewer: Very good. Okay, let's say the list of numbers is quite large, so you would like to avoid creating a copy of it. Maybe you have 8GB of RAM and the list is 6GB.

Candidate: Well, you could order the numbers and compare adjacent pairs. That would take O (n * log n) time and O (1) space if I use a sort in place like mergesort.

Interviewer: Excellent. Let's add a final restriction: what if you want something faster than O (n ^ 2) and you can't afford to use a lot of extra space, but you can't manipulate the original list either? For example, maybe the list is on a read-only CD.

(Almost all candidates need a hint or two at this point ..)

Candidate: I think I can binary search for a duplicate number. For example, I go through the list and count the number of integers between 1 and N / 2. If the count is greater than the number of possible integers in that range, then I know there is a duplicate in that range. If not, there must be a duplicate in the range N / 2 + 1 to N. Once I know which half of the range the duplicate is in, I can do binary and recurring searches on that half, then keep repeating the process until you have found a duplicate number. The complexity of time is O (n * log n) and the complexity of space is O (1).

Interviewer: When can you start?

Questions like this are great because they test a lot of things at the same time:

  1. General competence of the candidate with algorithms, space / time complexity, etc.
  2. The candidate's ability to respond to different constraints and handle various tradeoffs. This is something engineers deal with all the time and is a fundamental skill.
  3. The creativity of the candidate. Each restriction forces a person to start from scratch and think of a whole new approach: a great test of creativity.
  4. The candidate's attitude towards complexity. Some candidates get permanently stuck because they start out trying to find the solution O (n * log n) time / O (1) space. They assume that using a hash or comparing all items in the list to all other items is not what you are looking for, so they don't mention the easy solutions (but they can't find the more difficult solutions either). This is a yellow flag that the candidate tends to overcomplicate things (I will usually ask subsequent interviewers to be on the lookout for this trend).
  5. The candidate's passion for learning and challenges. Some people get excited when increasingly harsh restrictions are placed on them, others become discouraged or lazy.


** To give credit to where it belongs, I was asked this question during an interview at Microsoft. I thought it was a great question and have been using it ever since. Quora seems like a good place to drop the question and force me to think of something more original =).

This may be something you shouldn't say to a Silicon Valley hiring software engineering manager, but this has happened more than once with candidates I've been interviewing. Long before Wikipedia, in 1995 I was interviewing candidates for a software engineering job reporting to me. I had a candidate who said he had 5 years of experience each in 3 programming languages: Java, C ++, and Objective-C.

While 5 years of experience might have been possible for C ++ and Objective-C, it was not possible for Java, which only received that name publicly in 1994. It is true that what we can

Keep reading

This may be something you shouldn't say to a Silicon Valley hiring software engineering manager, but this has happened more than once with candidates I've been interviewing. Long before Wikipedia, in 1995 I was interviewing candidates for a software engineering job reporting to me. I had a candidate who said he had 5 years of experience each in 3 programming languages: Java, C ++, and Objective-C.

While 5 years of experience might have been possible for C ++ and Objective-C, it was not possible for Java, which only received that name publicly in 1994. It is true that what we call Java now existed before 1994, as a language of programming. "Oak" that had been used internally at Sun Microsystems was released outside the company, but it is reasonably true that someone who programmed in Oak before 1994 actually had experience with what was later called Java. But this candidate had never worked at Sun Microsystems. And the Sun team that first used Oak started doing it in 1992. Its creator, James Gosling, had started developing it in 1991. So this candidate claimed to have more years of experience with the language than the creator. In fact, the candidate did not know the name of its inventor, or anyone else who would have known from Team Oak or Sun. I did not find that credible. The candidate also did not confess that they exaggerated his experience with Java.

In fact, I knew a bit about Javanese history because there are frequent open conferences in Silicon Valley where professionals connect and showcase their recent work. In addition, there are highly connected alumni networks for Stanford, Berkeley, MIT, and Carnegie-Mellon and many information flows on these networks. Turns out I'm a Carnegie-Mellon alumnus, and so is James Gosling, so the news tends to travel fast in Silicon Valley, increasing the likelihood that your hoax will be caught.

This is not an isolated case of having more experience than I have seen. In January 2018, I was asked to do a technical interview with a candidate for whom I was hiring a friend. The candidate told me they had 5 years of experience with the newest new programming language for Apple devices, Swift. Again, this was not possible as Swift was only announced in June 2014. He was particularly aware of this, because he had developed a programming methodology at HP in the mid-1980s that also became known as the " I develop SWIFT "and have a Google Search Terms Engine that tracks the use of SWIFT in technology articles.

Maybe it's just bad luck for these candidates that I was an interviewer and had reason to know a lot about these new programming languages, but I think that kind of bragging undermines credibility. This seems to happen regularly with people claiming FIVE years of experience, with some new and novel language or technology that is only 3-4 years old. So before adding such claims to your resume, try reading about the technologies on Wikipedia.

Instead of asking them to write code, I'll ask candidates to debug the code, which is probably a more common task for a software engineer. For example, there are several errors in this function to calculate the factorial of a number.

  1. int factorial (int x) 
  2. unsigned int and; 
  3. while (x) 
  4. --X; 
  5. y = y * x; 
  6. return and; 

First question, do you know what a factorial is? A surprising number of candidates will not know and I will have to explain.

Does this function compile? Yes, using the default GCC configuration, this compiles without errors or warnings.

What does "while (x)" mean? When does x evaluate

Keep reading

Instead of asking them to write code, I'll ask candidates to debug the code, which is probably a more common task for a software engineer. For example, there are several errors in this function to calculate the factorial of a number.

  1. int factorial (int x) 
  2. unsigned int and; 
  3. while (x) 
  4. --X; 
  5. y = y * x; 
  6. return and; 

First question, do you know what a factorial is? A surprising number of candidates will not know and I will have to explain.

Does this function compile? Yes, using the default GCC configuration, this compiles without errors or warnings.

What does "while (x)" mean? When is x evaluated as 'false'? The answer is that while (x) is false if x == 0.

What if x is negative? Many candidates will eventually declare that they fall into an "endless loop." I'm impressed if they go that far, but it opens the door for me to ask deeper questions. Will you really get stuck in an endless loop? What is the lowest possible value for x? What is the difference between short int and long int? Regardless, they won't have the exact number memorized, so I'll tell you for a short interval that it's -32,768. What happens when --x reaches -32,768? So when will the cycle end?

Did you notice that y = y * x isn't even in the loop? That means this function always returns zero. Even if you fix that, what is the initial value of y?

Did you notice that lines 5 and 6 are in the wrong order? You must change them to get the math correct.

What is the difference between '--x' and 'x--'? Can you combine lines 5 and 6 correctly? If you combine those lines, do you need {} around 'y = y * x--'? Why put {} when they are not needed? Why shouldn't I combine lines 5 and 6?

Did you notice the implicit type cast? The function returns an unsigned int as a signed int.

FYI, here is a corrected version of this feature, but maybe it's too clever. No one has ever given me an answer with this pact. I'm sure there are shorter answers, but this answer uses pretty common idioms. There is nothing esoteric about this.

  1. unsigned long factorial (unsigned long x) 
  2. unsigned long y = 1; 
  3. while (x) y = y * x--; 
  4. return and; 

What if x is 100? At what point does y overflow? What is the maximum value allowed for x? The answer is that factorial (9) will overflow an unsigned short while factorial (14) will overflow an unsigned long.

What if code size was of the utmost importance? Rewrite this function using recursion instead of a while () loop. Hardly any candidate is able to do that correctly, but it can be done in just two lines and without a temporary variable like y. In a recursive function you can also declare x as constant. (Why should x be constant?) This is a good opportunity to explore the pros and cons of recursion and stack overflows.

FYI, here's a nice recursive version of this function, though it doesn't look for overflows just yet.

  1. unsigned long factorial (long unsigned const x) 
  2. if (x) return (x * factorial (x-1)); 
  3. return 1; 

What is the big O for this function? The answer is O (n). What if performance was of the utmost importance? How can you make this feature faster? The best answer is a lookup table. There are only 14 entries at most and it is O (1). If a candidate has come this far, I am very impressed. Fewer than half a dozen candidates ever suggest a lookup table without being prompted. Ironically, a candidate is more likely to suggest caching before suggesting a lookup table.

This little feature will reveal basic math skills, C syntax, binary representation, binary math, type conversion, algorithm analysis, optimization, and creativity. Sure, I'd like to ask about pointers, linked lists, common libraries, Unicode, polymorphism, inheritance, encapsulation, virtual functions, etc. But if I only get one question, I'll start with the factorial function and find the best encoders with amazing precision.

Good questions are questions that interest you. These questions are not a way to sell yourself! Rather, they are a unique opportunity to obtain unbiased information about the company.

Until the interview, these are vendors or recruiters, who are incentivized to hire you. Recruiters (mostly unconsciously) tend to tell you what they think will make you accept an offer.

Once you are in the company, you have access to the information, but it is too late, you have made a decision.

The interview is a sweet spot: you are under a confidentiality agreement, so you can ask whatever you want and get an honest answer.

Keep reading

Good questions are questions that interest you. These questions are not a way to sell yourself! Rather, they are a unique opportunity to obtain unbiased information about the company.

Until the interview, these are vendors or recruiters, who are incentivized to hire you. Recruiters (mostly unconsciously) tend to tell you what they think will make you accept an offer.

Once you are in the company, you have access to the information, but it is too late, you have made a decision.

The interview is ideal: you are under a confidentiality agreement, so you can ask what you want and get an honest answer. The people who interview you still have an interest in you joining, but no explicit incentive, so their responses are less skewed than those of the recruiters.

These questions are not an originality contest. The last time I interviewed I always ran out of time for questions, but I always get a good sign of: what do you like most about working at X (except people), what is the most difficult thing you have done here, what your typical day looks like, how does X differ from other tech companies in their experience, what perf looks like, what was the hardest situation they've been in while working at X, etc.

I also like to ask difficult (but not confrontational) questions when possible. That is, what do you think your competitor does better, what do we think about (bad time for company X), etc.

I should mention beforehand that at the stage of my life when I had this interview, I was newly married. Usually I look younger than my age and had already received my bachelor's degree. At the time, I had always been in the habit of removing my wedding ring before an interview, but this time I forgot to do it.

I was interviewing for a position in the county next to the one I currently lived in. I think the position had something to do with coordinating the staff and keeping the schedule. Being that I am a very analytical and strategic individual, I could have been very good at

Keep reading

I should mention beforehand that at the stage of my life when I had this interview, I was newly married. Usually I look younger than my age and had already received my bachelor's degree. At the time, I had always been in the habit of removing my wedding ring before an interview, but this time I forgot to do it.

I was interviewing for a position in the county next to the one I currently lived in. I think the position had something to do with coordinating the staff and keeping the schedule. Being that I am a very analytical and strategic person, I could have been very good at this job. However, it wasn't long after entering the interview that I knew that this particular organization would not be a good fit for me.

Going into the interview, I couldn't help but notice that literally all of the staff members were at least twice my size, and they were all female. Given that I was already a bit overweight at the time (I was 5'4 ″ and about 160 pounds), the fact that I had stuck out like a sore thumb in that regard already worried me. Throughout the interview, it started with the boss asking me just the basic interview questions, which I handled pretty well.

Moving on to the interview, I suspect she noticed my ring, as well as my relatively young face and slightly plump figure at the time. The next thing he asked I was completely surprised. She mentioned that they were looking for someone who was interested in a long-term position (and I was at the time), and then she had the audacity to ask me if I was pregnant. Let me be clear in saying that I have never been pregnant and do not plan to have children in the foreseeable future. I was completely taken aback by the question and ended up spitting out some answer that hopefully pleased them.

To this day, I'm not sure if they made assumptions about my maternity status because of my age, or my marital status, or what. However, I knew from that moment on that I would never be paid enough to work with a group of intrusive and ignorant women like that. Looking back, you should have reported this to whoever handles discrimination cases. I learned from that experience that I had to be prepared to answer questions that might seem discriminatory in nature.

These are the most important questions posed by HR:

1. Tell me about yourself / let me know your summary.

Answer: Give a short introduction about yourself, your blog, your department, your family, your education, your accomplishments, your hobbies, and your STRENGTHS!

2. What are your strengths and weaknesses?

Answer: Remind us of the qualities that adapt to the needs of companies. for example, coordination, leadership, organizational skills, critical skills, etc.

Speaking of your vulnerability, project your weakness as your power. For example, boy. Tell them you're going to be late while you're looking for p

Keep reading

These are the most important questions posed by HR:

1. Tell me about yourself / let me know your summary.

Answer: Give a short introduction about yourself, your blog, your department, your family, your education, your accomplishments, your hobbies, and your STRENGTHS!

2. What are your strengths and weaknesses?

Answer: Remind us of the qualities that adapt to the needs of companies. for example, coordination, leadership, organizational skills, critical skills, etc.

Speaking of your vulnerability, project your weakness as your power. For example, boy. Tell them you're going to be late while you're looking for perfection, but somehow you get the job done right! But that's a silver lining. You should even reassure them that you are a very compassionate person and that you cannot quickly say "no" to people when they ask for your support.

3. Why should we hire you?

Answer: This is where you need to be careful. If they want to hire you, you must match their expectations for their profile. Therefore, tell them all the possible positive qualities in you that fit their needs. For example, tell them that “My technical skills are closely related to the profile you are interviewing me for,” and quote this with strong support such as your CGPA. You can also tell them that you are a very strong and flexible person and that you would work under pressure very easily, so it would be very important to work in a professional environment.

4. How do you see yourself in 5 years?

Answer: This is somewhat complicated. Because the interviewer does not want to know what you are going to be, he just wants to see how long you are going to be with him and also to see if you have a clear idea of ​​your future and professional career. So, don't go on saying that you want to be the CEO of a company or tell them that you would like to go to higher education (because they don't want you to leave the company soon). Just tell them that you would like to learn more from your teammates and improve your skills and occupy a high-level position in your company.

5. Do you have any questions for us?

Answer: This is the most difficult question. Most people end up answering "No." But the interviewer doesn't want a candidate who just nods at everything. You want a candidate who is more interactive and interested in the company. So obviously I would expect you to ask him something. Don't ask him about the salary structure or hierarchy of the company (that would be a bit offensive). It is better to ask simple questions like "where would my place of publication / training be", etc.

Suggestions: Avoid the word "if" and replace it with "when". Because the word if and when can mean the same thing but "if" you doubt it and when you have confidence.

My post will fall into the Stranger / Stranger Questions category.

This interview of mine happened with TCS in 2011 and it was my first interview for a job. After passing the written test, he was scheduled to give a technical round of interview.

I went into the booth and handed him my resume. He took a look at my resume and threw up the question that completely stunned me.

Interviewer - Give a 5 minute speech about Anna Hazare.

And my reaction was

Since this was a technical round, I thought you would ask me questions about C, C ++, Java, SO, or Networking Question. It took me a while to wake up from the

Keep reading

My post will fall into the Stranger / Stranger Questions category.

This interview of mine happened with TCS in 2011 and it was my first interview for a job. After passing the written test, he was scheduled to give a technical round of interview.

I went into the booth and handed him my resume. He took a look at my resume and threw up the question that completely stunned me.

Interviewer - Give a 5 minute speech about Anna Hazare.

And my reaction was

Since this was a technical round, I thought you would ask me questions about C, C ++, Java, SO, or Networking Question. It took me a while to wake up from that commotion and I spoke a little about it. The answer infuriated him and now the question has moved on to my communication skills. He scolded me for 5 more minutes than studying in a convent school and still having poor English.

Then he asked me "Do you smoke?" To which I hesitantly replied "Yes" and this triggered a further 5 minute lecture on smoking and how it will affect my work.

After the warning, he gave me a program to print numbers from 1 to 10.

And my reaction was "You really ask an engineer for a technical round." I wrote the show, but felt that it was against my dignity to write that show. At this point it was clear to me that I am not going to get this job.

I really wanted to take my resume and get out of there (like Sharman Joshi in 3 Idiots).

RESULT - Rejected.

I work at Google. I conduct interviews. Everyone who works at Google conducts interviews. This is how this works:

An interesting question occurs to me. I thought about it a lot. And over time, I get really good with the question. I learn that presenting something in a certain way is a waste of time. Then I learn to present it in another way so that the candidate spends more time interviewing and less time listening to me explain. I get really good with this question so I can use it to help the candidate show me what he is really capable of.

Then someone posts the question to one of

Keep reading

I work at Google. I conduct interviews. Everyone who works at Google conducts interviews. This is how this works:

An interesting question occurs to me. I thought about it a lot. And over time, I get really good with the question. I learn that presenting something in a certain way is a waste of time. Then I learn to present it in another way so that the candidate spends more time interviewing and less time listening to me explain. I get really good with this question so I can use it to help the candidate show me what he is really capable of.

Then someone posts the question on one of these sites, despite the NDA, and now the question is placed on the banned list. So I have to start over with a new question that I am not familiar with. And you pay the price, because I am going to err on the side of caution and choose not to hire if you are at the limit.

Be honest, as with all your answers in an interview or on an application.

If you've never been asked the question, say no, but then offer what your answer would be if your new employer asked you to work long hours.

If you've been asked the question, say yes, briefly explain the circumstances (for example, meeting a submission deadline, preparing for a design review for the CEO, etc.) and then offering what your answer would be if your New employer will ask you to work long hours.

In general, don't ask other people for canned answers to interview questions. Instead, be yourself, be honest, and communicate witty.

Keep reading

Be honest, as with all your answers in an interview or on an application.

If you've never been asked the question, say no, but then offer what your answer would be if your new employer asked you to work long hours.

If you've been asked the question, say yes, briefly explain the circumstances (for example, meeting a submission deadline, preparing for a design review for the CEO, etc.) and then offering what your answer would be if your New employer will ask you to work long hours.

In general, don't ask other people for canned answers to interview questions. Instead, be yourself, be honest, and communicate with your interviewer. Don't just offer canned answers you got from a book or Quora or other people. Use your brain and use your own words. Good interviewers can feel canned responses. The interviewer wants to learn about you, not about random people you asked online.

How are things done?


That puzzled me a bit. And it's a good question. Many of us are doers who do things like this (people love us) but we do it so well and in such an intuitive way that it is difficult to explain how.

Answers will vary, but should refer to how you prioritize, have a plan, and have a BCD to Z plan.

Other Guides:


GET SPECIAL OFFER FROM OUR PARTNER.