Just curious about opinions here. My main language is JavaScript, and I know people probably assume I am a front-end developer / full-stack (reasonable biases). In reality, I've been primarily backend for several years now. Throughout my experience at Microsoft and Twitch, I've used a fair amount of Node.JS / vanilla JS, then a bit more TypeScript for the CDK constructs we all know at Twitch (our team was primarily responsible for building and debugging Amazon Builder Tools things). I've done the majority of my interviews in JavaScript and it has been mostly OK, since I've used it for so long, but just wondering if it matters.
I used to do my interviews in C++, but then I got burned during a Google interview when my interviewer talked about the inefficiencies of emplace_back vs push_back (I had no idea). After that point, I just decided to do JS because I was reasonably proficient at it, and it is actually faster to write than C++ in a lot of cases (less boilerplate).
The top LeetCode answers / YouTube explanations and such are usually in Java or Python, so sometimes it's also hard to find a good JS answer. I'm leaning towards Python, because it is more like JS and with less boiler-plate like Java, but I'm worried about something throwing out some random trivia about Python that I have no idea about, because honestly I haven't used it much in my career thus far.
From most important to least important, here are the criteria I'd consider wrt to language choice:
The above criteria is true for almost all Big Tech jobs. Interviewers here are trained to be language agnostic since the company uses dozens of technologies. (If you interview at a consulting shop, they'll likely be much more strict about what they want. These companies also pay significantly less.)
If you know JavaScript the best, I'd recommend sticking with it. You want to be able to solve problems, but also be able to talk about the material with enough depth that you goes beyond the surface-level syntax of the language (this becomes especially important for more senior roles).
I definitely would not recommend C++ since it is more verbose and you may get tripped up on the language specifics as already happened to you. Python is a good reasonable choice, but I'd only pick it if you have ample time to practice with it, e.g. minimum 3 months. I'd still stick with JS unless you want to learn Python anyway, since translating Python code you find online into JavaScript shouldn't be that hard.
We touch on this in more detail here masterclass about DSA interviewing so I'd check that out! Also check out Daniel Tomko's advice about interview prep here.
At the end of the day, anything can potentially matter when it comes to interviews as they're inherently random - There's no standard among the industry for how they should be conducted. That being said, I don't think you should worry too much about it, especially given that you're working with JavaScript, one of the most concise and widely used languages. Python is actually also a great interview language for the same reasons.
Going into the issue further, here's the breakdown I've seen:
If you're more interested in what the other side looks like, we actually gave a masterclass about it (heavily inspired by my experience back at Meta). You can watch it here: [Masterclass] How To Be An Amazing Interviewer In Tech
I'd say if you have a domain specific interviews like for Android/iOS or FrontEnd the choice of your language does play a role. For Android the interviewers would expect you to write code in Java and Kotlin. When I interviewed at Expedia I was asked to code in Kotlin as that's the official language for Android development.