Both. You shouldn't think in binaries, and should recognize that your career is long and will have many different phases.
When you're young - first couple years out of college, or even while you're in college - it's time to optimize for learning. Maybe that means working at a startup, maybe that means founding one, maybe it just means going to a highly-regarded research university and working on some projects with the professor. If you didn't get into a highly-regarded university, it means picking a topic of interest and studying intently about it on your own.
Eventually at some point, you should get pedigree on your resume. A good university would do this, but so would working at a well-regarded blue chip or fast-grower. And most of them are more than willing to hire out of startups, if you have an interesting project that makes you stand out from the crowd.
Stay at the company as long as it remains interesting, where you're learning new things and developing new skills. Leave when it gets boring. Hopefully you've built up a nice nest egg in the process - big companies pay their high performers very well.
When you're young - first couple years out of college, or even while you're in college - it's time to optimize for learning. Maybe that means working at a startup, maybe that means founding one, maybe it just means going to a highly-regarded research university and working on some projects with the professor. If you didn't get into a highly-regarded university, it means picking a topic of interest and studying intently about it on your own.
Eventually at some point, you should get pedigree on your resume. A good university would do this, but so would working at a well-regarded blue chip or fast-grower. And most of them are more than willing to hire out of startups, if you have an interesting project that makes you stand out from the crowd.
Stay at the company as long as it remains interesting, where you're learning new things and developing new skills. Leave when it gets boring. Hopefully you've built up a nice nest egg in the process - big companies pay their high performers very well.
Repeat as necessary.