There are several topics about what questions will be raised in an interview for a programming job, but none actually talk about a small problem that some companies want: an example program.
My question is based on my last job application, where I’ve been asked to create a simple program and send it to them.
Well, this raises several questions:
- what kind of program should I write?
- what should I implement?
- what should I use as a show-off for technical stuff?
and mostly importantly (been several users of SO that person that review the code) what is the company expecting?
My current idea is to create a simple Blog using an XML file to store the data, and if required build a simple one ASP.NET page with add/edit/delete functions, and create a window forms as well a command line application that would do the same.
things that I should NOT avoid:
- comment all the code
- use regions to divide code
- create class object to use with the ‘blog’
and should I:
- use Interfaces?
- use
virtualand override some method (myBlog.ShowPost()for example)? - apply any design pattern?
- use a Helper / Utilities Class?
- use DAL and BLL?
how about ‘shipping’ should I…
- use MSI (to prove that I can create nice installers)
- just send the code as a Visual Studio Project
Any idea of a simple program, and exactly what should be in the code is greatly appreciated 🙂
Use the opportunity to show them you know how to treat a client. Start a conversation on what is important, how do they want it delivered, what is the timeline, would they want a documentation and so on.
If they don’t want to give you any particular problem to solve, try to write a program related to the domain of their main product. Or at least stick with some of the technologies they use.
Be sure that whatever you deliver to them is complete enough and contains source code and deployment package. Make sure you have good enough documentation, so that a technical person is able to build your program successfully with at most two three simple steps. Make the deployment package simple enough, so that a non-technical person could quickly run your program. It doesn’t have to be MSI, a batch file that copies all the files would suffice, as long as it’s a single command.
Make sure your code is well organized and commented. Avoid writing obscure code hacks and unnecesasry optimizations. Find a set of good coding guidelines (SO has several threads on that topic) and stick with them.
Avoind the Commando Pattern. 🙂 Use design patterns you feel comfortable with. Use interfaces, inheritance, abstractions and the proper architecture layers where appropriate.
On other words, write the code so that a programmer with a lower skill than your would be able to undestand and maintain it.
Using external code in your program would be ok, as long as you make sure they are aware of that. Be clear where any code came from and what license it was published under.
As a side note, add a license to your code that prohibits republishing or reuse for commercial purposes.
All that above sounds a bit too complicated, but that’s what professional developers do – they don’t just write code, they deliver a product.