PTC interview question

I was asked to implement "swap" function