During job interviews we often give Scala developers a simple design task: to model a binary tree. The simplest but not necessarily best implementation involves Option idiom: case class Tree[+T](value: T, left: Option[Tree[T]], right: Option[Tree[T]]) Bonus points for immutability, using case class and covariance. Much better but […]