Even before Olivia Wilde got her first screen credit, she was fascinated by the art and technical process of moviemaking. The native New Yorker had studied stagework at the Gaiety School of Acting in Dublin, but hadn’t yet landed her breakout role - Alex Kelly on the TV show “The O.C.” - when she scored a gig as a casting assistant for the feature film “The Girl Next Door.” It was on that set where her career took a couple of turns. In need of a SAG card so she could get health insurance, she persuaded the filmmakers to let her have one line of dialogue. And her curiosity concerning how films were made kicked in, so she paid attention to what everyone else on the set was doing. A lot more acting came her way, and her desire to know more led to her talking to and learning from various cinematographers and camera crews and directors - among them Ron Howard (“Rush”), Spike Jonze (“Her”), and Jon Favreau (“Cowboys & Aliens”).

It also led her to directing. Her first time, in 2011, was on a sweet comedy short titled “Free Hugs.” Now, Wilde, 35, has finished her first feature, “Booksmart,” another sweet comedy that offers a refreshing look at two young women going through coming-of-age issues. It’s nuanced and thoughtful, it has a good balance of drama and humor, and the right amount of attention is given to assorted characters. Wilde obviously learned from what other directors were doing. She recently visited Boston to talk about what went into making the film.

Q: Did you know early on that you wanted to direct films as well as act in them?
A: By the time I made “Free Hugs” I had spent 10 years on sets, and I had found myself gravitating toward the director and the director of photography. I would see other actors go to their trailers between set ups, and put on their slippers. But I like consistency. I have a very hard time engaging emotionally, dropping that wall, becoming vulnerable, creating a moment, and then zipping it all up and putting it away for an hour. And then doing it all again, and then ... lunch! I found that my happy place on-set was sitting at the monitor, slowly inching my way closer. When I was a casting assistant on “The Girl Next Door,” I found myself hovering behind video village, and watching what everyone was doing. Then I started acting in more and more films and on television, and I was asking a lot of questions. I am the product of hundreds of people being incredibly generous with their time, and allowing me to ask questions like, “What’s that lens? Why does it make a difference?” I was trying to supplement my lack of film school with experience, and just shadowing people as much as possible.

Q: “Free Hugs” was made through an initiative for female filmmakers that was started by Glamour magazine. What was that all about?
A: I was seriously thinking about trying directing. Glamour Reel Moments was a program the magazine did and that my short came out of. They gave pretty sizeable budgets to women who wanted to direct, and I benefited from that. I had fun with it and I had never been that happy. I started asking all the directors I had worked for how to do it. I asked Spike Jonze and he said, “You’ve gotta make music videos.” Luckily a couple of bands took a risk on me (Red Hot Chili Peppers and Edward Sharpe and the Magnetic Zeros) and then I started getting offers from a lot of different bands. But I only wanted to do the videos if I loved the song. I also knew that I would need to find a feature that I really loved. I started the process of figuring out what would be the thing that I can love enough, and it was “Booksmart.”

Q: How did you and “Booksmart” first get together?
A: I read the original draft of the script, which had been written a few years earlier, and I knew that it contained a story that I really wanted to tell. But I felt that it needed to be updated to match today’s world. I thought the story was a great idea - two women who are best friends who are incredibly smart, in different ways, and who are proud of being intelligent. It is not a story of nerds trying to assimilate. It is a story of two women realizing there’s something they haven’t yet experienced, and they believe in their own multidimensionality. It’s a story that is more existential than a simple quest for losing one’s virginity or trying to be loved by the popular kids. I saw the potential for that and I knew I had to find a collaborator who could flesh that out and take it to the next level. I met Katie Silberman and she understood not only how to do the things I had been hoping for, but so many other dimensions to the story that hadn’t even occurred to me. We wrote the script together, then collaborated on every stage after that.

Q: You ended up working with veteran actors as well as actors who were in their first film. Was that a big challenge?
A: Everybody was bringing so many different types of experience and energy to it, and that kept it all really interesting. I truly believed that this could be a two-hander (a film focused on just two characters), while also investing in the ensemble. I’m really inspired by Amy Heckerling in general, but specifically by her film “Fast Times at Ridgemont High.” It’s a perfect example of a fully fleshed out ensemble. Right before we started shooting, we had a screening of “Fast Times” for the whole cast. A lot of them hadn’t seen it, and they were coming up to me and saying, “That movie is amazing! It really inspired me! I have so many ideas now!” So, everybody was recognizing that there were no small characters, no small roles. And I think that is why our cast comes off so beautifully. Because everybody invested, and nobody was phoning it in. People were coming up with ideas, choices, specificity. It was so much fun to be able to create the environment conducive to that.

“Booksmart” opens on May 24.