How did you come to school?- It's mean that " douyatte" どうやってきましたか?For example by bus, bicycle, by car and so on. But sometimes young people use short cut Japanese.when you heard this sentences , maybe they said " nanide" not "nande". Nanide means How, but Nande means why.I think they asked you "nanide". But if you cannot understand ,please ask them don't be shy. Japanese speak fast most of time, especially young people are!! please keep on learning Japanese^^