Great ideas can come when you least expect it--riding the train, cooking dinner, watering your plants. For some leaders, however, the best ideas seem to emerge from particular patterns.

Here, Inc. tapped some of the CEOs of America's fastest-growing companies to find out when and where they are when genius is most likely to strike. 

1. "The moment I wake up."--David Barnett, PopSockets, No. 2 on the Inc. 5000

The best ideas come to Barnett when he's most creative, so it makes sense that it happens when he's dreaming. It "suggests that my brain was working on them overnight. I wake up and [my dream] hands them to me," says the CEO of the Boulder, Colorado-based phone accessory company

2. "My best and worst ideas usually come to me after a few drinks."--Brent Oxley, Ox Ranch, No. 246 on the Inc. 5000

"This is when I'm relaxing with my fiancé and close friends and I am able to bounce new ideas around," Oxley says. For the CEO of the Uvalde, Texas-based hunting adventure company, clearing his mind and unwinding is key to thinking creatively.

3. "In the shower, after my workout in the morning."--Kevin Lustig, Scientist.com, No. 9 on the Inc. 5000

Taking a shower is prime time for brainstorming among entrepreneurs, as is working out. Lustig does both. "When I walk into the office, we'll talk about some of those ideas and everybody understands I came up with them that morning," says the CEO and founder of the Solana Beach, California-based online health care marketplace.

4. "When spending time outdoors...or when traveling"--Justin Quinn, Natural Force, No. 431 on the Inc. 5000

"Being out in nature frees my mind to dream up the next big idea," says the co-founder of the Jacksonville, Florida-based supplements company. He added that traveling can also deliver a boost. "I find that removing myself from a repetitive daily environment is important to foster creativity."

5. "I tend to have my best ideas when I'm spending time thinking alone."--Patrick Vihtelic, Home Chef, No. 3 on the Inc. 5000

For the CEO of the Chicago-based meal kit company--and father of three young girls--alone time is a rarity. Naturally, he seizes the opportunity to ponder when the moment strikes.