Tag Archives: job interview

My Favorite Interview Question

Recently I have been doing some job interviews (as an interviewer, not a candidate). Although I hate being schematic and try to come up with new & interesting questions for every candidate, I always ask My Favorite Interview Question, which is:

What are the benefits of using Dependency Injection pattern?

The answer for that immediately tells me, whether the candidate has broader horizons or is just a doing-what-I’ve-been-told-to-do drone.

So, what’s a bad answer? Anything along the lines of “DI allows you to configure your dependencies and inject them by a framework.” Seriously, that’s an answer that I would come up with if I had not even the faintest idea what DI is, and I get it from developers who claim several years of experience, working with Enterprise Java and all that stuff.

Even worse: candidate mentions XML in the first sentence. I mean, what are they thinking? Is “using XML” among the benefits of Dependency Injection? (I would say it’s a cost, not a benefit, but let’s leave that for another rant.) My point is, DI and XML are concepts from totally different and unconnected levels.

When you use DI, you might want to have your dependencies automatically injected, for that you might want to use the Spring framework (if it’s a Java project), and then you might want to configure it with XML files. See how many steps it takes to connect DI and XML? On each step you could decide to use something else, so there’s a good chance that you end up with no XML at all. And yet, XML has been imprinted so deep in Java developers’ brains that you might hear “DI lets you configure your classes with XML.”

OK, so what qualifies as a good answer (at least according to me)? Anything from “DI improves testability because you can easily mock dependencies” to “DI enables loose coupling” to “DI enables flexibility” to “I don’t see any benefits of DI, therefore I don’t use it” even.

In fact, any answer in form of “I don’t see benefits of X, therefore I don’t use X” is better than “I use X because they told me to/everyone uses it/that’s how it was always done.” It shows that you made a conscious decision about using or not using X. Of course, I would still like to know why you don’t want improved testability or loose coupling. But at least this is something that can be further discussed.

And the best answer would be that you don’t use DI, DI just happens when your code is testable and loosely coupled. So, if you happen to be interviewed by me, you will be asked this question, too. Now you probably know what answer would satisfy me. And if you get the job, that would probably be the first case of someone benefiting from reading this blog :)

On salary negotiation during job interview

I have mixed feelings after reading the article The answer to the toughest interview question on salary negotiation during job interview. Also, there is much valuable advice in the over 160 comments, but some of them only deepen the confusion.

Penelope’s advice is to never give your desired salary, but make the interviewer state their range first (using your slick negotiation techniques). Some of the commenters agree with this while other say that it’s best to simply state a number that will satisfy you and you’ll either get a job with a satisfying salary or not get a job that you would not accept anyway. I’d like to share my experiences, which are somewhat different from most of the people commenting there, mostly because the situation and apparently the law is different here in Poland.
Continue reading

Teh worstest answer on a job interview ever

I was asked by our company’s HR guy to take part in a job interview with a candidate and ask a few “technical” questions. The candidate was final year undergraduate at the Technical University and hasn’t worked anywhere yet (at least his CV was silent about it), so I prepared really easy questions for him. The interview started like this:

Me: Can you tell us about some of your bigger projects? What were they about? What technologies did you use?

Candidate: Well… I haven’t done anything bigger. Only the tasks they gave me at the university. And some examples from the books.

Continue reading