B&H Photo Video interview question

I was asked a logic question about building a function.