This is for those who code in C with minimal bash/python. Leetcode can get out of hands very fast if we code solution in C. My story: I had to learn python for good 2-3 months before starting leetcode.
You have done yourself a favor learning python. It is probably the best white boarding language, followed by java. I've written some simple c++ on the whiteboard and with modern approaches it can be cleaner than java, but interviewers more familiar with java can get confused (assume I forgot to "new" something). I guess this is an opportunity to demonstrate communication ability and teach something but I worry others are silently and incorrectly assume mistakes are made.
Yeah as soon as I failed FANG phone interviews, realized that C and FANG are incompatible :).
If you really wanted to you could assume a higher level library exists similar to other languages, and it is usually a fair assumption. However, you only gain by expanding your skillset.
I was on the same boat. Intially when I started with CTCI I was implementing stack queue by myself. Then a friend suggested C++ STL and now I use C++ for interviews.
Ignoring verbosity, c++ is pretty good since it has tons of datastructures in STL that come in handy (that are not in Python/Java)
I have been Leetcoding in c++ exclusively as well since its just an extension over C which a majority of Q engineers write in. The STL library is fantastic and using auto for automatic type detection makes the code so much cleaner
I am from embedded background. Doing LC for past 4 months. I solved majority of problems initially in C. As I progressed I realized I should learn C++ STL and python to solve graph related problems. I learned out of frustration on working with C. You don’t have to know python and C++ STL prior to LC. You can learn as you code more LC. I solved 250+ problems in C before using any sort of C++.
Well the question is not whether you can do. I myself had around 70 leetcode questions before I switched to python but the C code gets pretty huge and I seriously doubt I can complete even one medium problem in 45 mins if I have to allocate memory for every result, forget about follow up questions. I too got frustrated and gave myself a break from leetcode until I learnt decent level of python.
Wow. 250 in C in 4 months? Man thats commendable. I pussied out and learnt cpp on the go as i started solving more questions on LC
I'm on the same boat and just started learning python. My feeling is that it's way easier to understand than C++ STL. But I'm not sure how comfortable I would be in LC with python since my mind is still on C. Did you start LCing yet with python?
Yeah from past 3 months I am using python. The problem is that as a C developer I usually come up with a longer solution (say, using for loop where a list comprehension would do). Although my solution is of same runtime complexity but I still struggle to code it faster because I don't yet know all that python offers
I think STL with newer C++ has got really nice features which are equivalent to python. It's just a matter of getting hang of those new features.
Someone shared this on another thread: https://triplebyte.com/blog/technical-interview-performance-by-editor-os-language
This was interesting read. I use notepadqq, unfortunately it didn't made it to the survey.
If you are from C background, learning c++ stl helps a lot as both problems which needs pointers and darastructure involves less code
Well I chose python as I wanted to get rid of all the pointers stuff which I thought eats up considerable amount of time in both coding and debugging.
If op is not already fluent in c++ it is a lot bigger rabbit hole than python. Not saying you couldn't get good enough for leetcode, but there are more places for a seasoned c++ dev to poke at in an interview than for python. For example, I would seriously scrutinize a c++ solution written in 2019 with a raw pointer in it.
It’s not that bad to be honest. You have to remember that most competitive programming is done in cpp or c, so if they can do it it’s certainly possible.
Do they do it C/C++ for speed?
Speed, type declarations, memory management and pointers are very powerful tools if you do really heavy algo stuff. Leetcode is 90% of competitive programming, but the other 10% is just the small stuff like above and doing it really fast
I'm in the same boat but I've had my initial Python months before starting to leet. I find it much more comfortable mentally not having to care about memory management and verbose syntax. Python allows me to focus only on the algo and it has nice little builtin functions and functionalities such as slicing, strings, lists, "x if cond else y" which make the code very compact and easy to read.
OP you said you failed in FANG positions . Did you try for embedded positions? I believe for these positions only c or cpp required
Do they care what language you use for interview ? I assumed anything goes and domainc specific questions are on top of that. At least that's what a few recruiters told me but I have no interview experience.
One of my friend who attended fb embedded interview told me, they gave the option of only c or cpp.
If you are starting off, and learnt python, great. Go Geeksforgeeks, look at all the data structures (there is a single page). Start understanding them and solve problems using them. After few rounds of Tree, Heap(highly useful), Stack, Queue, hashmaps, start off with leetcode medium and hard. There is also a list for Dynalic Programming in Geeks. Go through them separately. Try to understand the memoisation and sub problem techniques. The more structured way you can study, the better. The randomness of Leetcode will never give you confidence. But more LC is better.
I have done all that and probably more (search "Coding Interview University"). It would however be much useful if companies used some kind of balanced past experience + programming questions. Wouldn't it ease the team matching process too?