David Markey, a 22-year-old senior studying applied mathematics and economics at Brown University, got his first Amazon Echo during the e-commerce giant's Prime Day sale in 2016.

That day, Amazon sold more Echoes — the $99 voice enabled, internet-connected speaker with smart assistant Alexa — than it ever had before, more than doubling the previous sales record. By holiday season 2017, Echo devices, which can do a host of tasks from playing music to setting alarms to ordering products on Amazon, had become so popular, shoppers were using their Echoes to buy more Echoes.

And what's been good for Amazon has been good for Markey: With a little computer savvy, he capitalized on the product and now earns $10,000 a month by coding "skills" for Alexa.

"It was awesome getting the first check," Markey tells CNBC Make It. "It paid my rent in full."

Alexa skills, which run on everything from Amazon's Echos to Alexa-enabled smart watches, allow users to interact with compatible hardware, apps and games through voice commands. For example, by enabling smart-home skills like iRobot Home, you can simply say, "Alexa, ask Roomba to start cleaning," to get your smart vacuum going. Or you can enable skills like CNBC's Flash Briefing to hear the day's headlines. Alexa will even test your knowledge of Kardashian trivia. Currently there are over 30,000 skills for Alexa built by third-party developers, which users can find in the Alexa app or online in Amazon's skills store.

For Markey, it all started when he first set up his Echo. He marveled at how many things Alexa could do.

"I set up my apartment with smart lights and I used the Echo for setting timers for cooking, and I really enjoyed it," he says. He was also listening to various flash briefings every morning. "I found that to be a really good way to get the news while I was having my morning coffee."

But there was one thing he couldn't find. He wanted a skill to teach him a new word and its definition each day, and he wanted it to be read in a human's voice, instead of a computer.

"Everything there was voiced by Alexa," he says. "So I decided to make one myself."

Markey has been writing computer code since his sophomore year of high school and is focusing on machine learning in his applied mathematics program at Brown. He says designing the skill was a fun way to combine his love for coding with something a bit more creative.

"I had a microphone, so I just picked a bunch of words that I didn't know, wrote some scripts and then recorded them in a weekend," he says. He used trial and error along with guidelines from Amazon to launch his first free skill, "Word of the Day" in February 2017, and he read the words to listeners himself.

Within a month, its popularity soared.

At the time, Amazon didn't offer metrics for developers to see how their skill was performing, so Markey hacked his own method.

"I had jerry-rigged a system for getting the metrics out of it, and there were all sorts of weird things," he laughs. "It was disproportionately popular in South Korea, which was interesting."

He looked at his user numbers and "It was way more than I expected," he says, though he declines to disclose specifics. An Amazon representative also declined to comment on user numbers.

Despite his skill's growing popularity, it was a hobby then, so Markey wasn't earning any money from it. At times, he felt overwhelmed by having to create content for his growing fan base, especially when he moved to Philadelphia for an internship at Vanguard.

There, Markey was living in an empty apartment with bare walls. "I had a lot of difficulty getting the audio to be anywhere near the quality that I needed it to be," he says.

"The moments where I came closest to going, 'I don't want to do this anymore,' were [when] I'm pulling all of my clothes out of the closets and my bedding and draping it around the furniture ... putting my mic in it and hunching over this tent that looks like something a kid would make and trying to read the word of the day," he says.

Frustrated, he wrote an email to Amazon CEO (and the world's richest man) Jeff Bezos.

"Basically I said, 'Hey, I really enjoy doing this, but I feel like it is super popular and now I'm just watching this number go up and I feel aimless and don't have a goal,'" Markey says. In response, Bezos forwarded his email to an executive in charge of developers for the Echo, who then reached out to Markey.

"[I] had a very inspiring chat with one of the higher-ups working on the Echo, and decided that I was going to push through," he says.

That persistence paid off: In May 2017, Amazon launched its Alexa Developer Rewards program, which pays developers who create top performing skills within specific categories, like "education and reference" or "trivia and accessories."

While Markey's "Word of the Day" skill didn't qualify for the initiative, he had an idea for a second skill that would. He created an interactive game called "Word of the Day Quiz" and launched it later in 2017, funneling his already-built user base toward the second skill.

After it went live, the checks started rolling in.

Markey launched a third skill in December of 2017, called "Price It Right." It's a game in which users guess the price of Amazon products, and is also eligible for the Developer Rewards Program. After playing, users can enter to win Amazon gift cards.

Then in January, a gaming company called Volley agreed to buy Markey's Alexa Skills while allowing him to retain a portion of the Developer Rewards income. They also gave him a job at the enterprise, where he spends 35 hours a week working. Through the popularity of his two later skills and his partnership with Volley, Markey collects about $10,000 each month.

For Markey, the payoff is a reminder of the value of determination.

"I was really happy that I hadn't given up when I was building tent forts," he says.

For other ambitious young people who would like to make extra cash, Markey suggests using digital tools like Storyline. And now Amazon provides free resources to teach anyone — regardless of coding talent — how to create a skill.

"We think it should be simple for people of all skill levels to build for Alexa," Rob Pulciani, the director of Amazon Alexa, tells CNBC Make It. "It's still early days for voice and we think there is a lot of upside for developers looking to innovate and create voice-first businesses with Alexa."

Online, Amazon provides an Alexa Skills Kit of tutorials, and the company also holds Alexa Dev Days conferences in cities across the country, which are free events where "the Alexa team meets with learners of all levels," according to Pulciani.

So far, the developer rewards program has paid "millions of dollars" to developers in 22 countries, Techcrunch reports.

Of course, not everyone makes as much money as Markey. Amazon doesn't let individual developers include ads in their skills, so some do the work for little payoff. There's also a lack of transparency about how the Developer Rewards program works and pays out, according to CNET. In late 2017, Amazon announced the ability for developers to charge users for premium content was in preview with select developers. (For example, in "Heads Up!" from The Ellen DeGeneres Show, players can "get started with a few free decks and then purchase more themed decks to keep the game going," according to Amazon.) Amazon says the program will be widely available in 2018. Supbsciptions and Amazon Pay are also in beta.

And there are other benefits for coders like Markey. He says the rise of voice-enabled devices has given him new in-real-life skills to compete in the job market. In fact, at a recent Alexa Dev Days conference, Markey landed a job interview for a position after his graduation in May by chatting with a fellow developer.

He got the job.

While the cash from his Alexa skills side hustle is nice, "I think the most valuable thing that I ended up getting was a career," Markey jokes.

Don't miss: This 30-year-old started with a homemade boozy ice cream recipe—now she's bringing in millions

Like this story? Like CNBC Make It on Facebook