Starting a company is different, and if you are massively interesting in solving a problem, that can be a great way to go. But starting a company is completely unpleasant a lot of time and if you want to pick a job that is going to fill your plate with bullshit, that is a good choice.
The best advice I ever received in regards to this topic is still pretty worthless, because almost all advice is worthless. You cannot learn wisdom that way. You learn it through experience. But here it is: Pick a problem that is meaningful to you and work on it. Optimize this by working with people you like and who share your passions.
That advice was given to me by one of the most famous computer scientists alive who also happens to be worth tens if not hundreds of millions of dollars. Note that his advice did not involve becoming a good engineer, getting papers cited, or starting a company.
I keep an index card in my pocket that says: "Never again have reason to regret." This is not "live without regrets". I think that attitude is mostly contemptible. Rather, spend your time -- all of your time -- on things you will not regret having done when you climb into bed at night. If nothing else, every day that I have obeyed this rule unfailingly I have slept well and awoken excited and optimistic in the morning. That's all the wisdom I have. The rest is just get damn lucky.