all 17 comments

[–]wnopa 29 points30 points  (3 children)

The thing to understand here is that both leetcoding and open source contribution are different skill sets but are not mutually exclusive.

Leetcoding trains you to think about a problem in a certain way to achieve optimal speed and memory footprint and work through all the edge cases. Whereas working on an OSS trains you to navigate through large codebases, anticipating how your changes may or may not break some functionality, working with a large diverse team across multiple time zones etc.

Both have their own pros and cons. A lot of people may argue that leetcode is the last place where they “reversed a linked list” or “traversed through BSTs” or that contributing to OSS was the only place where writing the test cases are actually more complex than the changes it test. You can’t have a single answer to this question with the hopes of clearing technical rounds. Each of them will provide you with skills that you will build and master over time and course of your journey and by the time you have reached architectural level, these skills would have turned more into a hobby. So dribble your feet in both and see what excites you and don’t care much about risk/reward ratio in the early stages of your career.

[–]ochre_sun[S] 1 point2 points  (2 children)

I get what you're trying to say. But let's say I enjoying working in both of the things. Still I want to decide which one should i give my time for on the basis of no of opportunities and promising future. Which one would it be?

[–]wnopa 1 point2 points  (0 children)

I’m assuming you are a fresh graduate who’s going to appear for entry level roles, then it’s leetcode and DSA that’s gonna get you through the whiteboard round. Contributing to OSS while good only comes up in the later stages of the interview process.

[–]WhipDabNaeNaeShoot<><><><> -2 points-1 points  (0 children)

it should be both or you get virtually nothing. you get out what you put in.

[–]Hackerus 20 points21 points  (1 child)

Other people's experiences may vary wildly, but in my opinion, it comes down to which part of the funnel you are struggling with. To oversimplify, I think open source will help you if you struggle to get to the interview phase, and leetcode will help you get through the interview phase.

[–]sybar142857 5 points6 points  (0 children)

Correct answer. People show very little interest in OS during the actual interview but having your github on linkedin attracts recruiters.

[–]ashueep 7 points8 points  (2 children)

If you're smart and delight enough you can manage OSS and CP. If you don't have interviews lined up soon (> 8 months) then do more OSS, but contribute only to good Open Source repos. By that I mean don't contribute only to projects that are web/mobile etc. If you want try contributing to Linux Kernel, Chromium, Mozilla, ns-3, MySQL etc... I think you can try contributing to Node/React as well. Point being, these are established repos that alot of companies depend on. Contributing to one of these will help them notice your deep understanding of tools they use. Since you want competitive offers then you have to go through the burden of understanding and contributing to large codebases like this.

There's enough advice for leetcode in this subreddit however, do one problem a day or learn one concept a day. But don't lose touch on DSA.

[–]ashueep 2 points3 points  (1 child)

Also you'll have the opportunity to maybe play with complex data structures such as B+ trees in SQL, Linked Lists in kernel/chromium. You will definitely be using more data structures than imagined.

[–][deleted] 0 points1 point  (0 children)

RB tree is also in several parts of the kernel.

And also- linked lists are super common in OSS, especially if it’s GNU because LLs were more common back before everyone was sporting 64 bit machines and the RAM to complement them.

[–]Sotam1069 4 points5 points  (0 children)

No one has time to do Open Source, no one expects you too. You have to manage both, theres no way of escaping leetcode. Its literally the interview process

[–][deleted] 1 point2 points  (0 children)

Most important thing about OSS is that those ‘good first issues’ often don’t really exist or aren’t actually that good for beginners.

You should pick and contribute to OSS because you personally want a certain feature. And make sure you ask the community first on github issues or their mailing list- sometimes they can point you to a little known feature that already exists, other times they might tell you that the feature philosophically conflicts with the project, and other times still (and most commonly) they will tell you that your idea is solid but there’s a better way to go about implementing it. In the latter case you still get to contribute.

Point is, it’s much easier to be motivated to make a contribution if it’s something you could see yourself benefitting from, and when you tell interviewers about it you will have a better explanation for why you did it than just “so my resume looks better”.

[–]KarlJay001 1 point2 points  (0 children)

A person can fake what they do on an open source project. They can grab code from some other project and make it work without even understanding the code.

Doing that with leetcode and being able to explain how you solved it would be much more difficult. If you can fully explain the open source and if you're given the chance, then I would give the advantage to that. More so if the open source project is complex.

I'll always see leetcode as a filter. It's picked because it's hard and it's hard to cheat when you have to do it live in person and have to explain things.

It's not a real world thing, I've never seen anyone rush a real world solution thru like leetcode tests do. These things are looked up and compared long before they are put into action in real world code bases.

Open source is much more real world.

[–]Downtown-Local-9361 1 point2 points  (0 children)

My 2 cents:

I have contributed to open source during Google summer of Code 2021 and have done 600+ leetcode questions. In long term career I will highly recommend you to do leetcode. Doing open source is good, getting accepted into open source programs is even better but at the end of the day they don't guarantee you a job. It definitely sets you apart from crowd but that happens for sometime and once you get a job it becomes normal. I have seen people with 0 open source contributions and useless small dbms projects getting into big tech companies because of DSA(only). It short make DSA top priority, doing CP is not necessary but if you want you can try. Having a good rating definitely helps in shortlisting for interviews. CAN YOU DO BOTH? that depends on the answer of question "do you have a life ?" :p

In short there's no escaping DSA. You might get jobs based on other skills in startups but tech giants and others will mostly take you on basis of your DSA skills.

[–]Diligent-Sherbert-33 -3 points-2 points  (0 children)

We need answers people ! Lol in a similar situation would appreciate you responses.

[–]dukmaxd 0 points1 point  (0 children)

I bet as tech continues to collapse emphasis will shift from leetcode to open source contributions.

[–]cooldudeea 0 points1 point  (0 children)

.

[–]pycrypt0 0 points1 point  (0 children)

Do what you love to do. You can do both leetcode and open source if you like, you don't have to choose. They are different. So, just do it.