Microsoft interview question

design a function for determining hits in battleship