Refered From: http://www.hanselman.com/blog/NewInterviewQuestionsForSeniorSoftwareEngineers.aspx
I'm putting together some practice interview questions for a friend who lost his job. I thought it'd be useful to crowd-source some questions from you, Dear Reader.
These questions should be more software design focused, less technical trivia like my previous two lists of interview questions:
- What Great .NET Developers Ought To Know (More .NET Interview Questions)
- ASP.NET Interview Questions (7 years ago, can you believe it?)
UPDATE: I think we all agree (or at least we should) that if you go into an interview tomorrow and you look across the table and the interviewer has simply printed out this list and is reading from it, that you should excuse yourself and run. This isn't a "guide to how to interview" nor is this meant to me a "best practices for engineers" list. It's simply a collective brain-dump of stuff that someone who's been in the business of developing software for money for 10 or so years should have some passing familiarity with. Of course, it's assumed that the interviewer is able to detect BS. This isn't, and shouldn't be, a trivia contest. If you're going to get a job (or you're looking for hire someone for a job) it's ultimately more important to understand if someone can Solve Problems and if Their Head is Screwed on Straight. Take it with a grain of salt, friends, remember, you found it on the Internet. - @shanselman
Here's what I have so far.
- What is something substantive that you've done to improve as a developer in your career?
- Would you call yourself a craftsman (craftsperson) and what does that word mean to you?
- Implement a <basic data structure> using <some language> on <paper|whiteboard|notepad>.
- What is SOLID?
- Why is the Single Responsibility Principle important?
- What is Inversion of Control? How does that relate to dependency injection?
- How does a 3 tier application differ from a 2 tier one?
- Why are interfaces important?
- What is the Repository pattern? The Factory Pattern? Why are patterns important?
- What are some examples of anti-patterns?
- Who are the Gang of Four? Why should you care?
- How do the MVP, MVC, and MVVM patterns relate? When are they appropriate?
- Explain the concept of Separation of Concerns and it's pros and cons.
- Name three primary attributes of object-oriented design. Describe what they mean and why they're important.
- Describe a pattern that is NOT the Factory Pattern? How is it used and when?
- You have just been put in charge of a legacy code project with maintainability problems. What kind of things would you look to improve to get the project on a stable footing?
- Show me a portfolio of all the applications you worked on, and tell me how you contributed to design them.
- What are some alternate ways to store data other than a relational database? Why would you do that, and what are the trade-offs?
- Explain the concept of convention over configuration, and talk about an example of convention over configuration you have seen in the wild.
- Explain the differences between stateless and stateful systems, and impacts of state on parallelism.
- Discuss the differences between Mocks and Stubs/Fakes and where you might use them (answers aren't that important here, just the discussion that would ensue).
- Discuss the concept of YAGNI and explain something you did recently that adhered to this practice.
- Explain what is meant by a sandbox, why you would use one, and identify examples of sandboxes in the wild.
- Concurrency
- What's the difference between Locking and Lockless (Optimistic and Pessimistic) concurrency models?
- What kinds of problems can you hit with locking model? And a lockless model?
- What trade offs do you have for resource contention?
- How might a task-based model differ from a threaded model?
- What's the difference between asynchrony and concurrency?
- Are you still writing code? Do you love it?
- You've just been assigned to a project in a new technology how would you get started?
- How does the addition of Service Orientation change systems? When is it appropriate to use?
- What do you do to stay abreast of the latest technologies and tools?
- What is the difference between "set" logic, and "procedural" logic. When would you use each one and why?
- What Source Control systems have you worked with?
- What is Continuous Integration? Have you used it and why is it important?
- Describe a software development life cycle that you've managed.
- How do you react to people criticizing your code/documents?
- Whose blogs or podcasts do you follow? Do you blog or podcast?
- Tell me about some of your hobby projects that you've written in your off time.
- What is the last programming book you read?
- Describe, in as much detail as you think is relevant, as deeply as you can, what happens when I type "cnn.com" into a browser and press "Go".
- Describe the structure and contents of a design document, or a set of design documents, for a multi-tiered web application.
- What's so great about <cool web technology of the day>?
- How can you stop your DBA from making off with a list of your users’ passwords?
- What do you do when you get stuck with a problem you can't solve?
- If your database was under a lot of strain, what are the first few things you might consider to speed it up?
- What is SQL injection?
- What's the difference between unit test and integration test?
- Tell me about 3 times you failed.
- What is Refactoring ? Have you used it and it is important? Name three common refactorings.
- You have two computers, and you want to get data from one to the other. How could you do it?
- Left to your own devices, what would you create?
- Given Time, Cost, Client satisfaction and Best Practices, how will you prioritize them for a project you are working on? Explain why.
- What's the difference between a web server, web farm and web garden? How would your web application need to change for each?
- What value do daily builds, automated testing, and peer reviews add to a project? What disadvantages are there?
- What elements of OO design are most prone to abuse? How would you mitigate that?
- When do you know your code is ready for production?
- What's YAGNI? Is this list of questions an example?
- Describe to me some bad code you've read or inherited lately.
Your thoughts? I'll add good questions from the comments throughout the day.
Name three primary attributes of object-oriented design. Describe what they mean and why they're important.
It amazes me how so many developers out there think that OO is nothing more than "classes with methods/members on them" and maybe "inheritance for sharing functionality." Also, I've found myself in some really interesting conversations with good developers on this subject. It segues pretty well into other topics too, such as some SOLID principles and interfaces.
The one challenged I've had is that a lot of these concepts weren't covered in my college courses and many of these concepts haven't really come up in my career as a developer. Do you have any good recommendations for resources to learn more about these topics? I'd like to expand my horizons, but it's often tough to find articles and resources that focus on concepts rather than implementations.
I'm poor at remembering theory. Advantages and disadvantages etc, purpose of things, sometimes interviews are a nightmare!
And based on _that_ answer you can start digging for things like patterns etc ... the person used during these projects.
Explain the differences between stateless and stateful systems, and impacts of state on paralellism.
Discuss the differences between Mocks and Stubs/Fakes and where you might use them (answers aren't that important here, just the discussion that would ensue).
Discuss the concept of YAGNI and explain something you did recently that adhered to this practice.
Explain what is meant by a sandbox, why you would use one, and identify examples of sandboxes in the wild.
Signed,
Scott Hanselman, 23 successful projects, 3 failed
2) Can you explain the difference between essence and ceremony?
3) Can you explain convention over configuration? Can you give an example of it in action?
Good interview questions are really hard to come by. Good luck!
2. You've just been assigned to a project in a new technology how would you get started?
And you might ask some questions with more of a functional spin. What does composition mean in an OO and a functional context? What's the difference between a function and a predicate?
Also, this might be useful: http://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions
I might add something about incorporating SOA/data services/etc into application design and when is it appropriate.
I consider myself a very good developer. Maybe I'm just not "senior" enough...
How many of these questions would you expect a candidate to answer correctly?
The projects after the name may be good for a role like this, but for someone just starting out it's going to be a little difficult.
Another pretty horrific question I got today was basically, the interviewer wrote some code on the board, and I basically had to describe the state of the stack and the heap after each line of code. I guess to demonstrate an underlying knowledge of the technology.
How many people would actually be able to do that, without having to read up to refresh their memory first? Genuinely curious.
I second the vote for giving them a keyboard and actually watching them program. Pair program, if possible.
Failing that, hand the candidate a printout of actual code, in a language she'll be working in if hired. Have her code-review it. You can seed it with a range of problems: say, unchecked nulls, uninitialized collections, publicly mutable fields, to more subtle and arguable things like a function with multiple exit points, or a call to a virtual member from the constructor.
Also, even though I'm mostly against definitional questions in interviews, I'd expect a senior dev to be able to define cyclomatic complexity.
Agile Principles, Patterns, and Practices in C# which I believe is a updated version of Agile Software Development, Principles, Patterns, and Practices originally written for Java. I would strongly recommend Agile Principles, Patterns, and Practices in C# as a good read if you do object oriented development. Even if you have been doing OO for some years I have found it a good as a reference book to go back to occasionally and get refreshed on the concepts.
"Tell me about 3 times you failed"
Do you read other peoples code on a regular basis? What is the last open source project you read?
What is your preferred programming language/platform? Why do you prefer it over others? Also, what don't you like about that language/platform?
What is the last programming book you read?
If you were required to look into and learn about a new platform/technology/language to get an understanding of what it would take to get the dev team started with it, what would you do?
--
Who really cares how much someone knows, if they don't do much to keep learning more? You also need to get an idea of how they think or approach a problem.
Describe to me some bad code you've read or inherited lately.
Can you describe some code smells?
>What's the difference between Locking and Lockless concurrency models?
I assume you are asking about Optimistic and Pessimistic concurrency here? If not, what is that above... I don't think I've heard those terms... I pretty much "think" I could give pretty good answers for all of the rest.
BOb
BTW, I find Singleton to be the most often quoted (and usually misapplied) pattern. Interesting that you zeroed in on Factory.
In addition to interview practice, which is a good idea, I'd advise your friend to get busy with a project (possibly open source). It will keep his chops up, and is a great opportunity to learn something new. It also makes a fantastic story to tell a potential employer (and would provide a good context for answering these kinds of questions).
Describe a pattern that is NOT the Factory Pattern?
9 out of 10, when I ask for known patterns, I get Singleton and Factory, and only these two. Usually without the distinction between Factory Method and Abstract Factory.
What is deferred execution? What role does it play in stateless/stateful systems?
Describe a situation where contract first design is beneficial. Discuss a situation where it is not.
When should a server technology dictate storage mediums? When are there good cases for a client to specify how/where/when their data is stored.
Great thread. Thank you so much for starting this.
With that framework in place, both the developer and I get to talk about principles and patterns in a more meaningful way. The developer gets a chance to show me what he knows in a practical manner. More importantly, I get to see how the developer communicates on his feet.
That said, I might ask:
- Left to your own devices, what would you create?
- What elements of OO design are most prone to abuse? How would you mitigate that?
- Why might it be bad to "burn the base class"?
But my problem is, you can know all this stuff and still suck at writing software.
In fact it can make you suck even more at writing software...... implementing massive n'tiered, pattern bloated, acronym compliant, software. Adding 1 tiny thing can ripple through lots of layers of software and it becomes *slow* to do anything. TDD tests that just test layers and layers of CRUFT. Kool Aid frameworks. Hopeless.
I have a very different expectation of a "senior" or "lead" developer than I do of an entry-level one. I expect that a senior dev has an ability to interact and communicate with others. I expect that they do things in a given way for a reason, and that they are analytical and reflective enough to tell me why. Open-ended questions with no clean-cut correct answer are perfect for evaluating these things.
Furthermore, conceptual questions about practices and trends help to reveal where a person's motivation comes from. Are they learning in response to the immediate needs of their day to day work? Or are they going beyond that and investing in themselves by stepping outside their comfort zone and immediate environment? Are they hidden away heads-down in a corner grinding alone on all their challenges, or are engaging with the community to find new and better ways of doing things?
I expect a senior dev to do more than just sit there and write code. I expect them to think, reflect, be aware, communicate, and invest in themselves. Candidates for such positions should absolutely be asked questions that foster a conversation where they can illustrate those skills and values, or fail to do so, as the case may be.
- What value do daily builds, automated testing, and peer reviews add to a project? What disadvantages are there?
- How can you mitigate technical debt?
"- Left to your own devices, what would you create?"
Now THAT is a hard question. That's a cert for mind-blank syndrome.
If a person can't tell me why they like a certain tool, then I don't think they have much experience using a wide variety of tools. If they can't tell me what they dislike about a certain tool, then I don't think they've really spent enough time using it.