IMHO:
1. Company should be small. I worked in a few small companies. One have grown to headcount above 200 and became a swamp full of unmotivated people.
2. There should be great team members.
3. Founders should be software people or engineers.
Midsize companies are great, but they're not for slackers because people there actually expect you to work. However, if you do actually work, they're good for that.