Practice problems from Functional Programming in Scala