Jane Street Interview Question

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