One night, Ram Mohammed Thomas is detained by the police without warning. He learns that he has been accused of cheating on the quiz show Who Will Win A Billion?, hosted by Prem Kumar. The show’s producer, Billy Nanda, and others involved with making it find it impossible that a poor restaurant server like Ram could possibly be a trivia expert. Inspector Godbole begins to torture Ram to try to force a confession out of him that he cheated, but Ram is saved when a woman named Smita shows up, saying she is a lawyer who wants to defend Ram.

Smita takes Ram back to her home and helps him recover. Eventually, she asks him to tell her how he knew the answers to all the questions. Ram says that he isn’t sure why, but the story of his life helps explain how he knew the answers. The two of them watch a DVD of Ram’s performance on the show as Ram tells Smita his life story, with each anecdote relating back to the answer to a question.

Ram begins by describing how he and his friend Salim used to love going to the movies, particularly to see the famous actor Armaan Ali. Salim was obsessed with Armaan Ali and felt personally heartbroken when Armaan Ali was going through a break-up. During a screening of the movie Betrayal, however, an old bearded man sits down next to Salim and starts molesting him. When Salim notices, he shouts at the man. In the man’s hurry to leave, his fake beard comes off and Salim and Ram see that the man is Armaan Ali in disguise. On the quiz show, Ram correctly answers that Armaan Ali’s first movie with Priya Kapoor was Betrayal.

Ram was an orphan who eventually ended up in the care of Father Timothy. To avoid any religious controversies, since Ram’s parents’ religion is unknown, Father Timothy gives Ram a full name that covers three different religions: Ram Mohammed Thomas. When Ram exposes new priest Father John having sex with an English backpacker named Ian, this leads Father John to carry out a murder-suicide on himself and Father Timothy. On the quiz show, Ram correctly answers that the letters on top of a Christian cross are INRI.

Ram recounts next how he lived in a chawal (tenement) with Salim. The walls are thin, and they can hear next door, where a drunken former astronomer named Mr. Shantaram beats his daughter Gudiya. One day, Ram pushes Mr. Shantaram down some stairs to protect Gudiya. He believes he’s killed Mr. Shantaram and flees the area. Due to overhearing Mr. Shantaram talking about astronomy, Ram correctly answers on the quiz show that Pluto is the smallest planet.

Ram’s next story takes place at an earlier point in his life, when he first meets Salim while living in a juvenile home. Salim is a Muslim whose family was killed in religious riots. Together, they find themselves taken from the orphanage and put in the care of a man named Maman, whom Salim likes but whom Ram is suspicious of. Eventually, Ram learns that Maman is a gangster who maims children to make them more valuable as beggars, so he and Salim escape. At one point, Ram and Salim get their fortunes read, and although Ram is skeptical, the palm reader gives Ram a lucky one-rupee coin. On the quiz show, Ram correctly recalls the name of the blind poet Surdas, because a reference to the poet Surdas was what first alerted Ram to the fact that Maman wanted to blind Salim.

The next story Ram tells is about his time working for the Australian Colonel Taylor, who works in the embassy. Colonel Taylor seems to know everything that happens in his home, and it turns out this is because he has cameras and audio recordings to spy on his whole house. Colonel Taylor eventually gets caught working as a spy and declared a persona non grata, which helps Ram correctly define persona non grata on the quiz show.

Ram then relates how he has experience listening to drunk people at Jimmy’s Bar and Restaurant. A customer and businessman named Prakash Rao claims that his Haitian wife, Julie, manipulated him into turning against his brother Arvind and even using a Voodoo doll on Arvind. Ram uses details from this unusual story to figure out on the quiz show that the capital of New Guinea is Port Moresby.

Working for Colonel Taylor helps Ram save up a bunch of money, but he soon loses it after the train he’s riding gets robbed by two dacoits. In the scuffle, Ram shoots and kills one of the dacoits, and he notices that the revolver says Colt. This helps him correctly guess the inventor of the revolver on the quiz show.

Next, Ram tells a war story he heard from the Sikh man Balwant Singh, who supposedly fought in a war against Pakistan, only for Balwant to be revealed soon after as a deserter. The story helps Ram correctly identify on the quiz show that the highest military honor in India is the Param Vir Chakra.

After this, Ram tells a new story he heard secondhand from Salim. Salim lived for a while with a man named Ahmed Khan, who turns out to be an assassin. Ahmed was an avid bettor obsessed with cricket, and this helps Ram know on the quiz show that Indian batsman Sachin Malvankar has scored 36 Test centuries.

At one point, Ram finds himself living with famous retired actress Neelima Kumari, the “Tragedy Queen.” She lives a lonely life and seems to be in an abusive relationship, ultimately dying by suicide while watching her most acclaimed film. Ram correctly gives the name of this film on the quiz show.

After killing the dacoit, Ram ends up in Agra, where he becomes an unofficial tour guide for the Taj Mahal. There he meets Nita, a beautiful young woman who works at a brothel and can’t leave because her brother and pimp, Shyam, demands money from her. Ram manages to obtain the money to secure Nita’s freedom, but after Nita is severely beaten by a client and Shyam demands more money, Ram gives it instead to a stranger. The stranger is an English teacher named Utpal Chatterjee, who needs the money to pay for treatment for his son, who has rabies. Later, on the quiz show, Ram uses a “Lifeboat” to call Utpal and get help on a question about Shakespeare.

Now, on the quiz show, Ram doesn’t know the answer to the final question about Beethoven, so he takes a restroom break. Prem Kumar supervises him to prevent him from cheating. In the restroom, Ram confronts Prem Kumar with a gun, saying he knows that Prem was the one who abused both Neelima and Nita. An intimidated Prem Kumar hints at the correct answer to Ram, which Ram gives on-air to win the grand prize.

Ram’s lawyer Smita eventually helps Ram get free and get his money. She reveals that in fact she is Gudiya, the same girl he helped long ago. Ram marries Nita and uses his new money to help many of the other people in his life.