Landon Kupfer thought he’d grabbed a piece of the Silicon Valley dream when Tesla Inc. hired him about a year ago to work on quality issues at the company’s Fremont, Calif., factory.

The perks included driving Tesla cars and impressing friends and strangers curious about work at one of the tech industry’s hottest brands. “Getting a job there was pretty exciting,” said the 23-year-old San Jose native, who had experience fixing cars and installing windows but thought a job at the tech giant was beyond his reach.

His...