Why did you decide not to use your real name as your character name, the way many comedians have been doing lately?

"It's not an autobiographical show. It's an Indian guy, so there's a similarity there. He's an actor. The only reason he's an actor is because we didn't want to do a thing where if he worked at a magazine or something, then you've got to show him at the magazine. I don't know what it's like to work at a magazine, and I don't have any interest in, you know, shadowing someone to learn that."

Are there plots and scenes you wrote for yourself that you think no one else would have written for you?

"Yeah, the whole show! No one would have given me things like that. Episode nine, there's a lot of dramatic stuff, and I don't think anyone would have thought I could do it. No matter if you're a white actor or a minority actor, no one has a ton of imagination for actors. For the most part, people just assume, 'Oh, he can just do the thing he did in the other thing.' It would just be, like, shittier versions of [my Parks and Rec character] Tom's jokes."

How did you cast the other roles? Are Eric Wareheim and Lena Waithe, who play Dev's friends Arnold and Denise, people you knew before this?

"Eric's one of my good friends. I needed a token white friend, and I was like, Eric's my token white friend in real life, so I had him audition, and it was great. You could tell there's a real chemistry between us that's hard to build with someone you don't know. And Lena was a big open casting call. Our casting person, Allison Jones, who is amazing — she's cast Freaks and Geeks and all the Apatow stuff — she introduced us to Lena early on, and was like, 'This person's really special; you guys should just use her.' We auditioned a ton of people. We didn't know who that [character] was going to be; it was an open ethnicity. After we auditioned Lena, we tailored the character for her.

"Noel [Wells], who played [Dev's love interest] Rachel — Alan and I really wanted this love interest and I to really have a chemistry and a good rapport. That stuff is such a hard thing to do, to have people believe in this relationship. We read a ton of people, and Noel immediately floored us. She was so natural and funny."

At the beginning of the series, you get the sense that life is going really well for Dev and he deserves good things, but then the mood turns ...

"One thing we were trying to get away from is, I do think things kind of [wrapped] up in a bow in all the comedy stuff now, where the couple rides off and everyone's happy. I don't think real life ends like that a lot. We looked to a lot of '70s films. Shampoo and Warren Beatty. That movie, he kind of decided, 'All right, I'm going to be with this lady,' and he goes to tell her he loves her, and she's like, 'No, I'm marrying this other guy.' ... And he's just kind of stuck there, just standing there confused. That resonates with me more than, 'Oh, I'm with this person and we're happy.' "