I usually do algorithm problems with c++, very familiar with the algorithm stl. Problem is my coding style might be nitpicked because I haven’t use it professionally. Do I have to use smart pointers? I also have the feelings that c++ interviewer tend to be competitive programmers.. Should I still choose it? I am proficient at Java too but it is so much more verbose that might slow me down. Which one? Or is it fine to mix and match in google interviews?
You should be fine with c++
Use the language you’re most comfortable with. That’s it.
Unless your interviewer expects you to write in particular language, eg. to check your domain knowledge, use your strongest language. If Google is asking for preferred language it means that they want to match interviewers who have experience in the language, to check if your usage of the language is correct. It is unlikely that you will be evaluated only on style. Also don't overuse the STL, during coding you can ask if you can use STL function of write your own version. The answers will depend on the problem and on what the interviewer is looking for.
I don’t have professional experience or domain knowledge in that language but am good at solving algorithm problems with it
Then you should be fine to use C++. Just make sure you know basic constructs. I often see people who are choosing c++ just to showoff on the interview and they don't know well established syntax, data structures or STL functions.
I’m a C programmer and use C++ for interviews. As long as you write decent code, not knowing something like smart pointers shouldn’t be a huge deal.
After interviewing dozens of candidates over the years, I am always mind blown by people chosing c++ or java for the coding interview. Any problem, even simple, require 2 to 3 times more code than the same in python or javascript. Also c++ and java code is WAY more complex to get it right, so many more ways to make mistakes. Big part of the job is to chose the right tools for the problem at hand. I see it as an orange flag when people chose c++ and java for the coding interview. They better nail it from start to end. If they chose an overcomplicated language and then forgot a ; and have a solution that doesn’t even compile, this is red flag.
Really? How does any of this make any sense? 1) A missed semicolon is found by intellisense immediately 2) What if they are an Android developer? Or work in finance in perf critical systems? Your best bet for interviewing is to use the language you’re most comfortable in, not the one with the most concise code. Please tell me you don’t think those “1 line beats 99%” solutions in leetcode are actually good code 3) Sheesh if you think most code should be written in python or JavaScript… what’s that about right tool for the job? Think harder, man. No offense but these are terrible interviewing criteria. Truly terrible.
In your mind “best tool for the job” probably means “simplest code on a whiteboard” but that’s a truly false way to understand what that phrase means. For an interview the best tool for the job is the one you understand the best. Which may or may not be the most syntactically concise code. But what interviewer in their right mind would judge someone for missing a semicolon, or for saying .size() instead of .length() on a Java string? A bad interviewer.
Tech Industry
17h
1570
Why doesn't OpenAI offshore and reduce expense by 80%
India
Yesterday
1465
Ideal indian parents
Software Engineering Career
10h
2134
L4 Google -> 45 interviews, 5 offers, AMA
World Conflicts
Yesterday
774
Peaceful Protest Hasn’t Worked and Has Been Met With Aggression.
Tech Industry
3h
642
Question about women in their 30’s?
Use STL algos and containers, a lot. Chances are you will not need any smart pointers other than for proper signatures.
So c++?