What's your favorite Java interview question, and why? How did you answer it?

This was a great opportunity to show off how I think about stuff, how I write my tests, how I split my code, how I name my variables, how I apply DRY and SOLID principles, what sort of interactions I have with a programming pair.

My favourite interview was being asked to do a 30–45 minute observed pair-programming session with a senior developer.

The task was simple enough; reading a bit of data, picking some out, writing it to console.

This was a great opportunity to show off how I think about stuff, how I write my tests, how I split my code, how I name my variables, how I apply DRY and SOLID principles, what sort of interactions I have with a programming pair.

Much, much better than being asked some weird quirk of the Java Language Specification.