Star of Mindy Kaling's new Netflix show on how she got the role of a lifetime