Its common knowledge to use whatever language you’re the most comfortable with for interviews, but what if your language of choice does not come with build in data structures such as Priority Queues, TreeMaps, etc. Would it be advisable to switch? Would the interviewer be ok with you assuming a built in data structure exists and coding it as such or would they ask you to implement said data structure from scratch before actually starting the problem. Currently using Javascript to interview. TC: 128k
Which programming languages are you familiar with?
Very familiar with JavaScript, good with java, decent at C/C++, beginner at Go/Rust
Stick with the one you are most comfortable with. Usually in a tech interview, you just need to use a simple data structure, and then mention to the interviewer the benefits of using other better structures. What matters most is how you explain your thinking process. All interviewers want to see from you code is that it's logical and legible.
It’s usually good if you at least know that the language you’re using doesn’t have that DS implemented and explain you’re using a programmer defined class and maybe a few details of the implementation if they’re important. I’ve never had anyone ask me to implement it as the details would be trivial.
Would you switch languages if you received a Hackerrank or some other online assessment where something like this might come up?
An online assessment should have the data structure already implemented for the user unless the task is to implement it. Something like hackerrank would include code stubs where the classes are already declared.
Honestly if you are applying for a job that uses language x. Before the interview do some quick examples and get the gist of the language. Then at the interview apologize that you've never had the pleasure of working with it and you are super excited. That's if they demand the knowledge of the language on the resume. Beyond that like you said, use the language that you are comfortable with and if you need a priority queue and the language you like doesn't have one just Google up what library you'd pull in and state "this comes from this library"
This is great advice! I’m curious how you would handle and online assessment such as a HackerRank where you can’t explain yourself
That's a good question, "open book" where I can use the internet I'd use libraries (unless it said no libraries) and Stackoverflow to success. The point of those tests are to see if you know the concepts and can Google fast enough anyways. (also almost all languages aren't far apart unless we're doing something in ocaml). If it's in an interview room and you are supposed to do it in that room no internet allowed. But you are given a compiler. Well first I'd be questioning if I like this kind of work environment and would probably walk, but I'd end up writing the libraries myself if they weren't in the standard libs.
If you’re being asked to do treemap and priority queue problems during your interview and JS is your strongest/interview language, I think you’re either interviewing for the wrong things or you need to learn another language. Or, you can write those data structures yourself; you should be familiar with what they look like.
What language would you recommend?
Something used for back-end you can write in that’s second nature. What kind of job do you want? Front end roles shouldn’t be asking you these kinds of questions, so are you looking for full stack roles? What are the back-end languages for the companies you want to work for? Usually something like Java, Ruby, or Python. For hackerrank tests, the languages they usually test in when writing are C++ or Python and sometimes Java so those solve times and code stubs are generally going to be the best tested, though if I recall a fair number of people do interview in JS. But because JS isn’t necessarily meant for this type of application, it may be a yellow flag for an interviewer or hiring manager if the role you’re going for isn’t JS heavy, because it intimates that you are not proficient enough in a more suitable back-end language to interview it (if you’re going for a React role or something then its more logically natural for you to use JS than it would be if you were going for a back end or data science role or something).
Python or Java
Yes, it’s fine. PS: Funny how lots of commenters are playing up Java’s data structure advantage. If a company likes your mastery of Java, they want you for maintaining some deprecated code. RUN!
Haha so true! I work on a legacy app with all Java on backend. No code reviews, linting or anything. Seriously run for your life!
Tech Industry
Yesterday
628
Best LCOL or MCOL city?
Work Visa
Yesterday
5384
Last h1 attempt
2024 H1B
Yesterday
1267
H1B Results out
India
Yesterday
1326
Slavery has REVERSED! the US is the slave!!! Check out this dude who pays a personal trainer in India
Tech Industry
Yesterday
761
Do you really think Amazon is that bad
Just use Python
Some companies drill on language specifics, and how things work under the hood. I didn’t want to use python as I don’t use it in my side projects or day to day
What do you do when a priority queue appears? Does python has a standard implementation?