I would suggest to not write something new, but find a piece of code that you have written earlier to show where you are proud off.
Anything advanced but know problem, like a quick sort implementation, might maybe impress, but also raise doubt whether you have written it yourself. If you show some code excerpt of the boring business app you wrote where you made something beautiful and clever, this gives a better image of you.
If you can't show any of your previous work (because your previous employer doesn't allow you to even show that few lines of code), consider making a small and useful extension to an open source product. This again shows that it is really written by you, how you overcome real-world problems and it is useful also for others!
Good luck job hunting!