These questions were asked at a Java interview. Coded on paper. Wasn't necessarily happy with my answers so went home and whipped these up.