I wanted to learn more about Dotty, the new compiler that will be used for Scala 3 so I thought of using it to solve a small problem.
I decided to use an exercise I use with candidates for a Scala position as a starting point for discussion. It consists in modelling a binary tree and writing a function that acts on it.
First I ask the candidate to model a binary tree, similar to the one the figure below:
And then we work together on how to write a function that adds a unique identifier to all nodes of…
Tech lead and back-end dev