Jamal's sole motivation to appear on "Who Wants to be a Millionaire" is so his lifelong love Latika, who belongs to a dangerous gangster and who watches the show all the time, will see him. He manages to get to the very last question not by cheating but because all questions are somehow related to the most important events of his life, spent as a poor orphan trying to survive by all means. He gets stuck on the last question and asks for his last lifeline, "call a friend", which he uses to call his estranged brother Salim. Latika is the one to answer, since Salim helped her escape the gangster and gave her his phone to find Jamal. She doesn't know the answer, but Jamal achieved his goal of reconnecting with her. Not caring anymore, he gives out a random answer which happens to be the right one and wins him the show's grand prize.
Salim kills the gangster so he won't go after Latika and his brother, then gets killed in turn by the mobster's henchmen. Jamal goes to the train station where he once told Latika he'd wait for her forever, and finds Latika waiting for him.