Honeywell interview question

Gave coding task and ask questions on it.