Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been attending quite a few interviews recently and have been asked by companies to answer "design a [insert model]" questions more than a few times.

  1. Is this normal in the industry nowadays? I've been in the software world for more than two decades and have attended my share of interviews, but I am seeing this pattern in interviews emerge only recently.
  2. I feel the question is very open ended. For example: I was asked to draw a class diagram to "Design a parking lot". I am not sure what level of detail the interviewer is expecting. This was in an online test where I was expected to attach a visio diagram, so I couldn't ask them what their expectations were.
  3. Do you use these kind of questions in your interview process? Are they related to only class diagrams or do you also ask sequence, flowcharts and ERDs (ofcourse based on the nature of the position) Have they been effective in your hiring process?

* Edit for Kevin's response *

For example: A complete question could be "Design a parking lot management system that can be used to find vacant slots"

I can be done with 2 classes, ParkingLot and Slot or I could go on to add IVehicle and Vehicle and Car and Motorcycle classes. Where do I draw the line?

public class ParkingLot
   IVehicle Vehicle {set; get;}

   List<Slot> GetEmptySlots() { };

public class Vehicle : IVehicle
  Slot SlotNum {set; get;}

public class Slot
  int Row {set; get;}
  int Column {set; get; }
share|improve this question
"Design a whatever" problems go back decades. –  Blrfl Jan 14 '13 at 12:32
Always ask - Do you want a specific, simple answer for this problem? Or do you want a more robust answer to the generic problem? –  Chris Cudmore Feb 4 '14 at 16:41

7 Answers 7

Designing a small system is actually a very relevant exercise to ask in an interview. It shows your skills at coming up with a good software solution to a domain problem.

However, I find it strange to just ask to post a class diagram online with no human interaction :

  • They'll miss the essential - the reasoning behind the diagram and what led you to design things that way.
  • There's no "parapet" to stop the applicant from going too far. If you reflect a final implementation in the diagram, you'll probably have dozens of classes and an unreadable schema.
  • Being able to draw a UML class diagram is not really an essential skill, it's just one OO notation among others. The ability to create solid designs is.

In a live interview, the ideal steps I'd expect a candidate to take would be :

  • Talk about the problem with the recruiter and start expressing a basic solution verbally, asking questions and adjusting as the recruiter gives more precise needs.
  • Stand up and sketch an overall view of the system and how components could interact together. Might be the purest style of UML, might be just boxes and circles.
  • Write a test, either high level acceptance test or unit test for one of the components/classes.
  • Start writing the corresponding implementation.

Hopefully at some point the recruiter will have gathered enough information about the candidate's skills and call it a day. The goal is not to implement a full working solution (unless it's one of these unpaid service in disguise interviews).

share|improve this answer

I had been asked for coming out a design for a parking lot not too long ago. I wasn't given any use cases in the first place, but mentioned a couple later. I believe my design didn't fit what the interviewer's had in mind. I agree that any software design is only valid for a given use case. Back to this interview question, I believe that my interviewer didn't have any real world design experience. Those people believe that they know what they ask for. It is another story whether that is indeed true or not.

share|improve this answer
how does this answer the question asked? –  gnat Feb 4 '14 at 4:58

I find these questions rather silly. The true answer is "what are the use cases?" Without a use case, there is no need for any design. For example, here is a perfectly reasonable answer to the parking lot question:

class ParkingLot {
 boolean isFull();
 void carEntered();
 void carExited();

It satisfies one obvious use case.

share|improve this answer
Are you suggesting that these questions only have value when there are use cases associated with them? If there were use cases, how do you still determine the depth of what the interviewer is expecting. Please see edit** –  Nick Jan 14 '13 at 16:05
I'm suggesting that before designing anything I would agree on use cases with the interviewer. –  kevin cline Jan 15 '13 at 6:52
That doesn't make it a silly question. On the contrary, it helps to discover whether a candidate is capable of clarifying vague requirements. That's an essential skill. –  Cameron Skinner Feb 21 '13 at 20:54
It's not silly if the interviewer knows that there is not enough information to start designing anything. –  kevin cline Feb 23 '13 at 5:45
I agree with your answer & your comment above. There's always the possibility with this kind of question that the interviewer simply picked it up because he "liked it" without really realizing what it's for (asses the candidate's ability to demand the right/mandatory details to an incomplete/vague/generic problem). This in turn may lead to the interviewer treating any kind of follow-up question/clarification as a "bad approach" to the problem. –  Shivan Dragon Feb 4 '14 at 13:54
  1. I have seen this type of interviews at least 12 years ago. It is the approach I have used for the last 6 years. Experience shows that it selects better candidates for the job than the ask 20 questions and give them a score out of 20 approach.

  2. Again, I would make it very open ended too. The goal is to provide space for the candidate to demonstrate ability. Having a candidate that asked relevent questions at this stage would be a plus. As is a candidate making good assumptions, but flagging up that they were assumptions, and would need to be reviewed before implementation.

  3. I do requre all potential employees to demonstrate the skills they need for the job at interview. For programmers, they will need to implement some code, and talk about their design for it. It is very effective for preventing bad hires, but be prepared for a 90% failure rate at interview.

share|improve this answer
Making the question open ended is fine as long as I can ask the interviewer intelligently for specific information. When I was asked to do this online, all I could do is guess the solution. Do you typically ask design questions when you are doing an interview face to face? –  Nick Jan 13 '13 at 19:30
I tend to do both. A technical programming challenge, that they submit via email before they are invited to an interview, as well as different exercises face to face. –  Ptolemy Jan 13 '13 at 19:46
These open challenges do not have a single correct answer, and anything else is wrong. Their goal is to identify people that have good thought processes, make sensible decisions and to assess how much support they will need to perform the job duties. –  Ptolemy Jan 13 '13 at 19:50

The OOP questions are open-ended. There is no right or wrong answer, but there are some principles the interviewers expect to see (like using a constructor to initialize variables, keeping your methods small, using encapsulation/composition/polymorphism/inheritance when applicable, etc).

Always expect data structure, OOP, and database related questions in interviews, they are very common. Books like "cracking the coding interview" and "programming interviews exposed" can help you to prepare.

share|improve this answer

I used to ask these - back when we created class diagrams for code generation. I still do on occasion, but not routinely. I like the question because it lets me see the person think.

It is intended to be open ended. That's ok. There isn't one right answer. I don't have an answer in my mind; I want to see where it leads. I think it's a better question to ask in person, not "email in answer." It's about communication, assumptions and interaction; not just an answer!

share|improve this answer
"I like the question because it lets me see the person think" -> What exactly do you look for when you are evaluating the person's thinking skills? Is it the speed at which they solve the problem? Is it the final solution? Is it how deep they go in creating classes, interfaces? Is it how they demonstrate how much they know the OOP concepts (inheritence, polymorphism etc)? –  Nick Jan 13 '13 at 19:36
Are they methodical? Do they think of what might go wrong? Do they think of alternatives? Do they declare defeat at the odd question quickly? (I usually ask for something like a telephone, not an object most people have designed before?). I don't look for speed (unless someone takes 15 minutes before even starting to say anything!) –  Jeanne Boyarsky Jan 14 '13 at 0:08
  1. To some degree, yes. Anyone can recite syntax or copy/paste their way through a solution. We want to hire people who can solve problems.

  2. They expect you to document the design sufficiently that they can understand it (and no more than that).

  3. I ask people how they would solve XYZ problem, yes. Usually they just describe it verbally. I want to see if they ask questions to clarify requirements. I want to see how they communicate with other programmers. I want to see if they can think on their feet.

It has been helpful for me. I don't want code monkeys, I want software engineers.

share|improve this answer
I wasn't able to ask questions to clarify requirements as I was asked this as a part of an online test. I understand judging their communication skills may partly be the motive behind such a question. But does it really help understanding their analytical and design skills? –  Nick Jan 13 '13 at 19:32
@nick - dunno. Online tests are of questionable benefit in the first place. In person, it provides some insight to design skills. –  Telastyn Jan 13 '13 at 20:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.