When I joined CS degree I also thought like you did.
Now looking at insane competition, the kids who can't write a real program if their life depends upon it, constantly getting better internship and job offers than me, I believe I was wrong.
No one cares.
People who interview are also likely Leetcode kids. So they will ask some obscure question from 14th page of Leetcode to flex, so the probability of passing is almost proportional to amount of time you grind.
If I have a chance to go back to year 1, I focus on Leetcode. Fundamentals be damned.
In this industry no one has an incentive to care about efficiency. If they did, we wouldn't be gambling with right candidate answering an obscuring question from some 10+ page of Leetcode or Hackerrank.
Now someone from outside India can reply to this with their usual justifications. To be clear, I don't hate DSA questions. Just pointing out as your leetcodes get harder, you tend to select people who do leetcode whole day than those who are good at DSA and also good at programming.
Edit: and yes, "if you're good at DSA you should be able to answer the obscure question". Dude obscure question will be LC hard or upper end of medium. The kid who does Leetcode 3 hours a day already seen the question and remembers the answer too, and there are n > 10 kids like that.
All of this was fueled by zero cost credit, tidal waves of VC money and the very early stage of monetizing the web. Soon the world wide web will be a thing of the past and most economic value will have been captured by corporate walled gardens and this job marked will fall in line.
I think learning data structures and algorithms as a software engineer is important. And if you legitimately want to pursue a deeper understanding of those because you have a practical purpose in mind, that's great.
But if that does not really interest you, and you only do it to pass some pointless interview to become an entry level employee at a MAANG... you need some perspective in life.
Let's say you do become an employee at a MAANG. You buy an expensive house, now you have to pay the mortgage for years. You get married, start a family with kids... now you have raised your cost of living to the point it is really hard for you to make less money. Now you have long-term, lifetime commitments that require you to make a lot of money, and your MAANG manager will sniff that desperation, will rub his hands, do an evil laugh and then work you to death.
Your family will be happy and abstracted from everything, but you will be deeply unhappy. You will have no time to make friends, you will be a foreigner in a very different country and nobody will understand you. You will go on vacation to expensive places, but your mind will always be trapped in the anxiety dimension created by your manager and your H-1B status. With a couple of mouse clicks and the stroke of a pen, your manager can make everything go away at any moment because when you lose your H-1B status you have to leave the country at once.
You will eventually get used to your higher standard of living and become indifferent to the materialistic aspects of your life. The excitement of your new life will fade away. Living in a nice house won't matter, having an expensive vehicle won't matter. You will have musical instruments and a boat and whatever hobbies but you'll have no time to pursue them. You will soon realize that you have money but no time.
The little time you have left, will be for you to spend with your kids, but you will be too tired to have meaningful interactions with them. Your kids will become spoiled by the standard of living you provide and will barely know you because you are always busy with work. They will grow in another country, speak a different first language, and will be assimilated by another culture. As they grow, they will feel more culturally disconnected from you, and become indifferent to you, your culture and your identity. Just like you did, they will leave the nest and never look back. You will be reduced to a contact in someone's smartphone that is never called.
You soon realize that the cost of your prosperity is the solitude and distance from your family and friends. You will be a miserable MAANG salaryman that made a pact with the devil and lost his soul. And it all started with the empty promise that if you complete enough stupid Leetcode exercises you will be rich and happy. If you are not already happy without a MAANG job, you won't be happy with one.
And I am going to plagiarize the ending of a similar story here:
His darkest secret, however, is that he lives in constant fear that, some day, he will fail. He will fall behind with his tasks, he will not meet his manager expectations and be replaced by younger engineers with more energy and more up-to-date knowledge. He will realize that his friends at work were fair-weather friends and that he lost, in a single stroke of fate, the attention he was so eagerly seeking.
Like the rest of us, he will grow old, his priorities will change, his eagerness will die down. As he looks around him, he may realize that the best times of life have passed him by, and that there is no making up for the lost time. He will be bitter, having left an insignificant mark on the world, having wasted his time in pointless pursuits. No one will miss him.
Assuming you're from India and know well about the job market here,
My comment tries to highlight a very specific issue that using progressively harder leetcode problems selects for people who do leetcode all day, and me trying to focus on CS fundamentals and actual programming was a mistake.
It has nothing to do with me wanting to work in FAANGM or not, or any of the philosophy you wrote.
You wrote that FANGM salaried person will be miserable. You know who will be more miserable? The software engineer who had to settle for a less paying company or startup. The engineer who came from a humble rural background and wanted to leave a mark on the world, but lost to the measure-oriented competition which rewards the cargo cult mentality.
Looking around me, the cargo cult leetcoding kids are more happier, that's probably because they are already from a better background than I am. Doesn't change the fact that if I grinded what it required to game the job market, I would've been at a place better than them.
Doesn't matter you are one of the most gifted athlete, if you're playing the game that doesn't have any prizes.
You assume that the facade people put on social media means they're happy. It will be all happy pictures at expensive restaurants and exotic vacation destinations, until one random day they change their relationship status to divorced or whatever, and then all that MAANG income will go to alimony and child support, and the wife will be keeping the nice house and car.
If the main thing that connects you to your family is money... well, guess what: your wife can have all of your money and stuff without needing you to be around. If you are married and working all the time, you are playing a very dangerous game. Once the net worth grows, so does the incentive to divorce.
All those innocent MAANG kids are in for a big surprise when they realize who is really in charge. Perhaps if they became a bit more informed about family law instead of focusing solely on those dumb Leetcode puzzles...
When I joined CS degree I also thought like you did.
Now looking at insane competition, the kids who can't write a real program if their life depends upon it, constantly getting better internship and job offers than me, I believe I was wrong.
No one cares.
People who interview are also likely Leetcode kids. So they will ask some obscure question from 14th page of Leetcode to flex, so the probability of passing is almost proportional to amount of time you grind.
If I have a chance to go back to year 1, I focus on Leetcode. Fundamentals be damned.
In this industry no one has an incentive to care about efficiency. If they did, we wouldn't be gambling with right candidate answering an obscuring question from some 10+ page of Leetcode or Hackerrank.
Now someone from outside India can reply to this with their usual justifications. To be clear, I don't hate DSA questions. Just pointing out as your leetcodes get harder, you tend to select people who do leetcode whole day than those who are good at DSA and also good at programming.
Edit: and yes, "if you're good at DSA you should be able to answer the obscure question". Dude obscure question will be LC hard or upper end of medium. The kid who does Leetcode 3 hours a day already seen the question and remembers the answer too, and there are n > 10 kids like that.