Mr. Nanjiani began work on a first draft and asked Ms. Gordon, a former therapist turned writer-producer, for notes and suggestions; before long, the two were writing the script together. “Right from the beginning, it was like, how do you make a movie about someone in a coma funny?” he said.
Ms. Gordon added, “I didn’t want the joke to be like, ‘Oh, I accidentally unplugged her. Uh-oh!’ If it’s going to be that level of humor, I’m out.”
There were rewrites and more rewrites, three years’ worth; not so unusual by Apatow standards, but something new for Mr. Nanjiani and Ms. Gordon. “We would write a draft, and Judd would tear it to shreds,” Ms. Gordon said. After their first screening tested high, Mr. Apatow came to the two with one more request: Add 50 more jokes.
“We knew there were challenges in telling a story like this, but once we saw the story worked, we knew we could get a little more experimental,” Mr. Apatow said, also noting, “It really had to be the perfect script to try to get funding.”
There was also the matter of how to make the story dramatically compelling. In real life, there was a lot of sitting and waiting and worrying, but how thrilling is that? “If we showed what actually happened, you would just see people going through a stressful event being very kind to each other,” Ms. Gordon said.
Instead, Ms. Hunter and Mr. Romano play her parents as temperamental opposites — she’s a feisty Southerner, he’s a laid-back guy from New York — who enter the film with their own nettlesome back story. (Ms. Gordon said her parents “want me to mention this always: My dad has not cheated on my mom, ever.”)
Though a fictional heckler is the catalyst for the film’s ISIS confrontation, the actor has experienced similar run-ins onstage, about seven or eight times, by his count. “It used to be ‘Go back to Taliban,’” he said. “Now it’s ‘Go back to ISIS.’ That’s about the only thing they’ve really updated.”
Last November, he and his “Silicon Valley” co-star Thomas Middleditch found themselves in a similar altercation in a bar in Silver Lake, Los Angeles. Two men approached them and told them that they were big fans, but that the two actors were, as Mr. Nanjiani recalled, “off base about Trump.” When he and Mr. Middleditch said that they didn’t want to discuss politics, the “fans” started yelling at them, calling them “cucks.” The incident blew up online after both actors tweeted about it. “It made me a little sad to see these guys go from really happy to meet us to really angry, so quick,” Mr. Nanjiani said.
“I didn’t feel scared, or physically threatened, because I was like, and this is probably not the right approach, but I felt if we had to, we could have taken these guys,” he added.
This year is a busy one for Mr. Nanjiani. In addition to starring in “Sick,” he recently appeared in the Ice Cube comedy “Fist Fight” and has a role in the coming “Lego Ninjago Movie.” On “Silicon Valley,” which began its fourth season last month, his character, Dinesh, has several groundbreaking moments, including a brief taste of venture capital-backed power and a date with an actual girl.
“As an actor, I think this is just the tip of the iceberg in terms of what he can do,” Ms. Kazan said.
Work promotions, romance, ninja battles — it’s all a far cry from Mr. Nanjiani’s past gigs, which included roles as a counter guy, a custodian and an airport security guard.
“You never got cabdriver parts,” Ms. Gordon said, “but you went out for cabdriver parts.”
He said: “The thing that helped me, I guess, was that I wasn’t physically intimidating, so I never had to play terrorists.”
“You would have been adorable,” Ms. Gordon observed.
“I know a lot of brown actors who play terrorists because they’re physically intimidating. For me, it was like, ‘O.K., you’ll be the nerd.’ So I’ve played the nerd. I’ve played food-delivery guys. But I always tried to find something in the characters so that they weren’t just defined by what they looked like.”