If it seems like crime novelist Linda Fairstein has intimate knowledge of the world she writes about, it’s because she lived it. For 30 years, Fairstein worked at the Manhattan District Attorney’s office, serving as head of the sex crimes unit. Her Alex Cooper series is based on the time she spent there; its 12th volume, Hell Gate, out now and on the New York Times Bestseller List. She spoke with about the writing process, using New York City as a character and what it ‘s like being a Law & Order: SVU inspiration.

ENTERTAINMENT WEEKLY: Tell us a little bit about Hell Gate.

LINDA FAIRSTEIN: Alex Cooper is a young prosecutor, and has the job that I had for 30 years. I always try to take my reader into a world that explores some aspect of New York City’s history or current events. Two years ago, the idea for this was political scandals, [sparked by] two events. One was [former New York governor] Eliot Spitzer’s fall from grace. He had been a colleague of mine in the Manhattan D.A.’s office. I was just shocked because I knew him to be a brilliant lawyer and have a lovely family. Shortly after that happened, there was a New York City congressman from Staten Island named Vito Fossella. He had a wife and kids on Staten Island…and it turned out he had a child by his mistress in D.C. Before John Edwards, before Gov. Sanford, I thought about exploring political scandals and the duplicity of people we think have integrity and we’ve elected to public office and how it impacts things.

Your books are very New York centric — the city is like a character. How do you decide what parts of New York make it into the story?

Usually there’s a theme in the book. [Take] Lethal Legacy. I’ve always been fascinated by rare book collectors and rare maps, so I used the New York Public Library as the backdrop for it. It’s such a magnificent building rich with history and treasures.

What’s your favorite part of the writing process? Coming up with ideas, research, the actual writing?

For me, it’s the writing. It’s why I chose to leave the courtroom and tell stories. Secondly, the research is great fun. I can’t imagine being one of the authors who hires researchers; I just love getting into places and smelling them and feeling the texture and trying to recreate it. Third, the plotting. That’s the toughest. That’s really the hardest part, I think especially writing crime novels, because the readers are very smart and like to puzzle out the clues. You try to be one or two steps ahead of them but it’s not always successful.

When did you decide you wanted to be a writer?

I had always, from a teenager on, wanted to be a writer. My father, with whom I was very close, so I say this with a big smile on my face, he was very supportive and he used to roll his eyes and say, ‘Oh, you have nothing to write about, you need a career.’ So my other choice was public service. I went to law school knowing that I really could not sit in a garret and write poetry or the great American novel. But I never gave up the dream that I would one day write. I never guessed how much material I’d get in the D.A.’s office. What actually happened was in the late 1980s, a publisher came to me to ask me about writing a nonfiction book about our groundbreaking work in the D.A.’s office. I got permission from my boss and the city to write that first. It was very well respected and reviewed, so I went back to my boss and said, ‘I’ve always wanted to write novels.’ We just had the same rule we had with the nonfiction rule — obviously you can’t do it on city time. So I did write the first four novels in the series while doing both jobs.

How did you find the time?

Weekends, early mornings, vacations.

What made you decide to pursue writing full-time?

It was 30 years and I loved every minute of it. I left six months after 9/11 happened. I was in my office, I saw the second plane hit the towers ten blocks away, and it was truly a time for me to reassess what mattered to me. My husband had just retired and it just seemed like a perfect time to segue into spending more time with him. There were plenty of great people in the D.A.’s office to carry on my work. I still am a lawyer, I still keep my credits current, and I do a lot of non-profit work for victims of violence so that keeps my hand in the old job. I get to do both.

How much of you is in Alex?

Her professional work is very much my passion — my interest in the work, my temperament and what I loved, how I thrived on trying to get justice for victims of violence. I get to take real poetic license. She’s younger, thinner and blonder. She has a trust fund, which I don’t have. Because she’s younger, she didn’t have a lot of the struggles that women had in the ’70s and ’80s breaking into law. Many of the people in the book are composites — nobody is an exact person, but a lot of my friends are represented warmly by characters like them. People who cross me, watch out! You’ll be in a book! (laughs)

The character of ADA Alex Cabot on Law & Order: SVU was based on you. How does that make you feel?

That got started in the brilliant mind of Dick Wolf, who created the show. He knew our unit and has said publically many times that he based the show on our unit and the P.D.’s unit and Alex Cabot’s character on me, although I get no royalties! (laughs) It was entirely his idea to take the public persona of what I do and what I did and make a character out of it. I’m fine with it. It would be fun if I got royalities or a cameo but I just enjoy it. Both Stephanie March [who played Cabot] and Mariska Hargitay [who plays Det. Olivia Benson] have been wonderful allies in the victim advocacy movement. I adore them. They’ve done a really dignified job of bringing those issues to primetime television, which quite frankly I never dreamed would happen 10 years ago.