Ash Munshi's first jobs in the U.S. included selling newspapers and candy in New York City subway stations as a young immigrant.

He also cleaned toilets and worked as a security guard. "Whatever it took to put food on the table," Munshi says.

Decades later, after attending Harvard University and building a career in Silicon Valley, Munshi became chief technology officer at Yahoo, overseeing the work of 350 engineers.

Now he's CEO of Pepperdata, a 25-person cloud-computing startup in Cupertino, California.

Yet his long record of professional success hasn't insulated him or his family from the discrimination -- subtle and otherwise -- that he says is pervasive in America's largest tech hub.

Recently he was standing near his well-manicured verge in the tony suburb of Los Altos Hills, California, when someone pulled up in a car, complimented him on the yard and asked for his business card. The driver assumed he was a landscaper rather than the owner of the house.

Several years earlier, during a visit to his son's high school, a student assumed he was a janitor.

"A lot of stereotyping goes on in the valley," says Munshi, who is a Muslim and a native of Ahmedabad, India's fifth-largest city.

"I've been mistaken for a Mexican and an Iranian," he told CNBC in a recent phone interview.

While the incidents have not made him bitter -- "I'm grateful...I thank God every single day that he's blessed me," he says -- the rising tide of anti-immigrant feelings in his adopted country has him on edge.

Perhaps most frustrating to Munshi is what he feels is a lack of appreciation by President Trump -- and others calling for tighter immigration controls -- of how hard many immigrants work.

"Immigrants from all over share one thing: a hunger to prove themselves," he says. "We have that chip on our shoulder."

Cutting off the flow of immigrants will choke off that energy, especially in the tech industry, where "growth is limited by the availability of talent," according to Munshi.

The radical transition from the Indian state of Guajarat to the rough-and-tumble melting pot of New York city also taught him the importance of adaptability.

"The flexibility of the immigrant mind is an incredible asset for the U.S.," he says. "We need to be able to zig AND zag."

An emphasis on education is another benefit, Munshi says. "Asians understand that education is the way to rise" in American society.

In spite of the more-hostile climate, Munshi says the Indian community -- like Silicon Valley at large -- will adapt.

"Silicon Valley is practical. No matter what happens in Washington, we have to move the ball forward and go around the blocks put up by this administration."