I’ve been in my current team for 5 years now. I use only C++ at work. I’ve been considering learning python and using python for interviews. I am planning to give myself about 6 months for interview preparations since I haven’t interviewed in forever. Has anyone here learnt python just for interviews? How has that worked out for you? Would love to hear from folks who use C++ in their day jobs - if you guys stuck to C++ for interviews, how did this work out? Thanks
I did, it was fairly easy and definitely simply things... I didn't interview that much yet to give feedback but I would do it again.
I write C++ in my day job. I stick with C++ for interviews as it’s by far my strongest language. For string problems where people tend to prefer Python, stringstream, std::string, std::regex do the job really well in C++. If you know how to use this, coupled with strong STL skills and knowledge of the <algorithm> header, then C++ is something one should stick with for interviews rather than learning a language only for interviewing. One obvious exception is if you’re interviewing for PE at FB, SWE-SRE at Google, where you will be asked file parsing questions involving csv, json files then switch to a scripting language like Python/awk/bash/perl. Otherwise for LC questions C++ is sufficient.
What about the speed of whiteboarding? It takes longer to write out all the data structures like unordered map / pair / iterators. Wouldn’t you be faster in python?
It depends on familiarity in one language compared to the other. For pair , I just use template aliases with the “using” keyword and use that alias everywhere, similarly for iterators either use range based loops when iterating or auto it = begin(foo)/rbegin(foo) if you explicitly need iterators. C++14 onwards reduces a lot of the old overhead of long declarations. I had whiteboard interviews recently and I was pretty fast doing it this way. I would stress again, this works well if almost all your coding (LC and work related) is C++ , all that time spent brings out the speed.
Yup python easiest to code in . How ever only risk is you tend to forget normal logic you had learnt for example swapping x,y=y,x in python however in any other program language x=x^y y=x^y x=x^y similarly using for most other programs
There is std::swap(x, y); in C++
We should develop a language specifically for one lining every leetcode problem
I’ve been using Ruby for 3 years at work. I can’t really leet in Ruby cause I prepped in Python. Python is great and I had most of the syntax memorized after 50 or so leets
For one of my interview I was given parsing a file and average out few things, this can be done super easily in perl/python but took me a while to do in C++. I think it's good to learn perl/python for interviews.
C# here, started with python in Feb. Totally loving it. Way easier to write on whiteboard. Comparatively can write algorithm much faster now without sacrificing readability
I did and am doing it. Python is now my strongest language ahead of C++ and C#. I used runestone interactive for prep few years back.
Tech Industry
Yesterday
841
Chances of meta clearing E5 with screwing up one coding one round and acing all other
Tech Industry
Yesterday
2396
So hard being a women in tech industry
AMA
Yesterday
1135
Indian Gay Guy AMA
Layoffs
2d
42789
Google CFO confirms 'large-scale' layoffs
Tech Industry
Yesterday
27318
Google doing more layoffs, restructuring including country moves
Pythons nice cuz theres less boilerplate code that youd get in c++. But if u know c++ well then id just stick with that tbh.