Farhan Qureshi (R. Madhavan), Raju Rastogi (Sharman Joshi), and Rancchoddas “Rancho” Shyamaldas Chanchad (Aamir Khan) are students at the Imperial College of Engineering, one of the best colleges in India. They are room-mates in the college’s hostel. While Farhan and Raju are average students from modest backgrounds, Rancho is from a rich family. Farhan wants to become a wildlife photographer, but is pursuing an engineering degree to fulfil his father’s wish. Raju, on the other hand, needs to improve his family’s financial situation.
Rancho is a wealthy genius who studies for the sheer Joy of it. His passion is for knowledge and taking apart and building machines rather than the conventional obsession of the other students with exam ranks. With his different approach Rancho incurs the wrath of college’s dean, Professor Viru Sahastrabudhhe aka ViruS (Boman Irani). Rancho irritates his lecturers by giving creative and unorthodox answers, and confronts ViruS after fellow student Joy Lobo hangs himself in his dormitory room.
Rancho denounces the rat race, dog- eat-dog, mindless rote learning mentality of the institution, blaming it for Lobo’s death. Threatened by Rancho’s talent and free spirit, ViruS labels him an “idiot” and ttempts, on a number of occasions, to destroy his friendship with Farhan and Raju, warning them and their parents to steer clear of Rancho. ViruS’s model student is Chatur Ramalingam or “Silencer”, (Omi Vaidya) who sees a high rank at a prestigious college as his ticket to higher social status, corporate power, and wealth.
Chatur conforms to the expectations of the system. Rancho humiliates Chatur, who is awarded the honor of making a speech at an award ceremony, by substituting obscenities into the text, which has been translated into Hindi by the librarian. As xpected, Chatur mindlessly memorises the speech, without noticing that anything is amiss, partly aided by his lack of knowledge on Hindi. His speech becomes the laughing stock of the audience, infuriating the authorities in the process.
Meanwhile, Rancho falls in love with ViruS’s medical student daughter Pia (Kareena Kapoor) when he, Raju and Farhan crash her sister’s wedding banquet in order to get a free meal, in the process infuriating ViruS. The three students continue to anger ViruS, although Rancho keeps coming first in every exam, while Chatur is always second, and Farhan and Raju are inevitably in the ast two positions. The tensions come to a head when the three friends, who are drunk, break into ViruS’s house at night so Rancho can propose to Pta, and then urinate on a door inside the compound before running away when ViruS senses intruders.
The next day, ViruS threatens to expel Raju lest he rat out Rancho. Unable to choose between betraying his friend and letting his family down, Raju Jumps out of the 3rd floor window and lands in the courtyard. After extensive care from Pia and his friends, he awakes from a coma. The experience nas changed Farhan and Raju, and they adopt Rancho’s outlook. Farhan decides to pursue his love of photography, while Raju takes an unexpected approach for a corporate Job interview. He gives a series of non-conformal and frank answers.
However, Virus is unsympathetic and vows to make the final exam as hard as possible so that Raju is unable to graduate. Pia hears him and angrily confronts him, and when ViruS gives the same ruthless reply he gives to his students, Pia reveals that Viru’s son, her brother, was not killed in an accident but committed suicide in front of a train and left a letter because ViruS had forced him to pursue a areer in engineering over his love for literature; ViruS always mentioned that he unsympathetically failed his son on the ICE entrance exams over and over to every new intake of ICE students.
After this, Pia walks out on the family, and takes ViruS’ spare keys with her. She tells Rancho of the exam, and he and Farhan break into ViruS’s office and steal the questions and give it to Raju who, with his new-found attitude, is unconcerned with the prospect of failing, and refuses to cheat. However, Virus catches the trio and expels them on the spot. However, they earn a reprieve hen Viru’s pregnant elder daughter Mona (Mona Singh) goes into labour at the same time.
A heavy storm cuts all power and traffic, and Pia is still in self-imposed exile, so she instructs Rancho to deliver the baby in the college common room via Voice over ‘P, after Rancho restores power using car batteries and a power inverter that Rancho had made up and ViruS had mocked. He then delivers the baby with the help of a cobbled-together Vacuum extractor. After the baby is apparently stillborn, Rancho resuscitates it. ViruS reconciles with Rancho and his friends and allows them to take their final exams and they graduate.
Rancho comes first and is awarded ViruS’s pen, which the professor had been keeping for decades before finding a brilliant enough student to gift it to. Their story is framed as intermittent flashbacks from the present day, ten years after Chatur vowed revenge on Rancho for embarrassing him with the speech and promised to become more successful than Rancho a decade later. Having lost contact with Rancho, who disappeared during the graduation party, Raju and Farhan begin a journey to find him.
They are Joined by Chatur, now a wealthy and successful businessman, who is confident that he has surpassed Rancho. Chatur is also looking to seal a deal with a famous scientist and prospective business associate named Phunsukh Wangdu. Chatur sees Wangdu, who has hundreds of patents, as his ticket to further social prestige. When they find Rancho’s house, they walk into his father’s funeral, and find a completely different Rancho Oaaved Jaffrey).
After accusing the new man of stealing their friend’s identity, the host pulls a gun on them, but Farhan and Raju turn the tables by seizing his father’s ashes and threatening to flush them down a toilet. The householder capitulates and says that their friend was an orphan ervant boy who loved learning, while he, the real Rancho, was a lazy wealthy child who disliked study, so the family agreed to let the servant study in Rancho’s place instead of labouring.
In return, the real Rancho would pocket the qualifications and the benefits thereof, while the impersonator would sever all contact with his college- mates and start a new life. The real Rancho reveals that their friend is now a schoolteacher in Raju and Farhan then find Pta, and take her from her wedding to Suhas, by performing the same tricks with his material possessions, and having Raju turn up to he ceremony disguised as the groom and eloping with Pia in public.
When they arrive in Ladakh, they see a group of enthusiastic children who are motivated by love of knowledge. Pia and the fake Rancho rekindle their love, while Chatur mocks and mocks him, the schoolteacher, before walking away. When his friends ask what his real name is, he reveals it is Phunsukh Wangdu. They phone Chatur, who has turned his back, to turn around and meet his prospective business partner. Chatur is horrified and falls to his knees, accepts his defeat and continues to plead his case with Phunsukh to establish the business relationship he was after.