At my previous job, we asked applicants to write a piece of software that would model the org chart for any given employee, enumerating their hierarchical relationships as well as their peer relationships. We may have thrown in an additional complexity or two, but we also removed a lot of requirements (no i/o or database, no user interface; we only sought application logic). Candidates were required to solve the problem in the language of their choice, spending between 4-6 hours on the exercise. The instructions were otherwise intentionally ambiguous.
By specifically calling out an amount of time, and requesting that candidates not spend more or less time, we drew conclusions about:
* Candidate's ability to derive features from imperfect 'business requirements'
* Ability to know when something is 'done' given time restrictions
* Understanding/handling of implied but not explicit edge cases
* Creative thinking
* Tendency for writing testable code
As one can imagine, this weeds out lots of individuals who exhibit tendencies deemed "undesirable" for this role. Scope creep, missed requirements, untestable code, code that doesn't actually work, solutions written in unsuitable languages (Django? Really?) and the list goes on. You'd be amazed what people return when asked to perform a 4-6 hour coding exercise.