Obama spoke to coders and entrepreneurs at Apple 's Worldwide Developers Conference in San Jose, California, in a conversation with Lisa Jackson, Apple's vice president of environment, policy and social initiatives. The former first lady, accomplished lawyer and humanitarian touched on the business implications of excluding women — who are often heads of household spending — from decision-making.

Michelle Obama was asked on Tuesday to "preach" about the role of women and tech — and she delivered.

It's something that Apple is trying to address. The company donates to the Thurgood Marshall College Fund, Grace Hopper Celebration of Women in Computing, National Center for Women & Information Technology and the National Society of Black Engineers, according to its latest shareholder proxy statement.

Thirty-two percent of Apple's employees worldwide are women, while 22 percent of employees are underrepresented minorities, according to Apple's website . The industry as a whole also struggles with hiring underrepresented groups: In a StackOverflow survey of 64,000 developers this year, 88.6 percent were male and 74.5 percent were white.

"Who are you marketing to? Who do you think is going to use these apps? If women aren't at the table, you're going to miss my dollar. Because you don't really know me," Obama said, according to clips of the talk posted on social media.

Obama said that looking at hiring workers in their 20s and 30s is too late. An advocate for women's education, Obama argued that changes must be made to the educational system, especially by college-age people who can be role models for the "next generation."

"That's when I look to the fellas around the room and say, 'Are you ready? Are you ready to share your spot at the table?' Then make room," Obama said.

She said her husband, former President Barack Obama, took the duty of role-modeling very seriously when managing his staff.

"Barack, he knew more, he worked harder; if there was something that had to be done, he was going to do it faster, stronger," Michelle said. "He was always modeling for his team. .... We always had trouble with people who managed up. They were good in front of us, but you hear about how they treated interns or their own staff. When we felt that energy, we eliminated it."

Michelle Obama said that building a trustworthy, diverse staff is not only important for politicians — it's also key for entrepreneurs.

"If somebody is up here pretending they got here on their own, they're lying," she said. "Make sure that communication is open for the people on your team. You have to surround yourself with people who reflect your values. You have to be really true to them and honest with yourself on whether we're living those values. You have to be that person even when no one's looking."

Watch: Apple bets on services