I’ll interview at these places in 1 year or so and I’d like to choose a language to really master: this would mean choosing it for LC, studying it more in depth and trying to get projects/tasks at my current job where I could practice it. I’m currently decent at both, but expert in none. I’d pick Java because it’s arguably better for scalable backends but maybe nowadays with all the ML projects Python might be a solid choice too? In case company preference matters, here’s my preference order: G>F>A Motivating comments are appreciated :)
I’d say both. Always best to have at least one compiled and interpreted language under your belt.
But since in a coding interview it’s good to showcase deep knowledge of a language I think it might make sense to focus on one since time is less than a year
Use C++ then
In fb, c++>Java=python
Interesting. Can you elaborate on the “>”? :)
Just interview in PHP, you will be working in it anyways
Python, don’t make it harder on yourself than it needs to be
Do you interview in python. Do you job in c++/Java
I'd go with Python. The most relevant data types for an interview are easy to declare in Python and you don't have to worry about types. It's a lot easier to type "my_dict = {}" or even "my_dict = defaultdict(int)" rather than "HashMap<int,int> my_dict = new HashMap<>()". Not to mention iterator constructs work effortlessly in Python. You can do "for item in my_list:" and it conveys that you're going through everything in my_list. The corresponding construct in Java is far more verbose.
Yeah this is true. And probably since I’m preparing for interviews I should be prioritising interview performance in choosing language to practice. Do you have any opinion on Java vs python (or even go/c++/js) inside G? Like how useful is to know which of them in terms of career progression/opportunities
Whichever language you go with, you will have to learn to write it "the Google way." This means everything from style (variable naming conventions, whitespace, header file/import order, etc.) to using Google specific libraries (most of which are really high quality). Whichever language your team uses you will have good resources to learn it. I don't think there's a prestige level of knowing specific languages at Google, and a lot of that is due to most Google SWEs being polyglots. Because at the end of the day 95% of everything at Google boils down to throwing data into a protobuf and making a RPC call regardless of the language. Career progression is based far more on design ability and ability to launch a product rather than knowing any specific language or technology.
I've been interviewing for centuries in python. It saves you a ton of time and puts the focus on solving the problem instead of type safety and verbosity, which you don't need in the less than 100 lines of code you might write. You save non trivial time writing python which can make or break your interview I've been writing Java in prod code and wouldn't want to touch python with a 10 foot pole. It's hard to reason about across files and methods. I have been part of multiple python to go/Java migrations and it's not fun. Unfortunately because of the over reliance on ide, I can't write Java from my memory and make syntactic mistakes if not for that. Python is easy to write without an ide, and in fact, ide support is much poorer for python because of lack of typing etc Each language has it's purpose. Mixing them up doesn't help.
Thanks for the detailed comment! I can feel every point you made. I guess I’ll just prep for the interviews in Python and study all the language nuances that might come out during interviews. And in my job I’ll just take the tasks that seem the most interesting whatever the language
There are downsides to python. The Java collections are actually better than python collections, but Python wins due to brevity. Example, a max heap in python requires some trickery. In Java, you just declare the PriorityQueue with the Comparator you want. Another example, no BST in Python default collection libraries. Java has a TreeSet or TreeMap.
Python for sure. Coding in the interview will be tricky as it is, last thing you want is introduce another layer of challenge on top.
1. Python for leetcode / whiteboarding 2. java for building real, large-scale systems and actually hitting the ground running when you get hired. If you interview like a champ in python, but join a team which does everything in java, you're gonna have a bad first 6-12 months.
Learning java isn't hard
learning how to write production code well with interpreted languages and dynamically typed languages is harder than statically typed compiled languages imo
Always use python. Java is a distant second. Never use fucking javascript which has shit for all standard libraries. Basic requirements for languages to use in interviews 1. Broad support for object literals. In python you can write char in ['\n', ' '] instead of char == '\n' or char == ' ' in python you can access the last n elements in an array or string using arr[-n::] want to create a trie? ``` def create_trie(words): trie = {} for word in words: current = trie for ch in word: current.setdefault(ch, {}) current = current[ch] current['$'] = word ``` show me how you can do that in fewer lines of code in java 2. Standard library that includes all basic data structures, set, heap, dictionary, list, deque.
That’s a cool trick storing the word at the end.
Leetcode is a sports. Choose the one with less typing effort. In this case it means Python.
Definitely agree but no braces in Python is killer for me, I can't follow my own code after a certain point in Python
Agreed. But I think LC can be also used as an excuse to improve your skills in a language. Also the language you interview with (and are better at) might influence in which team you end up or the ramp up time once you join