What of above two languages is better for interviewing? Which one would be better choice in real life and why?
javascript if you are only frontend dev python if you are only backend dev Either if you are full stack
Have you ever heard of node.js :) JavaScript if you are building full stack. Easier to do SSR and much more. Programming language is just a tool used for use case to use case basis. Some are better than others, what gets the job done in optimal way possible
For interviews, definitely not Javascript due to lack of basic data structures which would be first class in Java or Python . In a real work environment it depends ... what you are building, your team skills, legacy etc
You can just make up the data structure as long as you define the interfaces. No one expects you to implement a heap or a tree map on the spot.
Well if the most optimal solution was using heap or treemap and the language doesn’t provide you the feature (JS does not have these DS built in ) in a 1:1 remote hackerrank exercise I don’t see how you can proceed further without significantly changing your implementation or switching to something suboptimal to complete. A Java candidate would have far better chances than JS counterpart in such an interview is the point I am trying to make.
If you really must, use python. But java by far is better for interviews. I'd you get asked questions that use TreeMap/TreeSet for an optimal solution, you'll be ad a disadvantage. Also Apple interviewing loves Java, if you dont show mastery in Java, you'll fail interviews
Any decent company and interviewer worth their salt won't care what language you use in an interview
Why would u bring up JavaScript? It triggers me. Brings nightmares. Let JavaScript die.
It won't. All sites use js
Depends on the interview. If you interviewer asks you to build a front end widget then use JavaScript or TS. If the interview is about DS algo or building api use python. Though you can do backend stuff with typescript if you use node and closure.
JS, just to unapologetically trigger the entire interview panel. 🖕🏼
I used to do JS but switched to Python—a language I've rarely used outside interviews for years. Honestly it has more to do with curly braces and parens than anything else. Even as a vim user, I can get my thoughts down a lot easier without having to line them up. If I need to change the block structure, I can just modify the indents and don't have to delete the braces. It doesn't happen as much as it used to, but on a whiteboard this is especially useful. Curly braces are impossible to do freehand.
Always found pythons syntax easier