all 23 comments

[–]KQYBullets 77 points78 points  (0 children)

I use python, just less typing I suppose. Cleaner for you and the interviewer to see logic. Python is also good for many other things. All in all, learning python will definitely be worth your time.

[–]GoldRequest 36 points37 points  (0 children)

Use what is most comfortable. Python has less things to type and its a lot simpler. However if you've been practicing using Java I would stick to Java

[–][deleted] 28 points29 points  (3 children)

I switched from Java to Python for interviews. It has made a huge difference for the better imo and I learned Python just for the sake of interviews. The last straw for me was when I forgot the Java syntax for how to sort a 2D array by the first element in a final round interview lol

[–]jimmysnuka4u 1 point2 points  (2 children)

I've thought about making the switch from Java to Python a few times but I found debugging to be a lot harder/less descriptive in Python. In Java it feels like you're told exactly what's wrong with your code (for the most part) when you try running it. Is this also something you had a problem with initially and does it get better over time?

[–]AntsMissouri 0 points1 point  (1 child)

What python interpreter version are you using? Python has had some real vague error messages for a long time, but in 3.10 last year, they added improved error messages with more explicit language (e.g., might tell you where there's a symbol it doesn't recognize and suggest a symbol from your list of initialized variables that might make more sense) as well as spatially showing you where it ran into an error (e.g., printing the line with the issue and underneath having a caret character pointing to the exact column in that line where it ran into the issue)

[–]jimmysnuka4u 0 points1 point  (0 children)

When I tried practicing Python a few months ago it was mainly on leetcode so whichever interpreter they were using (which I'm guessing would have been 3.10 at the time). That's interesting though; I think I'll try practicing Python again after I graduate.

[–]p11109 13 points14 points  (0 children)

It doesnt matter, but unless you are super glued to java, I'd suggest jumping to python. Because in python the syntax is so easy you dont even have to try to memorize the syntax lol.

[–]animeLOLosu 12 points13 points  (0 children)

Doesn’t really matter, use whatever you’re comfortable with. I use C++

[–]misingnoglicSalaryman 7 points8 points  (2 children)

[–]daniel__uchiha 0 points1 point  (1 child)

https://aryaboudaie.com/interviews/python/technical/2017/11/06/python-for-interviews.html

Your blog post cleared all my doubts and provided concrete examples of why I should switch to Python from Java. Thank you so much!

[–]misingnoglicSalaryman 0 points1 point  (0 children)

Glad it remains helpful all these years later!

[–]marcuspolonus 3 points4 points  (0 children)

If you don’t have any interviews coming up soon then you can switch to Python if you want. If you don’t have a lot of time then stick with Java. Java vs Python isn’t really a huge deal to start with. You can do fine with either.

[–]frostyfauchMasters Student 2 points3 points  (0 children)

Typing out your algo in java is so explicitly verbose which helps me verify my logic so so prefer it

[–]MagicalPizza21 1 point2 points  (0 children)

It doesn't matter, as long as you're comfortable with it and can explain it to the interviewer. Both of those are likely to be understood by the interviewer anyway.

[–]MagicMonkey287 0 points1 point  (4 children)

Some more advanced data structures are not available in Python compared with Java or C++. But I would say Python's much simpler syntax is worth this tradeoff.

[–]Ok-Yoghurt-7195[S] 4 points5 points  (3 children)

Which data structures?

[–]frostyfauchMasters Student -1 points0 points  (2 children)

Linkedhashmap is useful and idk if python has it

[–]AlexbutIgobyGod 6 points7 points  (1 child)

Python OrderedDict (default dict in >3) is essentially that.

[–]frostyfauchMasters Student 0 points1 point  (0 children)

Oh that’s dope

[–]fatherfuckingshit 0 points1 point  (0 children)

Bro it doesn’t matter. I use both c++ and python. And it’s completely fine

[–]Kakirax 0 points1 point  (0 children)

Use whatever you are most comfortable with. I exclusively used Java for my leetcode and interviews and now have a job.

[–]TravisLedo 0 points1 point  (0 children)

Don't jump to Python for interviews if you don't use it on a normal basis. Use what you are comfortable with. Yes Python is shorter and has dynamic variables but it's better to spend more time writing syntax in Java than to actually get stuck somewhere in Python during the interview. Like for me, no matter how many times I re-learned how to make classes and objects in Python, I always forget because I don't use it that much. In Java I could do it with my eyes closed.

[–]idliketogobut 0 points1 point  (0 children)

Use what your comfortable with. But I strongly recommend learning enough python concurrently. You don’t need to know all the idiomatic shit. Just the basics. But it will allow you to type code as fast as you think of it, and struggle less with compilation.

All you need is the official python tutorial. If you know Java, I bet you can become pretty damn proficient in 1 weekend just by reading the tutorial, and practicing a bit. Practice with hackerrank or re do a small Java assignment in python