Jane Street interview question

They asked me to implement two functions in a data class.