In 2006, eighteen-year-old Jamal Malik (Dev Patel) from the Juhu slum, is a contestant on the Indian version of Who Wants to Be a Millionaire? (see Kaun Banega Crorepati), and is one question away from the grand prize. However, before the  20 million (US$300,000) question, he is detained and tortured by the police, who suspect him of cheating because of the impossibility of a simple "slumdog" with very little education knowing all the answers. Jamal recounts, through flashbacks, the incidents in his life which provided him with each answer.
Jamal's flashbacks begin with his managing, at age five, to obtain the autograph of Bollywood star Amitabh Bachchan, which his brother Salim then sells, followed immediately by the death of his mother during the Bombay Riots. As they flee the riot, they meet Latika, a girl from their slum. Salim is reluctant to take her in, but Jamal suggests that she could be the third musketeer, a character from the Alexandre Dumas novel (which they had been studying   albeit not very diligently   in school), whose name they do not know. The three are found by Maman a gangster who tricks and then trains street children into becoming beggars. When Salim discovers Maman is blinding the children in order to make them more effective beggars, he flees with Jamal and Latika to a departing train. Latika fails to board the train as Salim purposefully lets go of her hand, thus resulting in her being recaptured by Maman. Over the next few years, Salim and Jamal make a living travelling on top of trains, selling goods, picking pockets, working as dish washers, and pretending to be tour guides at the Taj Mahal, where they steal people's shoes. At Jamal's insistence, they return to Mumbai to find Latika, discovering that she is being raised by Maman to be a prostitute, to fetch him soon a high price and as a virgin. The brothers rescue her, and while escaping Maman they shoot him to death. Salim then manages to get a job with Javed  Maman's rival crime lord. Back at their room, Salim orders Jamal to leave him and Latika alone. When Jamal refuses, Salim draws a gun on him, whereas Latika persuades Jamal to obey his brother and go away.
Years later, now a tea-boy in an Indian call centre, Jamal searches the centre's database for Salim and Latika. He fails in finding Latika but succeeds in finding Salim, who is now a high-ranking lieutenant in Javed's crime organization. Jamal reproaches Salim, who then pleads for forgiveness, and offers him to stay in his luxurious apartment. Jamal later bluffs his way into Javed's residence to reunite with Latika but as he professes his love for her, Latika asks him to forget about her. Jamal nevertheless promises to wait for her every day at five o'clock at the VT station. Latika attempts to meet him there, but is recaptured by Javed's men, led by Salim, and once Javed moves to another house, outside Mumbai, the two again lose contact. Jamal becomes a contestant on Who Wants to Be a Millionaire?, knowing that she watches the show regularly. Much to the consternation of Prem Kumar, the show's host, Jamal becomes a wonder across India. He uses the 50/50 lifeline on the penultimate question and during the following break, whilst in the men's room, Kumar tries to fail Jamal, feeding him with a wrong answer, yet Jamal chose the other one, which turned out to be the correct answer.
Assuming Jamal is cheating, the police are involved. After an initial beating up, the police inspector listens to Jamal's explanation of how he reached each answer. Finding all of them "bizarrely plausible", he allows him back to the show. At Javed's safehouse, Latika sees Jamal on the news and Salim, in an effort to make amends for his past behaviour, gives Latika his mobile phone and car keys, and asks her to forgive him and to go to Jamal. Latika is reluctant out of fear of Javed, but agrees and escapes. Salim fills a bathtub with money and sits in it, awaiting for Javed and his men as they realise that he let Latika free. Jamal's final question is, by coincidence, the name of the third musketeer in The Three Musketeers, which he never learned. Jamal uses his Phone-A-Friend lifeline to call Salim's cell, as it is the only phone number he knows. Latika answers the phone, and, while she does not know the answer, tells Jamal that she is safe. Relieved, Jamal randomly picks Aramis, the right answer, and wins the grand prize. Javed hears Latika on the show and realizes that Salim has betrayed him. He and his men break down the bathroom door but Salim kills Javed before he is shot, gasping, "God is great." Jamal and Latika meet on the platform at the railway station; they kiss, and they dance energetically to the song "Jai Ho".
Output: What does Salim fill his bathtub with?