Tech IndustryMay 13, 2019
Marvellelkimpact

How do embedded developers leetcode

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.

Intel Hunting May 13, 2019

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.

Marvell elkimpact OP May 13, 2019

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?

SpaceX muskytaint May 13, 2019

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.

Marvell elkimpact OP May 13, 2019

Yeah as soon as I failed FANG phone interviews, realized that C and FANG are incompatible :).

SpaceX muskytaint May 13, 2019

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.

VMware gearlt May 13, 2019

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.

Microsoft grm May 13, 2019

Ignoring verbosity, c++ is pretty good since it has tons of datastructures in STL that come in handy (that are not in Python/Java)

Qualcomm dynasty001 May 13, 2019

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

Qualcomm MzLC26 May 13, 2019

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++.

Marvell elkimpact OP May 13, 2019

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.

Qualcomm dynasty001 May 13, 2019

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

Western Digital BrienneTFT May 13, 2019

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?

Marvell elkimpact OP May 13, 2019

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

VMware gearlt May 13, 2019

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.

VMware gearlt May 13, 2019

This was interesting read. I use notepadqq, unfortunately it didn't made it to the survey.

Intel Hunting May 13, 2019

If you are from C background, learning c++ stl helps a lot as both problems which needs pointers and darastructure involves less code

Marvell elkimpact OP May 13, 2019

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.

SpaceX muskytaint May 13, 2019

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.

New
FtOA74 May 13, 2019

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.

VMware gearlt May 13, 2019

Do they do it C/C++ for speed?

New
FtOA74 May 13, 2019

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

Intel mr_pleb May 13, 2019

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.

Samsung cynt May 13, 2019

OP you said you failed in FANG positions . Did you try for embedded positions? I believe for these positions only c or cpp required

Intel mr_pleb May 13, 2019

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.

Samsung cynt May 13, 2019

One of my friend who attended fb embedded interview told me, they gave the option of only c or cpp.