"..... life is messy and haphazard, full of quirky contingencies, unexpected bifurcations, serendipitous discoveries, unanticipated encounters, and unpredictable outcomes"
This is an expert from the book I am reading. The believing brain.
It's so true for a career path too. The career path you imagine and you take always do not follow a linear curve.
There will always be unexpected bifurcations like choosing one stream over other, serendipitous discovery of your own programming skills and unanticipated interview calls put in the industry.
So how to make sure that you are making the best of this fact. Well plan ahead but don't over plan. Keep the destination but allow the randomness to define the course.
If you are in section a, best advice is explore everything. If you are in section b, the advice is build an asset. Learn something and share it. If you are in your first job or in training, learn to say yes with new opportunity that come your way.