I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...
With senior guys, after you've asked the pesky "what is the difference between an abstract class and an interface" type questions and had them write some code on the board, my preference is to have a conversation with them about application architecture. When do you use different design patterns, what are the strengths and weaknesses of various models, how do you balance scalability, reliability, responsiveness, and so on. Don't make this a quiz -- make it a conversation and let it go where it takes you. This is a much easier way to figure out whether the candidate has really done what he's talking about, as opposed to having read about it.
ReplyDeleteCan an interviewee design good software? Rather than, can an interviewee swap two ints without using a third temp variable?
ReplyDeleteBasically what I'm saying is that silly puzzle questions are not as important as real-life questions.
What is the flaw with the Stack class?
ReplyDeleteExplain the Java Class loader mechanism. How would you prevent someone from overriding the java.lang.Object class?
Can interfaces contain inner classes?
Explain how you would get a Thread Deadlock with a code example?
What happens when you try to serialize a class whose base class does not implement serializable?
What happens if you try to pass an int variable to a function that accepts only:
a) long
b) Double()
c) Number() ?
How can you prevent flow of control to a finally { } clause?
I write two classes : I write a static method in the base class and override that static method in the child class. Will this code compile?
Write a program that prints a.b.c.a.b.c...and so on 100 times using threads?
What happens if you try to start a thread thats already been started?
Some of these may be thinkers!!!
It may seem odd for a senior position but make sure to have your interviewee solve a somewhat challenging problem by actually writing code on the whiteboard. There is no easier way to really assess the skill of a programmer (especially a senior one) than seeing her think through a problem and scribble some basic code. You will be surprised how many people you can weed out with this simple test.
ReplyDeleteA good way to approach interviews like this is to ask:
ReplyDeleteWhat is good about a relevant technology that is currently much maligned.
What is bad about a relevant technology that is currently being hyped
The fine detail of technologies that are relevant in a small (but relevant) number of cases.
JEE specific examples would be:
When would you advocate building an application based around RMI and EJB?
What would worry you about adopting Spring as your Dependency Injection tool?
What types of application require remote management and how would you approach this using JMX?
Under what circumstances does the default JEE security model prove inadequate and what alternatives would you suggest?
Ask them about their knowledge of development process. They're not senior if they think you "just hack away".
ReplyDeleteBeyond that, ask them about testing, tuning, monitoring, systemic qualities (scalability and scaling, maintainability etc.).
How does garbage collection work?
ReplyDeleteHow do you create a thread dump?
How do you profile an application?
What's new and/or up and coming in the industry?
What are you weaknesses?
What frameworks would you use to develop your dream application?
"Can I see some of your code?"
ReplyDeleteClarification:
I wouldn't imagine asking them to login to their past/current employers system and pulling code out of the repo.
I am assuming any competent programmer writes more code than what they do at work.
In our shop seniors have dual responsibilities. Knowledge of programming/design standards is important but I've found that what really separates people is their ability to work with others on the team who are both senior and junior level. I'd ask them to describe a previous team coding experience and the worst team interaction they have experienced. At the very least you might find out what they deem worthy of arguing over.
ReplyDeleteJava EE is too broad for anyone to know it all in detail so don't expect them to know any specific area in detail (unless it is imperative that they use that area immediately) but do expect them to know a few areas in detail.
ReplyDeleteWhat Unit Testing framework do you use? If they don't you, don't need them.
ReplyDeleteWhat is the version control system you use? If they don't, you don't want them.
Why would you choose Beans over Portlets? If they answer this question you really don't want them. A senior person would immediately state that these approaches are obsolete and should not even be a choice to start with.
Ask about transactions (how, why), exceptions and the different behaviour scenarios one can end up with. I found that to be a challenge for a lot of (even senior) Java EE people.
ReplyDeleteAsk about the various database locking schemes and how you set them in Java. Ask about EJB interceptors. Ask about durable messages.
ReplyDeleteAsk enough questions so they will say something like "I don't know but I can learn."
ReplyDeleteAsk about their passion for programming. Why do they like programming? What kind of programming do they like best? Why did they become a programmer? Why did they start and end their last positions?
ReplyDeleteYou should have go through these Excellent Java,J2EE Interview questions with answers
ReplyDeletethe single best question i have found is this: "Tell me about good software and good developers." Just be quiet and let them talk or whiteboard.
ReplyDeleteThe good ones will instantly light up, because they have put plenty of thought into this already. The poor ones will look panicked and stumble a lot. The best ones will give a good answer then ask the interviewer to answer the same question.
Please describe the MVC design pattern and any related patterns.
ReplyDeleteAnyone who doesn't come up with "Observer / Observable" and can explain why is right out for me. That pattern is way to simple and way too useful and way to pivotal to MVC to be missed.
Ask them at least some questions that haven't been posted on the web as an interview questions so that they won't know ahead of time what the best answers are.
ReplyDeleteHow do you make a class thread safe?
ReplyDeleteWhat are the main benefits of using Spring on a project ?
ReplyDeleteWhat is AOP ?
How hibernate implements lazy loading ?
What is the second level cache in Hibernate ?
What are the main new features of Java5 ? Same question with Java6 ?
What are the differences between various frameworks:
ReplyDeleteStruts vs Wicket
Spring vs EJB
Hibernate vs iBatis
I think senior needs an ability to find non-standard solutions.
ReplyDeleteSo one of my questions would be
What would you do if for some reasons you can not use any database?
Another senior's skill I think is knowlege what is right and wrong and why. So my question would be
Analize given application and tell me what is wrong with it.
What could be better in JDK or Java EE?
What was your biggest bug in last year?
One more important senior's skill I think is ability to share his knowlege with juniors. So my question would be:
I'm junior and
Tell me what Spring (EJB, Hibernate) is for. Don't forget, I'm junior. Dependency injection - wtf is that?
What's wrong with my class with 50 static methods? They work!
Requirements say I need a logo in the header on every page. So it is requirements duplication, not code duplication. What's wrong with it?
Communication with management is also very important, so I'm your manager and I wrote my last line of code in university 10 year ago and
Tell me why did you decide to use REST instead of SOAP in this project? Don't bother me with technical details, tell me how do we earn money on it.
Which Java EE framework do you like the least and why?
ReplyDeleteWhen is it a good idea to use IoC?
What languages/platforms other than Enterprise Java have you used recently, and what did you do with them?
Is there a design pattern or language idiom that you think is overused? Why?
When would it be a good idea to use an ORM framework? When would you avoid one?
What techniques have you employed to monitor production systems?
Describe the details of a past project. (Make sure they can answer details clarification questions.)
ReplyDeleteI tend to ask a few basic technical things about boring things like design patterns, and ask them to cite examples in the Java API where those java examples are. A lot of the questions listed previously are fantastic!
ReplyDeleteFor a senior engineer I personally tend to concentrate on soft-skills more than anything. A senior engineer should display strong leadership and technical skills, not just technical skills.
Some questions about difficulties on previous projects and what was done to deal with them. Dealing with difficult people and how to motivate them etc. etc.
I think when you get to a senior level you can probably pick up a new skill quite quickly, however the best senior engineers are the ones that can manage people, and especially teams of people, who can mentor others, who aren't afraid of dealing with customers and public speaking, and who will contribute positively to a team. I've seen some teams go downhill really fast when you get some really talented technical people who have no soft-skills whatsoever.
Technical skills are important, but the higher up you go the other skills become as (or even more) important.
Some of my favorite questions
ReplyDeletea) What is System.out.println . Break up eaah word and explain to which class or interface they belong
b) result Set , class or interface
c) x no of users are connected to a website. I want to increase the load 10x . How I make sure my site is able to handle 10x load ?
Some other questions can be found at Skill-Guru
I like to think of a problem that I've had to solve, or maybe make one up, that has a lot of different solutions. When the candidate comes back with one answer, I say "well what about if this was the case..." and see how they respond. I think it's a good way to get a feel for how broad of a range their knowledge covers and how well they can think on their feet.
ReplyDeleteLately what I've been asking in this vein is... "let's say I had a web application with a large number of URLs... and I wanted to log every time a user visited a page in the member section, with the url path starting with '/member'. How would I do that?"
One thing I enjoy about java is that you write code to do just about anything now with the rich api's, frameworks, toolkits, etc... With that being said, while there are certain basics a Sr. dev should know, the principle behind asking any question is would they be able to figure out a problem and come up with a workable solution? Asking specifics about Generics or threads or anything else may not work for this.
ReplyDeleteMyself, I study a list of java questions before going to any interview, but lots of developers do that. What seems to convey what I know best is when I explain things in laymans terms to Project Managers and technical answers from what I've done or could do to the technical person, in my own words. Not some pat definition I've memorized from a book, but really explain the underlying concept. Like what is Web 2.0? for example.
When I do that, then my passion for my work comes out I think. I'm not just doing this for a paycheck, although the paycheck is important! It is a challenging field to work in, you can't know everything, but it's very satisfying at the end of day of hard work.
Fizz Buzz is always a good one.
ReplyDeleteIt's not Java EE specific, but it will separate the wheat from the chaff.