Growing up in Westport, Haris Durrani had many interests. Throughout Kings Highway and Greens Farms elementary, and Bedford Middle schools, his parents encouraged his love of writing, science, philosophy and religion.

At Staples High School, Durrani wrote for the school newspaper, Inklings, and literary magazine, Soundings. He helped the robotics team win a world championship. He was challenged by “incredible, out-of-this-world” teachers, including Cathy Schager (who taught Middle Eastern studies) and writing instructor Michael Fulton.

But high school is not always smooth, particularly for a teenager who does not in any way fit the prevailing norms. For Durrani, a Muslim of Dominican and Pakistani descent, there were bumps on the road.

In English class, he said, “I never read about anyone like me.” In fact, when he found a “racist, Islamophobic passage” in “Frankenstein,” he had to bring it up for discussion.

A social studies class, Western Humanities, never delved into his background. On the day after Osama bin Laden was killed, Durrani said, “I was out sick. A kid in my class said, ‘I wonder what Haris thinks. He’s anti-American, right?’ ”

He found friends with “the same sense of understanding of the world I had,” but felt apart from others.

After graduating from Staples in 2011, Durrani headed to Columbia University. He earned a bachelor’s degree in applied physics, with a minor in Middle Eastern, South Asian and African studies. He co-founded the Muslim Protagonist Literary Symposium, exploring literature as “an agent of social change for Muslim communities and allies.”

He added a master’s degree in history and the philosophy of science from Britain’s University of Cambridge. Durrani is now at Columbia Law School, studying the intersections of technology and disenfranchised communities.

Along the way, he has found time to write. His stories, memoirs and essays have appeared in science fiction magazines, academic journals and online.

Now, he has written a novel. “Technologies of the Self,” published by Brain Mill Press, which specializes in marginalized voices, is about a young American Muslim struggling to understand himself in the context of his family, classmates and contemporary urban life. The protagonist — Jihad, or “Joe” as he introduces himself — is an engineering student in post-9/11 New York City, trying to integrate culture, nation, religion, family, identity, race and time.

It’s part science fiction, part sociological exploration, part personal story. It could not be more relevant today.

As an undergraduate, Durrani said, he was encouraged to study broadly. “To understand engineering, you need to figure out how it fits into the world,” he said. “The more engineering I did, the more I became interested in its social, political and philosophical underpinnings.”

“Technologies of the Self” enables the young author to tell the story of a Dominican/Pakistani Muslim that he never saw on TV or in the movies, or had read about.

The book explains a bit about Islam. But it’s also a personal story, one that he heard from his family. In a world filled with broad stereotypes and sweeping generalizations about Muslims, Durrani seizes the chance to paint with nuanced strokes.

Last week, in conjunction with the Westport Country Playhouse production of “The Invisible Hand,” by Pulitzer Prize-winning playwright Ayad Akhtar, Durrani talked about his novel.

He enjoys telling his story. He was glad to have the opportunity in his hometown, at a gathering before a play about an American futures trader kidnapped in Pakistan, and the bond that grows between him and his captors.

“Art should unsettle or bewilder us,” Durrani said. “We need art that generates personal and community conversations.”

However, he added, the playhouse production “presents a stereotyped view of Pakistan and Muslims.” In his talk, he tried to give another view of the religion, and its adherents.

Durrani feels his life has come full circle. His Staples Middle Eastern studies teacher moderated his talk. “She guided it with aplomb,” he said.

His novel has earned praise from writers he admires, from readers who appreciate seeing their own stories reflected in his words, and from non-Muslims who respond to his family subplots and political themes.

When I spoke with Durrani last week, the Republican National Convention was in full-throated swing. I asked him what he thought.

“The hate-mongering doesn’t scare me as much as subtle forms of prejudice, which pass under the radar. That’s more pernicious, because we don’t recognize it for what it is.”

He sees it. He heard it, sometimes in the halls of Staples. And the engineer-turned-law student promises to find time to keep writing about it.

Dan Woog is a Westport writer. He can be reached at dwoog@optonline.net. His personal blog is www.danwoog06880.com.