Mindy Kaling says writing 'Late Night' was ''so satisfying'' as she could relate to both main characters.

The 40-year-old actress and producer recently penned the comedy-drama film in which she stars as a writer who is hired mainly on the basis she is an Indian-American woman, to save the career of a seasoned late-night host, played by Emma Thompson.

The 'Office' star explained that she felt ''uniquely qualified'' to empathise with both her own character - as she has experienced being a minority writer in a mainly white and male writing room - as well as Thompson's character as she herself has been a boss without being on her ''best behaviour.''

Speaking to news.com.au, she said: ''The movie was so satisfying to write because I feel uniquely qualified in my life to write for both of those characters.

''I remember, vividly, what it's like to be the only woman or minority in a writer's room when I was 24 years old.

''But I also remember, more recently, the frustration of being an employer, having Katherine's opposition, and being a little complacent, a little bit bored with your job.

''You employ all these people but you're not always on your best behaviour and I know that feeling well.''

The 'Mindy Project' star went on to confess that championing other women from culturally diverse backgrounds in the writer's room hasn't always been the easiest thing to do.

She said: ''For the longest time when I was on my own show, being a showrunner and the star was so time-consuming.

''At times it felt like being a mentor or taking the energy to look deeper than normal on what people were submitting for characters or writers is so time-consuming.

''But what I learnt recently is it's the only way to change culture and it's completely worth it, and the fact that I did take the extra time to try and find cast and writers on these two shows I'm writing now has really made a difference for the better on both of those projects.''