Tecore interview question

Some coding questions?