views:

479

answers:

7

What is a good simple problem to throw at Jr. and Mid level developers to to find out given the opportunity to Program to an Interface (like a simple Factory pattern) if they will do it?

+6  A: 

Get him to log different custom messages (he can hard code them) into different types of files (he can choose an interface or not).

It's simple, and shouldn't take that long. You could help with implementing the methods if that's not the focus of the interview.

Samuel Carrijo
+1. Logging. Good call. I can have them log to flat file, xml, and database. Or something like that.
tyndall
almost at 3k. Can someone give me a boost? :P Tks
Samuel Carrijo
There you go =)
Meta-Knight
Woo hoo. Tks. Now I'm closing this question (just kidding)
Samuel Carrijo
@Tyndall I think logging is like a canonical example for interfaces. If he doesn't use an interface, there's a great chance he isn't used to programming to interfaces
Samuel Carrijo
@Tyndall or you can not tell them any specific way to log it and see what they do.
quillbreaker
+2  A: 

Don't limit yourself to that either/or. Give something big enough that a few patterns might emerge.

How about: I want to display a dashboard of some data feeds. The date comes in messages arriving on queues. Some messages being XML, some being a binary format.

Plenty of chance for them to ask questions about the contents. See how they approach that fuzzy requriement.

djna
+1. Not bad. I like this too. Conversational. And I do stuff with queue-based concepts/patterns now.
tyndall
A: 

For Jr. level developer: I would consider the example of abstract factory pattern as used by DBProviderFactory in ADO.net. Then build a similar example and see how the candidate approaches the problem.

P.K
+1. I like this too. Can also reveal how well they understand ADO.NET. Talked to someone they other day who had never used raw ADO.NET (had always used ORMs). I want to hire developers that can do both, and understand the abstractions and the trade-offs.
tyndall
+3  A: 

I don't see why there is a growing need for the use of Design Patterns. They help, but they are not a panacea. "Given the opportunity, if they will" can be construed as both a good or a bad thing on some circunstances. Besides, if they are juniors, they probably do NOT have enough experience to look at a problem and recognize that a pattern may be applicable there.

If you want a challenge for your junior and mid, then pick real challenges. There are plenty at the Valladolid website, and they have an online judge. That was what was done to me when I was at the College.

http://acm.uva.es/problemset/

Leahn Novash
Can you give me an example of what you think is a good question from there? I'm curious because you seem to discount Design Patterns. Can I ask what language you program in every day? Do you write Line of Business applications?
tyndall
Actually after looking at these problems. This is the kind of stuff I would expect my less senior developers to use StackOverflow for. 25% of these might work though. +1 for the resource.
tyndall
Maybe this is going a little far, but from a business perspective if I have developers spending more than an hour on a problem without going to StackOverflow, Usenet, Forums, Google Groups, Twitter, etc... I might have to fire them (if it were up to me)
tyndall
@Tyndall: I currently work at testing on my new job. Once my experience period is over, I may be moved to code in Java. I recently left a jobwhere I coded in C# 3.5. I wrote an application to control Automatic Ticketing on Highways. I don't know how to explain better in English (I'm Brazilian), so yes, I write Business Applications. The ACM problems are used for the ACM Olympics, and I was a member of the team of my College during the 3 years that the rules allow you to, but back them, I coded in C.
Leahn Novash
+2  A: 

Stick with what you know. What are typical problems that you/your development team encounter? Since you have recently worked through them, you can compare his approach to your team's.

If he approaches the problem creatively or differently he'll probably be a good fit. If he comes up with the same solution or has the same thought patterns as the rest of your team, you might not want him on board. The best development teams tend to be made up of programmers who have greatly different ways of solving problems.

JonnyD
Good points. I do look for people that compliment other talents well. +1
tyndall
+1  A: 

If having the candidate create, from scratch, code that could benefit from a factory pattern/interfaces etc. It may be easier to have a working model up and running and ask them to refactor it as they would like to see it. Might be a quicker means to the end.

You could then bundle some other "less-than-perfect" practices in with the sample to see if they pick up on it: exception handling, disposing etc.

TheZenker
I like this too. "Here is some ugly code. Refactor it." +1
tyndall
+1  A: 

I had a pretty good question during a technical test just the other day.

Generate the Fibonacci sequence upto N, create an XML document appropriately to store the individual numbers and save the XML document.

This was a Web Developer interview so there were the extras of creating a user interface to allow the user to specifiy the save location and the number of itterations (N).

If you're doing TDD you can also include unit tests of the appropariate methods for generating the Fib sequence etc.

Jamie Dixon
This would be good if you let the user swap out the sequence generator too. Maybe from Fibonacci to Primes. Then you could see if the developer thought ahead and assumed there might be 3rd, 4th, and 5th sequence generator coming. Or asked you. I really really like this! +1. Also tests their XML and ASP.NET chops.
tyndall