Kayla Olson isn't a barista anymore. But she was when she started what may have seemed an improbable quest for a writing career, one that has resulted in a two-book deal with Harper Teen. The first of those two young adult novels, The Sandcastle Empire, which came out June 6, has been optioned by Paramount Pictures, with Leonardo DiCaprio as one of the producers. Versions have been released in France and Spain, with 13 other translated editions on the way.

Kayla Olson, author of The Sandcastle Empire, enjoys spending time at the West Oak Coffee Bar in Denton. (Jae S. Lee / Staff Photographer)

"My degree is in international studies," says the University of North Texas graduate on the phone from her Denton home. "For a while I thought I would go overseas or be a translator or a diplomat."

That is, until she decided she didn't want to live overseas. So she took minimum-wage jobs at a fast-food drive-through, at a bank drive-through and, eventually, a Starbucks. She loved the free coffee, particularly the grande caffe latte, but she wanted more. So starting in 2007, she worked the early morning shift from 5:45 to 11 a.m., rested, then returned to write from 3 to 6 p.m.

Eventually, with the encouragement of her husband, a fellow UNT graduate, she quit her job and began writing from 8 a.m. to 2 p.m. She turned out two novels, one a middle-grade novel that she consigned to a drawer, and the second, a time travel novel that went on submission for a year only to receive polite but discouraging rejections.

In between those books, she went on a Disney Cruise Line vacation with her husband in 2010 that included a stop at Castaway Cay, a private island in the Bahamas. Three years later, after she finished the time travel book, she found herself wishing she could go back to the island but unable to afford it.

"I thought I could spend time on the beach in my head every day without actually being able to go there. Then I decided, what if it's not a peaceful beach? What if it's a very dangerous place where they think it will be peaceful but it's the opposite? What if I make it a survival book? All of those pieces fell together as I was taking a shower. I got out and took notes on my iPhone notes app, typing furiously for 10 minutes. My husband goes, 'What are you doing?' And I said, "I got this idea.'

She certainly did.

The Sandcastle Empire features a heroine, Eden, who escapes a labor camp and joins three other women on a boat to flee to an island. The action takes place in 2049, when climate change and overpopulation have widened the gap between the haves and have-nots to crisis proportions.

Eden, who was once a member of the privileged class, has lost her freedom and everyone she loves to the Wolfpack, populists who have risen up to take control.

Olson says she was thinking about real-world concerns about political upheavals that may ensue from climate crises, such as floods and fires. She finished the book in 2015, and two editors fought for the right to publish it.

Her timing was excellent, as interest in dystopian novels has kept growing. Her novel will come out in a year in which Naomi Alderman's The Power won the 2017 Baileys Women's Prize for Fiction and the 2017 Hulu television series adapted from Margaret Atwood's 1985 The Handmaid's Tale seized eight Emmy Awards.

Olson says there was something deeply personal about The Sandcastle Empire that was different from what she wrote before.

"From the very first page, I felt the voice was compelling," Olson says. "My character came to me very naturally. She's very observant, patient but determined about trying to escape and find her freedom."

She sees parallels between Eden's quest and her own attempts to carve out a life as a writer. There were many times it all seemed so hopeless, she came close to giving up. "After all the rejections, I had to ask myself how do you find the drive to keep going when all hope is gone. I related to Eden in the way she looked for strength even when nobody else is there to give it to you."

The day after Olson got the offer for her book in October 2015, she heard that Leonardo DiCaprio's production company, Appian Way, was interested. A little more than a month later, she had an offer from Paramount Studios to option it for a film. The date for a movie has not been announced.

The tumultuous journey has changed her life in some ways, but not others. While she's not working at Starbucks, she likes to hang out at coffee shops, including the West Oak Coffee Bar in Denton, where her new favorite drink is the black coffee they roast on site.

Not only can she afford to go back to that Disney island in real life, she and her husband are planning to go in November with their baby, who was born in 2011, and a copy of The Sandcastle Empire.

"I want to take a picture of the book on the very sand that I was dreaming of when I was writing this. It is so symbolic to me to come full circle. I never knew when I was visiting for the first time that this would be the visit that would change my life. It reminds me to keep my eyes open. You never know if the rock outside your window could be the beginning of a book."