Alpine Data Labs interview question

Nothing hard. Simple algorithms and also Scala syntax