The setting for Malgudi Schooldays is the fictional town of Malgudi in Southern India. The period that the book is set in is pre-independence India, when life is leisurely and young boys go out to play, exploring the quaint little town and building bonds among themselves.
Swami, the protagonist, is a boy who does not really like going to school and often gets into trouble. He likes to spend his time in class watching the trains go by, and, if he is made to stand on the bench as a punishment, entertains himself by noting the different caps and hairstyles of his classmates.