I had to take a Programming Test (around 4 hours) in a language of my choice. There were four assignments (implementation, debugging, changes to code etc). The test code base that i had to work with was reasonably complicated. It took some time to figure out what it was doing & what i was supposed to do. You are graded on completeness / correctness (whether you can get it to compile) / solution efficiency / approach / code readability etc. They checked on me a cpl times during the test to ask if i had questions & i was free to take breaks if/when needed. Internet access was provided.
I did not do well, even though i consider myself a decent programmer & i eventually got a hang of the overall logic in their test code.
In hindsight, i think a better approach would have been to split the overall test into multiple segments of an hour each: 1 programming assignment, a debugging session with a technical member of their team present ('pair' programming ...), a white boarding session to write algorithms/programs etc. etc. That is, multiple approaches to evaluate instead of giving the candidate several hours to work on assignments on a laptop by himself/herself ...
Other candidates may disagree ... or maybe i'm complaining too much & am technically 'challenged' :)
Regardless, the overall experience was good / interesting. The person i dealt with was very courteous.