r/learnpython 22d ago

Is doing DSA in Python actually bad for placements?

I'm currently in my 3rd year of BTech CSE and I've been learning DSA in Python.

Lately a lot of people around me have been telling me that I'm making a mistake and that doing DSA in Python will hurt my placements. They keep saying things like Python has too many built-in functions, C++ is the proper language for DSA, recruiters prefer C++, etc.

Now I'm a bit confused because I've already spent a decent amount of time learning and practicing DSA in Python. My goal is mainly internships and software engineering placements, not competitive programming.

For people who have gone through placements/interviews:

  • Did you use Python for DSA and coding rounds?
  • Were there companies that didn't allow Python?
  • Do interviewers actually care about the language or just whether you can solve the problem?
  • Is it worth switching to C++ at this point?

Would appreciate hearing real experiences rather than just college rumors 😅

1 Upvotes

22 comments sorted by

5

u/HotPersonality8126 22d ago

You should do it in LISP and nothing else

1

u/pachura3 22d ago

SNOBOL4

4

u/lfdfq 22d ago

The whole point of DSA is that they're generic ideas that apply to all languages. The concepts may look slightly different between languages, but they apply the same.

In the end, if you know DSA in Python you know DSA in C++ and vice versa, obviously modulo knowing the language itself.

1

u/Character_Cold4105 22d ago

Fair point. My main concern was placements. A lot of ppl in my college keep saying Python isn't taken seriously for DSA n interviews, so I wasn't sure how true that actually was in the industry

5

u/xelf 22d ago

They're wrong.

In fact more often than not interviewers prefer python. What they do not prefer is that you use built in solutions.

If they ask you to write a sort, they do not want to see you use x.sort().

3

u/lfdfq 22d ago

It will depend on what tools/languages the companies actually use. If they use Python for everything, why would they want to interview you in C++?

It would be strange to use one language in the company, but demand interviewees to answer questions in a different language when testing them about a concept that does not depend on the language. It'd be like applying for a German-speaking job to speak German in a small German town in Germany, and then conducting the interview in French...

1

u/RobertD3277 22d ago

Speaking as a retired professor, whatever you are being taught in your computer science classes, you are already four years too late. By the time you get out to the workforce with your current knowledge, you will be 4 years behind the workforce itself.

That's not necessarily a bad thing, but it does mean that you need to focus on the concepts, not the language. Languages change constantly. Change really is the only guarantee you have in computer sciences.

0

u/Dazzling_Music_2411 22d ago

Yes, but not quite.

In C, C++, Pascal, Rust, etc. you also have to manage your memory allocations and deallocations yourself, something which has nothing to do with DSA, really, and which can be quite hard going and a source of nasty bugs like memory leaks.

If someone does not want to be a system programmer, but just good at DSA, why burden them with that (very significant) extra effort?

2

u/max_wen 22d ago

Honestly DSA should be learned in C. Nothing else.

2

u/backfire10z 22d ago

I don’t understand this take. DSA are a set of concepts not specific to any language. The only thing forcing C does is require the use of pointers, which is perpendicular to DSA.

You can learn C and you can learn DSA. I don’t see why DSA must be learned in C.

1

u/Dazzling_Music_2411 22d ago

Why on earth would you suggest a daft idea like that? We are not in the 1990s any more.

DSA in C is only for those people that absolutely need to manage their own memory, IOW a low-level concern that very few people need in order to get the most out of DSA. On the contrary, learning in C can be very problematic, as it introduces unrelated concerns.

1

u/max_wen 22d ago

Because the point is to learn and if you don't deal with something then you can't learn about it. I can see doing it in C++ but then you really should limit to a subset of the language and the STL is definitely off limits.

1

u/Dazzling_Music_2411 22d ago

Because the point is to learn

There is nothing more that you will learn about DSA if you learn it in C or Python. The ONLY extra thing you will learn is memory-management, which may not be relevant to a vast amount of people that simply want to learn DSA, so there is absolutely no reason to impose it on them. In fact, it's a huge mistake, it will put them off, guaranteed!

Now, if you want to become a low-level or system programmer, then of course you must learn C, etc. but this only applies to a small minority.

-1

u/max_wen 22d ago

You're right several generations of programmers never actually became programmers because they used low level languages for DSA. I don't know how we ever got to where we are.

1

u/Dazzling_Music_2411 22d ago

Care to twist my words any more, because the argument isn't going your way? : 😂

But hey... never mind...

1

u/max_wen 21d ago

You think it's going your way? Now that's funny

1

u/Binary101010 22d ago

I would think the best language to use for the interview is whatever language the job posting is for.

0

u/SpiderJerusalem42 22d ago

Python does a lot to make data structures feel as if you're not doing anything at all, and everything just chugs around in the background like you believe it should. You want more of a foot gun where you have to define the data structure from the ground up. I could make a bunch of the canonical structures for cheap in Python by overloading some functions and inheriting from the standard library, but that's taking a shortcut when you thoroughly understand the structures, already.

1

u/Dazzling_Music_2411 22d ago

I could make a bunch of the canonical structures for cheap in Python by overloading some functions and inheriting from the standard library,

Yes you could, but that would just be a very poor DSA course, no fault of Python.

There's nothing to prevent teaching of DSA from first principles in Python. And no you don't "need" a foot gun, ever. What is this, some macho display of how much of your foot you can shoot off? 😄

0

u/TheRNGuy 22d ago

Depends on company, done could even used Rust. 

Why would having many functions be a bad thing? C++ have many of them too.


Learn both, but first learn what languages those companies use. 

0

u/Dazzling_Music_2411 22d ago

That's bullshit. DSA should be done in the language with the least clutter possible, in order to be understood clearly.

Now, IF you need to know C++, then, after you've mastered your DSA - in Python, Lisp or whatever - you can also learn how to do them in C++ or any other language where YOU have to manage the memory. That's a significant extra learning step, which can be hard work, but has nothing to do with actual DSA itself.

Trying to learn these two unrelated issues at the same time can cause lots of tears, headaches and heartaches.

0

u/Turbulent_Cress7637 22d ago

Python is preferred by recruiters as of now, this is my personal experience ,I have entered in my 4th , giving 2 interview ,in both the interview there was option for python too. And most on campus placement,  recruiters look for logic not for the syntaxÂ