Sophia—a former child prodigy and 17-year-old math mastermind—has been having panic attacks since she learned that after high school, former prodigies either cure cancer or go crazy. It’s a lot of pressure. So Sophia doesn’t have the patience for games right now. She especially doesn’t have the patience to figure out why all these mysterious playing cards keep turning up inside her textbooks.

Joshua—a highly intelligent and cheerfully unambitious amateur magician—has been Sophia’s classmate and has admired her for as long as he can remember. He thinks the time is perfect to tell Sophia how he feels. He doesn’t know how wrong he is.

To learn a little more about the story behind The Secret Science of Magic, author Melissa Keil answered some of our questions about her inspiration for these unforgettable characters and what makes this story so relatable.

Q: Sophia is a math prodigy terrified she won’t live up to her potential. While all teens may not be prodigies, this is a common fear. What made you want to write about it? Did anything or anyone specific inspire you? 

A: I remember that moment towards the end of high school really clearly, when the big dreams and plans of childhood start to crash into the realities of the looming adult world. For most of their lives, we feed kids the line that they can be anything they want and all their wildest imaginings are encouraged; but then there comes a point when everything in their world starts telling them to focus on “reality,” which in so many instances means curbing their dreams. Sophia might have extraordinary abilities, but I think the questions she’s grappling with are things most young people can relate to: Will I be able to function in the world? Is the path I’ve chosen the right one? What is going to happen to me if I can’t realize my ambitions? Will I be able to do something amazing with my life, and will I be satisfied if I can’t?

Q: As best friends, Sophia and Elsie face a common dilemma—realizing that their paths aren’t going to follow the same route. Did your own life experiences inform this part of the book? 

A: In a way—I think everyone, regardless of age, can probably relate to the experience of wanting desperately to hold onto a moment that can’t be sustained. People come and go, friends and family move away, and people inevitably drift in and out of our lives whether we want them to or not. I think Sophia and Elsie will always be close, but they simply can’t have the same type relationship that they have had in high school. What I wanted them to realize by the end of the book is that the changes in their relationship are perfectly okay, and necessary too.

Q: One of the most important discussions in children’s and young adult literature now is diverse representation of characters. Was that something you were thinking about when you created Sophia and Elsie, or did it happen naturally? 

A: Sophia’s background is Sri Lankan, which is the same as mine, and Elsie’s family is Indian; I was born in Australia but grew up in a really diverse, multicultural family and neighborhood, and I wanted that to be reflected in my books. It was so great to give this book to the young people in my family, and have them be excited to see things in it that they recognized from their background. The diversity conversation is incredibly important and it’s wonderful that readers and publishing folk are seeing the value in representing all types of stories; but sometimes that does put an extra level of pressure on authors (and their characters) to “perform” their diversity in a particular way. For me, I simply wanted the characters in my books to reflect the world that I live in, and I really wanted to give these two brown-girl best friends the chance to grapple with the same things that teens everywhere grapple with—changing friendships and difficult family dynamics, ambition and anxiety, courage and hope, and navigating first love.

Q: One of the book’s main themes is finding the magic within. Why is this theme important to you? Why did you decide to give it a literal representation through Joshua? 

A: Joshua is an eternal optimist; he is the boy who looks at the world and sees only wondrous things to discover. But at the same time he is also a pretty solid fantasist who uses all his passions and obsessions as a convenient way to avoid the things in the world that he simply doesn’t want to face. And he is beset by doubts about his own abilities and his place in the world; he sticks to “small” magic tricks because he is terrified to challenge himself with anything bigger, and risk failing. I think it’s so easy for the world to crush us as we get older; both Joshua and Sophia and trying to figure out how to hold onto their optimism, to keep some of the “magic” of being young and hopeful, while also figuring out what to let go of in order to make room for the life that’s still to come.

Q: Let’s talk about Joshua—we love Joshua. He’s just so earnest. You have an affinity for writing from the affable geeky boy’s POV—you did it here for part of the book, and you did it in Life in Outer Space. Why do you choose to write from a teen boy’s perspective? A: Some of the nicest, and most surprising feedback I’ve received has been from teen boys; boys who have connected with the romance in my books, who love both the male and female characters, who relate to the ups and downs of their relationships—I say surprising, because when we talk about boys and reading I think we often talk about boys “naturally” gravitating to certain types of “boy” stories. We tend to assume they want only action and adventure, and we don’t think that they can have the same kind of affinity with stories about emotions and relationships and the internal life of other humans—which obviously I don’t believe is true at all. I adore all of my boy characters, these sweet, weird, stumbling young humans who are trying to figure things out, and I truly found writing them to be no harder than writing the girls. I really don’t think boys are the indecipherable alien species that they’re sometimes made out to be!

Q: This is your third novel. How different was the writing process from your first? Your second?

A: The Secret Science of Magic was definitely the toughest of my three books so far, for lots of reasons. I think a first novel is generally written with a kind of blissful ignorance, without deadlines or expectations (or reviews or contracts)—all of those things impact the creative process! I also had more full-time writing days with this book, but that led to a lot more procrastination too. And while all my novels had their own challenges, I think this one tackled some tougher issues than perhaps the previous two books did. It was a much longer process to finish the first draft of Secret Science, and I think I probably cut and ditched a lot more material from this book than the previous two as well.

Q: In this book, you also made the choice to change perspectives—back and forth from Sophia to Joshua. Was there a specific reason for that choice? Was that more or less challenging than picking one POV and sticking to it?

A: Both of these characters are struggling to make connections with other people, and they’re both stumbling through their relationship while not always understanding each other or making the right decisions in the way they communicate. So I thought it was important to see them both working through their misconceptions and trying to understand the choices they both make, even (or especially) when they make “bad” choices. I thought it was particularly important to see Joshua’s inner life, as I wanted him to have to grapple with some of those thorny issues young men face when they are trying to form a relationship—like how much “pursuing” is healthy, and how much of what he thinks he knows about Sophia, this girl that he has had a huge crush on from a distance, is just a projection. It’s always tricky finding the “voice” of a character and sustaining that through a novel, so yes, I did find juggling the shifting point-of-views a little challenging! But I also feel like all of my characters are real people with their own personalities and rich inner lives, so it’s a nice challenge to get that to translate on the page.

Q: You’re also a book editor. How do you juggle your own writing while editing other people’s work?

A: I’m lucky enough to work part time as a children’s editor, and I tend to work on books for younger kids—from picture books to middle grade fiction. So there isn’t a lot of cross-over with my YA writing, which is definitely helpful! I think it would be pretty difficult writing my own stories while having other people’s YA characters and stories in my head. But I do feel like I get the best of both worlds; I love my job, and there’s something incredibly satisfying about helping other writers shape their stories into published books.

Q: We’ve already mentioned Sophia is a math genius, who’s terrible at drama class. What were your favorite subjects in school? Were you good at math? Drama?

A: I’ve always been a nerd so I enjoyed most subjects at school, and I was pretty good at most things too—except for math! It ended up being probably my worst subject as a senior, so choosing to write a math genius was an odd choice for me! I think perhaps subconsciously there was part of me that needed to go back and figure out why there was this one thing at school I was hopeless at; maybe there was a little bit of therapy in the writing too!

Q: There’s also a lot of magic in this book—literary and literal. Were you a magician in a past life (or this one)? Did you do some research to turn Joshua in the amateur magician we see in the book?

A: Joshua’s magic obsession really sprung from a particular David Copperfield trick that I was fixated on (I can’t say more than that without giving away some major spoilers!). But I had to do a lot of research, especially because I wanted all of his tricks, even the outlandish ones, to have some basis in reality. I read a lot of books on magic and went out in the world to see magicians perform. I have to admit though that I never managed to master much—as hard as I tried I just don’t think I have the dexterity for close-up magic! I did enjoy many hours watching magicians do their thing on YouTube though.

Q: What about the math? How did you go about authentically writing a math prodigy?

A: As I mentioned I was always terrible at math—I found the research for the book really fascinating, especially reading the biographies of people like Grigori Perelman, the Russian mathematician who Sophia is obsessed with, and other accounts of “failed” or troubled geniuses. But I freely admit that I understood about a third of the actual higher-order math that Sophia loves! Luckily I have quite a few math teachers and other clever people in my circles, so I did a LOT of brain-picking of people much smarter than me.

Q: We got to see a little bit of Sam and Camilla from Life in Outer Space in this book. Why did you decide to give them cameos? Does that mean that we might get to see Sophia and Joshua again someday?

A: Potentially! I get quite attached to all of my characters and I find it really hard to let them go when I finish a book, but by the same token I’m not really interested in writing a “sequel” for any of my books—the way I see it, my characters worked hard for their happy endings, and it isn’t fair of me to mess things up for them again for the purpose of giving them another book! But I still wanted to check in with Sam and Camilla and see how they’re doing a little way into the future; and I loved the idea of them being in the same world as Sophia and Joshua (and Alba and Grady from The Incredible Adventures of Cinnamon Girl, who also have a blink-and-you’ll-miss-it cameo in this book too). All of my books exist in the same universe, and I love to think of all my misfits and outcasts finding each other and becoming firm friends.

Get your copy of  The Secret Science of Magic at your local libraryindie bookstore, or Barnes & Noble!