Mr. Gates bought 30 x 8 = <<30*8=240>>240 hot dog buns.
In his four classes, he has a total of 4 x 30 = <<4*30=120>>120 students.
Therefore, each of his students can get 240/120 = <<240/120=2>>2 hot dog buns.
#### 2