Someone has read my post about interviewing where I wrote about String reversal, but got it totally wrong. Ironic. He didn’t show much attention to detail, took quotes out of context, put things into my mouth that I’ve never said and concluded “Want a job? Reverse a string. The sad state of job interviews today.” This post even got to DZone. So my post could also be titled: The sad state of DZone today.

Most of my interviews are 1h to 1.5h and sometimes 15 minutes of the interview is about reversing a String. This is mainly to get into the thinking of the candidate, see how he deals with fringe cases (null values as arguments) and if he chooses a JDK reverse method or not. Jonethen didn’t pay much attention to detail, so for a starter he got my name wrong, it’s Stephan not Stephen. A minor detail but a sign for what was to come later in his post and the comments.

Jonathan is angered by my mentioning of the recursive version of reversing a string. Although I wrote why I think it’s interesting to discuss a recursive solution, he ignores my arguments and writes

“.. only that he would be much more impressed if someone did write it out.”

I didn’t say that.

“He would probably give higher preference to someone who did use that technique,…”

No I won’t and I didn’t say that either. I said “The best implementation in Java is to use the reverse method of the StringBuffer class in the JDK.” I specifically pointed out that the reverse version is impractical in Java for the immutable String class alone, not to mention the surrogate pairs problem. So to make myself clear again, the best solution is to use the reverse method of the StringBuilder class. Any candidate who uses this method has already impressed me, because from my experience very very few developer know this. Most would write some kind of array swap method. But it’s not the cause I ask this question. It’s to see if someone can write code (which doesn’t need to be compiler ready, he’s no IDE in the end) and get into a discussion about programming, unit testing, fringe cases, how to handle errors, quality assurance and other topics. And if someone has read this blog? Or another blog? And knows the answer? Well good, the answer is just the beginning. And considering that very few developers read blogs and articles to learn something new, I’m happy to interview a candidate who reads blogs in general.

Without getting personal, I look for more attention to detail in the candidates I have than Jonathan did when he did shred my post. And I look with far more attention to detail into candidates than Jonathan did use when reading my post. Ironic.

One poster in the comments of Jonathans post suggested using StringBuilder instead of StringBuffer, because StringBuilder is not synchronized and faster therefore. I think modern VMs can use escape analysis to detect synchronized blocks or methods which can be optimized away, as in the local usage of StringBuffers. There should be no difference between StringBuffers and StringBuilders in modern Java VMs. But it doesn’t hurt to use StringBuilder.

Ending his article: “If a interviewer wants to talk about my past projects with me, then it should not take him long to realize that I am a competent.” Or read a blog, as Jonthan suggested in Blogging gets people hired.

Hopefully he doesn’t read your blog.

Peace
-stephan

PS: I wish I don’t sound the least bit like Hani ;-)


21 Responses to “Job Interviews for Java Developers: Attention to Detail”  

  1. Gravatar Icon 1 Michael Easter

    I’m with you, Stephan. I really like the interview technique of providing a simple code sample or problem and then letting the person talk about it in an open-ended way.

    Those who say “what a silly example” don’t really get it, IMHO.

    Some examples:

    (a) I once saw Stuart Halloway show a stacktrace (in a talk) and wonder out loud if he could talk for an hour on that stacktrace. I bet he could. Would you pay to hear James Gosling talk about reversing a string for 15 minutes? Jonathan might not; I would.

    (b) I don’t know much about art, but I’ve learned that the still-life paintings (e.g. an apple, a fruit basket) are not so much about the immediate subject but rather what the artist has done with it. The reaction should not be “it’s a silly apple” but rather an appreciation the way the subject was handled. Would you pay to see Rembrandt or Picasso draw an apple? Many people have.

    (c) Blues music is based on traditional chord structures and licks (melodies). Just like the apple, these aren’t always new. The point is what the person can do with them, and the style that surrounds them. A good interview candidate should be able to talk about reversing a string just as a good guitar player should (happily) play a Chuck Berry riff (w/ his or her own style).

  2. Gravatar Icon 2 stephan

    Hello Michael, thanks for you insightfull (for me) comment. I agrree with you on a,b and c. Interviewing is about having a dialogue. Whatever way it’s started.

  3. Gravatar Icon 3 Adam Malter

    We also having been doing much interviewing lately and small code snippets are by far the best way of really plumbing someones skills.

    When you just talk about past experience, you often miss out on what roles the person performed. It’s a bunch of WE did this, or OUR team did that.

    Often I have found that charismatic and boastful shine during the experience yak, no matter their development prowess. So you lose the modest and quiet, but skilled programmer.

    Your example is an excellent place to start an interview. It helps you with a sniff-test first of all (you would surprised how many people who are certified 8 year ‘veterans’ don’t know what a HashMap is) - And, it can start interesting TECHNICAL conversations. Your looking for an engineer, a technician, a person who loves the code. This type of person won’t mind for a second geeking out with you over even the simplest piece of code.

    I recommend a step further though. We do a 45 minute walk away code assignment where we have the candidate fill in a somewhat trivial implementation. Then we come back, run some unittests on it and chat about design decisions and stylistic choices. Really, it doesn’t matter if it runs, it’s the conversation that matters.

    I feel like you know this, but, other’s don’t, and let them be. They can hire the unqualified. With google stomping the market it’s hard enough as is. I can send Jonathan plenty of folks who can talk his ear off - Just don’t ask them to code anything.

  4. Gravatar Icon 4 stephan

    Hello Adam,

    good ideas. I’ve also experienced “It’s a bunch of WE did this, or OUR team did that.” where it’s hard for a novice interviewer to go on and dig deeper. As you said, what role did he fill, what did he really do? Sometimes people claim to have experiences in lots of technologiies from a project where in the end they only put the HTML together.

    Someone with good speaker skills can impress you during the CV and projects talk, it’s much harder for someone to talk you over with some code. And I had the same experience in the past: people with lots of projects knowledge who couldn’t write or discuss code. Or who got very angry when I criticized them for some code they wrote (They need to defend their code, and be enthusiastic about what they do, but don’t get angry).

    The idea with the code away assignment is a good one. I think about that one and perhaps try it in the future, when I can adapt our interview process accordingly.

    “With google stomping the market it’s hard enough as is.” And in Germany after 2 years of economic rise I have the feeling, most good people already have switched jobs who wanted to. Hard to get good new ones to interviews.

    Thanks for your contributions.

  5. Gravatar Icon 5 David Lee

    I would hate to be in an interview with. Discussing a recursive solution for reversing a string demonstrates your arrogance and nothing about a programmers programing prowess.

    And clearly arrogance isn’t too strong a word as you’ve already determined that “very few” know about stringbuffer reverse and “few” read blogs and articles. As if you’ve inteviewed most. The most you can say in this regard is most of the people that you’ve interviewed didn’t know, but how many people is that ? I suspect, most college CIS students can answer this question if provided in the proper context.

    I’m about tired of employeed smarty pants talking and writing about interviewees. As someone who’s been on both sides very recently, I’ve determine that there is a lack of good interviewers.

  6. Gravatar Icon 6 stephan

    “I would hate to be in an interview with.” Me probably too with. “I’m about tired of employeed smarty pants talking and writing about interviewees.” Me too. Mostly I’m tired of people who think they know me from a blog post, pull quotes out of context and get personal and insulting. “I’ve determine that there is a lack of good interviewers.” As there is a lack of good commenters sometimes it seems. But I guess I have to live with that.

    On a more serious note, there are studies which show that most developers don’t read blogs and don’t read articles. Go google.

    “As someone who’s been on both sides very recently, I’ve determine that there is a lack of good interviewers.” Self insight is a good thing. Yes, some of the interviewers get personal and insulting.

    Peace
    -stephan

  7. Gravatar Icon 7 David Lee

    Yes, everyone takes your comments out of context yet they are there for all to read. And no, it’s not insulting or arrogant even, when you make sweeping comments about most developers. Let’s just all agree on everything you write.

    I’ve been developing for about 12 years and I meet interviewers, like you, asking me to do a reverse string implementation. Real story, I get the call for the interview, spend a few hours reviewing and brushing up on my project mangement ideas, design patterns and j2ee technologies and get asked to write a reverse string implementation for a Senior Developer position.

    Again, if a reverse string implementation question is your best interview material, dude, the problem is the interviewer.

    And the answer to this question too can be google’d. Clearly, it’s not a good question for anyone but a entry level candidate.

  8. Gravatar Icon 8 stephan

    “… like you, asking me to do a reverse string implementation.” I thought we haven’t met, let alone have I interviewed you. So how do you know what I do in an interview?

    Reading the actual post would help though. Most of my interviews are 1h to 1.5h and sometimes 15 minutes of the interview is about reversing a String.

    “Real story, I get the call for the interview, spend a few hours reviewing and brushing up on my project mangement ideas, design patterns and j2ee technologies and get asked to write a reverse string implementation for a Senior Developer position.”

    This happened to you? They only asked the string reverse question? Nothing else? I wouldn’t like to work for them.

    “I’ve been developing for about 12 years.”

    Then it shouldn’t be a problem for you to write the method.

    “Yes, everyone takes your comments out of context.” Yes, obviously, just like you do. Most of my interviews are 1h to 1.5h and sometimes 15 minutes of the interview is about reversing a String. The posts are about interviewing and about one detail of a longer interview, asking a development source code question. And which I wrote several times that this is just the beginning and “From there it’s an open field. You could ask the candidate to write a JUnit test for his reverse method. Not only can he show how to write a unit test, but what he considers as test cases (””, null, “A”, “Even”, “Odd”, ….).”

    But in your comments this somehow mutates to: “Discussing a recursive solution for reversing a string demonstrates your arrogance and nothing about a programmers programing prowess.”

    “Again, if a reverse string implementation question is your best interview material, dude, the problem is the interviewer.” Most of my interviews are 1h to 1.5h and sometimes 15 minutes of the interview is about reversing a String..

    “And the answer to this question too can be google’d.”

    Reading the actual post instead of ranting and insulting people, you would have found “Which is quite as good, because googling in reality will help him find the JDK solution.” But obviously you haven’t read the post. I hope you give more attention to requirements you implement than reading blog posts.

    Peace
    -stephan

  9. Gravatar Icon 9 David Lee

    I read the post, and your replies. And the fact remains, this is a dumb interview question and demonstrates almost nothing about one’s ability especially when get this consider that you get this functionality for free and there isn’t much room for improvement on the free implementation.

    I also read the original post and your replies. And there is a clear pattern in all of your responses to anyone that doesn’t think this is a useful exercise.

    It’s an awful interview question, even if it’s just 5 seconds of the interview.

  10. Gravatar Icon 10 stephan

    “… there isn’t much room for improvement on the free implementation.”

    Well there is, but obviously you haven’t read the post about unit testing, fringe cases, error handling and interfaces.

    Compressing your comments leaves me with: “… dumb … awful … dude … the problem is the interviewer … your arrogance … clearly arrogance … hate … employeed smarty pants … lack of good interviewers … ” Clear pattern? Go figure.

    Peace
    -stephan

  11. Gravatar Icon 11 stephan

    @David: I shouldn’t have answered, your’re comments where not about discussing the best way for interviews they were just rants and insults. So I should have stopped sooner which I will do.

  12. Gravatar Icon 12 David Lee

    How big of you. My comments don’t a clarification from you. They’re pretty clear.

  13. Gravatar Icon 13 Mark

    Come on people grow up, it’s the internet for christ sake.

  14. Gravatar Icon 14 stephan

    @Mark: Yes, you’re right, don’t feed the trolls, I forgot.

  15. Gravatar Icon 15 Eric

    Hi,

    Let me add a (peaceful) comment about my own practice.

    I did the string reversal interview too and really what I appreciated the most was coding with someone during the interview. If you hire someone to do some development, it’s hard no to see him develop. But Reginald says it better than me: http://weblog.raganwald.com/2006/07/hiring-juggler_02.html,…

    Right now, I have switched to another simple exercise, which I took from “daily life”. Write a function which will return a list of pairs of currencies from a list of currencies (financial software,…).
    And I give examples:

    List() -> List()
    List(”EUR”, “USD”) -> List(”EUR/USD”)
    List(”EUR”, “USD”, “JPY”) -> List(”EUR/USD”, “EUR/JPY”, “USD/JPY”)

    And I ask people to develop that using JUnit in a TDD fashion: first we write the test, then the code. If they don’t know JUnit, I provide examples and they fill in the blanks.

    Here are my observations so far, which are aligned with yours, Stephan:

    -it is the only way to know if someone is really a programmer or not. I have been very badly surprised by people who should have a good development experience based on their resume and who were not able to produce some working code in a reasonable time. For example, they can talk about the difference between an interface and an abstract class during the interview and not know how to use the List interface in Java.

    -very few people I’ve met (since we’ve began the interviews two months ago in Tokyo) can develop the last case. We usually have to stop after the second test case because of time

    -this shows a lot about programming habits: naming conventions, exception handling, code layout, data structures, knowledge of the language (java: imports, generics,…), etc. I am also astonished by the number of people using Eclipse every day (that’s what they say,…) and not knowing shortcuts or refactorings

    -I would also be very happy to see someone come up with a recursive solution because I personally find it quite elegant. Never happened before,… Let alone talk about tail-recursion! Even though, you can be a good developer without this (but I suspect that excellent developers would at least mention the option)

    -This is a very time-consuming exercise in the recruitment process. I would like people to do the exercise and perform better. Watch them agonizing over a List interface is not my greatest pleasure in life. So right now we resorted to a silly java questionnaire to try to bring more relevant candidates to the table. If you have better ideas?

    -Even if they don’t perform so well, the candidates always learn something out the exercise and I try to share with them as much as I can. We’ve had very good feedbacks about the interviews so far.

    So my conclusion is: please, let me code during my next interview! I may not know if StringBuffers are really optimized by the JVM under specific circumstances but I will just have the opportunity to do something I love. And I hope it will show!

    Eric

    PS: BTW, if you want to work for a financial software company in Tokyo just ping me! You can come up with a perfect solution coded during a one-week break, I’ll be happy to discuss it. And the fact that you read this blog is your first “good point” on my list!

  16. Gravatar Icon 16 stephan

    Thanks for your long post, I share your experiences. “Watch them agonizing over a List interface is not my greatest pleasure in life.” I know. I also try to explain the answers they don’t know or help them with the exercices, so they might learn something from the interview. And it wasn’t useless even if we don’t take them.

    “BTW, if you want to work for a financial software company in Tokyo just ping me!” Ah, Tokoyo :-)

  17. Gravatar Icon 17 stephan

    “And clearly arrogance isn’t too strong a word as you’ve already determined that “very few” know about stringbuffer reverse and “few” read blogs and articles.”

    To explain my comments about developers reading blogs and reading articles. Several people share my experience and opinion.

    See for example

    http://www.codinghorror.com/blog/archives/001002.html

    and

    http://blog.red-bean.com/sussman/?p=79

    “There are two “classes” of programmers in the world of software development: I’m going to call them the 20% and the 80%. The 20% folks are what many would call “alpha” programmers […] The 80% folks make up the bulk of the software development industry.”

  18. Gravatar Icon 18 stephan

    Coding Horror proved my point.

    http://www.codinghorror.com/blog/archives/001008.html

    Most (all?) people would write a shuffle on their own instead of reusing the JDK version.

  19. Gravatar Icon 19 Robin

    There’s a lot of ranting going on about how useless this interview question is, However, there is no example or idea on what a better question would be.

    Whilst it may be true that some very experienced developers would find it an insult to be asked to perform such a simple task in an interview. I personally would find it more of an insult if my full coding ability could be proven by any question in an hour long interview.

    The point of the interview is to gain insight into the candidate and the company. This is all based on the types of questions asked, the way they are asked and the way they are answered. The good candidate will be the one that thought the questions were great and that answered them the way the interviewer wanted them to. This will provide a candidate who is on the same level as the interviewer which is far more important than defining any level of coding ability.

    One thing to remember however, I don’t care if you have 2 years experience or 20 years, one day, you might just have to reverse a string.

    Robin

  20. Gravatar Icon 20 stephan

    @Robin: Exactly. Especially “… insight into […] the company.” I’m often astonished how little candidates want to get insight into our company. Wherever I applied for a job, at least I wanted to see where the developers where.

  1. 1 String reversing Part II: Tail Recursion at Stephans Blog


Leave a Reply



RSS