Over the course of two hit sitcoms, a couple of best-selling books and some scene-stealing turns in Hollywood blockbusters such as “Ocean’s 8” and “Inside Out,” Mindy Kaling has cultivated an image as a kinder, gentler and more relatable star. On Instagram or Twitter, where she routinely shares parenting anecdotes and restaurant recommendations, she comes across as a celebrity you could easily spend a day with shopping at the mall or hanging out on the couch watching Netflix.

“I’ll never be this very glamorous person who people see from a distance … frosty and remote,” says Kaling. “I’ve never been demure or mysterious. People always tell me they feel like I could be their friend.”

That kind of relatability has its drawbacks. An hour before she was supposed to sit down for an interview with Variety, Kaling was involved in a car crash in Los Angeles’ Hancock Park. As she waited for the Auto Club to tow her car, the actress kept getting interrupted by selfie seekers.

“When you get in a car accident on Highland and Fourth and your car is totaled and looky-loos come up and ask to take a photo with you, then you wish that you weren’t everyone’s best friend,” jokes Kaling, looking slightly frazzled but otherwise unimpaired.

Kaling’s down-home image may get tweaked with “Late Night,” a new comedy about a diversity hire in the writers’ room of a late-night talk show — a film she wrote, produced and stars in alongside Emma Thompson. The movie is bound for this year’s Sundance Film Festival, where it seems certain to make headlines for its penetrating look at feminism and inclusion at a time when the entertainment business is being pressured to provide more opportunities for women and people of color. If that sounds a tad pedantic, rest assured, the story also happens to be very funny. After all, how many movies can mix in sharply observed depictions of sexism in the workplace with a sight gag of its writer-star getting hit in the face by a bag of trash?

“It’s a political piece without banging you over the head with its message,” notes Thompson.

Thompson’s character, Katherine Newbury, an acerbic and egotistical comic out of step with a culture that demands she produce viral videos instead of engage in thought-provoking chats with guests, may be the biggest test of the loyalty of Kaling’s fans. In “The Mindy Project” and “The Office,” Kaling’s characters, Mindy Lahiri and Kelly Kapoor, tended to be romance-obsessed pop-culture fanatics with a materialistic streak. They didn’t engage in divisive debates on intersectional feminism. But the real Mindy contains multitudes.

“You see much more of myself in Emma’s character than people might think,” she admits. “She’s very prickly. She’s not at all a person people feel they’d like to know and spend time with. The things she gets annoyed or impatient with, that’s me as well.”

“Late Night” is more than just a love letter to Thompson’s ability to sell a withering stare or deliver a sarcastic barb. It’s also a deeply personal reflection on the Indian-American Kaling’s own improbable, barrier-breaking rise in an industry dominated by white men. On “The Office,” her first major professional gig, she was the only female writer of color, a state of affairs she tried to correct when staffing her own writers’ rooms on “The Mindy Project,” her inaugural turn as a showrunner; and her upcoming Hulu miniseries “Four Weddings and a Funeral.” On “Late Night,” she tapped Nisha Ganatra, a filmmaker of Indian descent whom she had worked with on “Mindy Project,” to direct. Ganatra got the gig after impressing Kaling with a slideshow presentation in which she discussed all the parallels she saw with her own struggles to break into the entertainment business.

“I knew all about the power of holding the door open behind you instead of slamming it shut and saying, ‘Thank God I got in,’” Ganatra says.

Being a female director means being offered fewer chances to make art, Ganatra argues, and the statistics back her up. Only four of the top 100-grossing movies last year were helmed by female directors, and over the past 12 years, just 4.3% of all directors across the 1,200 top-grossing films were female, according to a recent study by USC Annenberg. The numbers are even starker for women of color. Only five black females, three Asian females and one Latina directed any of these 1,200 films over that time period.

Ganatra has an idea why those numbers exist. She remembers going to see “Jurassic World.” Afterward, the film’s director, Colin Trevorrow, participated in a Q&A in which he told a story about how producer Steven Spielberg saw an indie film he’d made, “Safety Not Guaranteed,” and was so impressed that he tapped him to direct the dinosaur adventure.

“Steven Spielberg saw himself in that director and hired him,” Ganatra says. “That didn’t happen for me. There was no Indian female Spielberg saying, ‘Here, plucky young one: Take care of my billion-dollar franchise.’”

Kaling says she’s noticed a change since she first broke into the business. She’s seeing more female directors working on television shows, which she thinks will eventually translate to the big screen. She also believes that the success of films with minority leads, such as “Crazy Rich Asians” and “Black Panther,” are changing attitudes in Hollywood.

Victoria Stevens for Variety

“There used to be a sense of obligation — of being shamed into having a token person of color to prove that you weren’t racist,” Kaling says. “Now people are realizing it’s actually valuable to have different perspectives. It’s actually a better way to make money and to reach more people.”

In “Late Night,” Kaling’s character’s ideas are initially shrugged off by her bro-ish co-writers because of her gender. There are also scenes where they poke fun at her race.

“Obviously I’m making a comedy movie, so things are exaggerated for comic effect, but similar things have happened to me in my career,” says Kaling. “It’s not so much that the people in the film that I portray are bigoted. They’ve just been sheltered by the status quo. And every one of these people in the movie change. They’re not evil. They evolve.”

At 39, Kaling has helped the careers of many aspiring writers and actors from diverse backgrounds. For “Four Weddings and a Funeral,” for instance, she says she agreed to come on as showrunner because she wanted to tell the meet-cute story from the perspective of an African-American woman and a British Pakistani man. She applied a similar multicultural approach to staffing the writers’ room.

“In that instance, the diverse point of view is the only reason to do the project,” Kaling says. “The only reason why someone would watch my adaptation of ‘Four Weddings’ is if I bring something new to it.”

Friends argue that Kaling deserves some credit for changing perceptions of what constitutes a star, though they caution she’d never admit it. “Her modesty runs deep,” says Sandra Bullock, Kaling’s “Ocean’s 8” co-star. “And unless you look on IMDb, you would never know that this quiet observer is in fact a powerhouse groundbreaker who has managed to put a good amount of cracks in that glass ceiling.”

Reese Witherspoon, Kaling’s friend and a co-star on last year’s “A Wrinkle in Time,” says the actress is passionate about telling stories that are often ignored by the movie business or edited out of the frame.

“Mindy said a very illuminating thing during the ‘A Wrinkle in Time’ press junket about how she loved fantasy and sci-fi films as a little girl but never saw any people of color in them,” recalls Witherspoon. “She has created countless opportunities for herself and others rather than waiting for other people to do that work.”

Thompson’s character in “Late Night” has no such predisposition toward diversity. Her staff on her fictitious show is composed entirely of men, and she hires Kaling’s character, Molly, only after being shamed for “hating women.” “That seemed very honest,” says Thompson. “Women can be just as sexist and unremittingly unhelpful to other women as men are. I’ve heard lots of stories about women in positions of power who are unwilling to help other women up the ladder.”

“Particularly if you’re a woman of color, you need people to give you opportunities. Talent is an important part of success, but you also need mentors to find promise in people that don’t necessarily seem like they will fit in.”

Mindy Kaling

Growing up in Cambridge, Mass., the daughter of an architect father, Avu Chokalingam, and an OB-GYN mother, Swati Chokalingam, Kaling was far removed from Hollywood. Her fandom came from devouring NBC’s Must See TV lineup of “Frasier,” “Seinfeld,” “Wings” and other era-defining sitcoms of the ’90s. It was the only programming that her protective parents would let her watch — “Married … With Children” and “The Simpsons” were ruled off-limits.

“Those shows were too subversive for [my parents],” remembers Kaling. “They deemed NBC as being a classy brand, so they were very excited when I worked on ‘The Office,’ and that was on NBC. Initially, though, they thought ‘The Office’ didn’t look enough like a shiny NBC sitcom. They thought, ‘This isn’t on brand.’”

Even as a young kid, Kaling loved to tell stories. After school, she would spend afternoons at her mother’s practice, where she would be cordoned off in a room where patients’ blood was drawn. She’d amuse herself by writing single-page plays involving fantastical situations such as a haunted house populated by ghosts, werewolves and goblins. She realized she was funny when something she created would get her mother to laugh.

If her parents lacked entertainment industry contacts, they did inculcate in Kaling a deep belief in the value of hard work. That has translated into a willingness to create her own opportunities. In memoirs and interviews, Kaling has talked about the fact that she hasn’t waited for people to offer her parts — her defining roles have been largely her own creation. That kind of entrepreneurship was how she managed to break into the business.

After graduating from Dartmouth in 2001, Kaling went to New York, where she co-wrote “Matt & Ben,” an absurdist one-act satire about the friendship of Matt Damon and Ben Affleck, in which she also starred. The show became a hot ticket Off Broadway. It was while touring with the production that she got the attention of “The Office” creator Greg Daniels, who was in the market for writers who could act. Kaling quickly distinguished herself not only with her ability to compose killer jokes but also with her talent for story. Whereas some writers were consumed with the punchline, Daniels remembers, Kaling gravitated toward stories based in conflict — the kind of squirm-inducing, awkward and hilarious moments that became the stock in trade of “The Office.”

“There’s such a joy in finding someone who is really talented and hardworking,” Daniels says. “I’m glad to have had a part to play in bringing her to the world, but I also feel like somebody with that amount of talent was going to get there anyway. I never felt like I was doing her a favor. It was the other way around.”

Making “Late Night” gave Kaling a chance to reexamine those early years in the writers’ room while retelling a familiar story of stardom and discovery from a new angle. It’s a narrative that’s served as the basis for everything from “Tootsie” to “Bullets Over Broadway,” but Kaling felt there was something revolutionary in shifting the focus to a young Indian woman.

“So much of this movie is about being a fan and being on the outside of the entertainment business,” says Kaling. “That story has been told many, many, many times by 52-year-old white men, and I love all those movies. And as a comedy nerd I’ve always identified with them because it was the closest thing that I could identify with. There was no one like me making those kind of films.”

It’s also allowed her to reexamine her views on the value of the work ethic when it comes to success. In “Late Night,” Katherine argues at one point that comedy is meritocratic. It doesn’t matter who your parents are or what college you went to — you’re either funny or you’re not. While she’s scripted the words for the character, Kaling’s not sure she buys that.

“For many years, I thought that hard work was the only way you could succeed, but it’s simply not true,” she says. “Particularly if you’re a woman of color, you need people to give you opportunities, because otherwise it won’t happen. Talent is an important part of success, but you also need mentors to find promise in people that don’t necessarily seem like they will fit in.”

Kaling’s friends and colleagues describe her as an obsessive planner and a workaholic. Howard Klein, her longtime manager, notes: “Her mind is always working. In between shows she’s writing books or articles or thinking of ideas.”

With shooting wrapped on “Four Weddings and a Funeral,” Kaling will segue to a new Netflix show that centers on an Indian teenager. Having topped the best-seller list with her books “Why Not Me?” and “Is Everyone Hanging Out Without Me? (And Other Concerns),” she’s also working on what she describes as a “slim memoir.” It will take readers through her pregnancy and her early days as a mother. Some of that time was spent on the “Late Night” set. Shooting commenced in 2018, some 12 weeks after Kaling gave birth to her daughter, Katherine. “Don’t do it,” she advises young mothers. “You don’t want to have to breastfeed between scenes.”

Kaling and director Nisha Ganatra go over notes for “Late Night.” The two had worked together on “The Mindy Project.”

Emily Aragones

She’s also received a somewhat painful education in career setbacks. For three seasons, “The Mindy Project” was a critical favorite that nonetheless struggled in the ratings. Fox, the network that initially aired the show, pulled the plug.

“It was awful,” says Kaling. “It felt personal. I was the face of the show. My name was in the title.”

But the experience also taught her about bouncing back. “The Mindy Project” had been a hit with Hulu subscribers, and the streaming network stepped up and offered the program a home. It continued for three more seasons, wrapping up in 2017.

One of the undercurrents of “Late Night” is the danger of complacency. Newbury’s shtick has grown tired, and the excitement of performing in front of a national audience has evaporated. It’s a joylessness that’s all too familiar — David Letterman spent his twilight years looking congenitally morose, and Jay Leno seemed more interested in his vintage car collection than he was in pushing the envelope. Perhaps Kaling’s overstuffed dance card is partly a way of preventing herself from falling out of step with the zeitgeist.

“Almost no one who is funny when they were younger is still funny when they’re old,” muses Kaling. “Success is terrible because as you get more successful, it leeches away your talent. It makes you rich and it makes you complacent.”

In addition to balancing an array of projects, Kaling is a compendium of suggestions for better living. Tracey Wigfield joined the writing staff of “The Mindy Project” after a stint on “30 Rock,” a move that necessitated a change in address from New York to L.A. She arrived knowing no one. Kaling quickly reached out to offer recommendations on everything from the best doctors to the perfect manicurists.

“She has great taste and likes to live nicely in a way that was inspiring to a 29-year-old comedy writer with a shitty car who dressed like a gym teacher and carried a purse from Old Navy,” Wigfield says. “I’ve adopted a lot from her just by being her friend.”

The multitasking side of Kaling is on full display on a rainy Monday in L.A. during which she balances a lengthy interview with an extensive photo shoot (partly conducted to Beyoncé’s “Drunk in Love”) and calls to her insurance agent about her recent fender-bender.

As she’s grown older, Kaling says she has begun to make allowances for the unexpected left turns life can bring. During a 2018 commencement address at Dartmouth, she noted that in her 20s she made a list of things she hoped to accomplish, including getting married at 27, having kids at 30, winning an Oscar and having her own TV show. Only one of those events came to pass within the timeline; she got her own show with “The Mindy Project.” Motherhood came late: Katherine was born when the actress was 38 (Kaling has not revealed the identity of the father). It was her daughter’s birth — the joy it brought her, as well as the anxiety it inspired about being a single parent — that led to a revelation.

“So I just want to tell you guys: Don’t be scared if you don’t do things in the right order, or if you don’t do some things at all,” Kaling told the Dartmouth graduates. “I didn’t think I’d have a child before I got married, but hey, it turned out that way, and I wouldn’t change a thing. I didn’t think I’d have dessert before breakfast today, but hey, it turned out that way, and I wouldn’t change a thing.”

These sorts of addresses tend to adhere to a strict carpe diem formula, but Kaling says she was determined to shake things up. “I was obsessed with marriage,” she concedes. “It wasn’t the romance of it. I was obsessed with the wedding and what my wedding dress would look like and how much money my husband would make and where we would live and what our house would look like. I never thought that the life I have now is what my life would be like and that I’d be so happy, but I’ve never done anything in order — or at least the right order.”

So would a 21-year-old Kaling have heeded the words of her 39-year-old self?

“I’d probably have listened to that speech and thought, ‘Whatever, you old bag. I’ll be married to some hot rich guy and have a great career,’” she says. “‘I’ll have it all.’”