r/datascience • • Feb 15 '21

Job Search Please STOP asking Data Scientists about Leetcode questions meant for Software Engineers for job interviews

I've been working as a Data Scientist long enough to say that asking Leetcode questions for Data Scientists is completely disrespectful. This is both for both product and ML-based data scientists.

Something simple is fine, like hashmaps, two pointers, strings, some light algorithms etc. But graph theories, DFS with trees/dynamic programming has nothing to do with data analytics, ML fundamentals, statistical foundations, and data storytelling competence.

I really don't understand. When you have a wealth of ways to distinguish competent Data Scientists from juniors during interview pipeline (complicated SQL, pandas, data munging, visualization, ML training, building simulation code, etc.), why you'd rather choose questions like "how many moves do you need to get a Queen chess piece from this position to another on a chessboard" as a way of measuring how well a Data Scientist would perform analytics or ML training on the job. It really just feels like SWEs making fun of Data Scientists about how poor programmers we are.

Most companies don't pull crap like this, but for those who do, PLEASE STOP. Unless we received a BA or MA in computer science -- which majority if not most of us did not -- we won't be able to solve shit like this unless we cheat and look at answers directly on leetcode or geekforgeeks. And it's infuriating and embarrassing for us to sink to this kind of level to solve questions that aren't meant for us. I get that Data people need to know programming, but WE AREN'T SWEs, and DS is not SWE.

Edit: I'm getting a lot of replies saying that I suck at programming and I need to learn SWE fundamentals. I said over and over that I'm not against understanding foundations of SWE (hashmaps, runtime, pointers, optimized solutions vs brute force). These are important. But when you get into highly niched algorithm named after somebody where you need to do some complicated tricks or build a whole system that requires multiple functions, DFS-based dynamic programming, multiple inheritance methods all in 45 minutes that would unnerve even seasoned SWEs out of practice, that's when it becomes totally unreasonable, outside the realm of data science, and just disrespectful to what Data Scientists do on a daily basis. But that's the line I draw, and the overall question is: at what point do interview questions become unjustifiable and unrelated to the position at hand? I've spent years using pandas, scikit-learn, tableau, and complicated SQL for daily data tasks. Why is it that you can't test me on this stuff which occurs on day-to-day basis for majority of data scientists?

Edit Edit: Btw, shame on those of you just downvoting everything I'm saying without reading any of it (I can't even locate my own comments anymore). It's immature and completely ridiculous. I know it's the internet, but have some decency and respect for your interlocutors. You guys are all professionals right?

984 Upvotes

324 comments sorted by

View all comments

22

u/datasciencepro Feb 16 '21

Unless we received a BA or MA in computer science -- which majority if not most of us did not

What? Most of us have a CS background.

It really just feels like SWEs making fun of Data Scientists about how poor programmers we are.

Because a lot of them are poor programmers. People have seen what comes out of the bootcamps and they got spooked from working with them. So now they need to put up some hurdles to weed those types out.

WE AREN'T SWEs, and DS is not SWE

DS needs some of the fundamental SWE and CS skills to make their work organised, useful and industry standard. The fact that you're complaining about being expected to know these skills is kind of a red flag for the quality of DS you aspire to...

12

u/[deleted] Feb 16 '21

No most of us do not. I work in the Bay Area, know plenty of friends in FANG, Salesforce, reddit, etc., majority of them don't have CS background. You can probably do a hypothesis testing on this, and I'm sure it'll come in my favor considering countless data scientists I've met.

Now if you say majority of the hiring managers/execs in data science roles come from CS background, I'd say you're right.

There is a difference between fundamental SWE concepts (hashmaps, runtime, two pointers, recursions, etc.) vs. full on DFS-based dynamic programming requiring multiple functions that would even pose troubles for established engineers who haven't interviewed for a long time. My close friends are senior SWEs at places like Tesla, they agree.

But none of this has to do with my point. If you're just going to copy and paste questions asked for seasoned SWEs and give it to data scientists, that's disrespectful. That's my only point here.

13

u/datasciencepro Feb 16 '21

It's not disrespectful. DS is one of the most in demand careers (from the employee side), therefore the bar has to be higher. There are more people chasing each DS opening than each SWE opening. So how do companies differentiate? This is how leetcode arose in the first place, because SWE at the top companies was so damn competitive. Now it's just like that with DS. So most companies reasonably say, let's get a leetcoder who can do DS because that whittles down the applicant pool and it's useful (i.e. being a good coder is complementary to being a good DS).

It's not about 'disrespecting'. It's the fact that DS is oversaturated and companies are forced to up the game. The fact that you call it 'disrespecting' just shows that you are victimising yourself for having to do leetcode, when everyone already has to. You are the one disrespecting what companies have to deal with with all the crappy programmers calling themselves DS because of bootcamps.

11

u/[deleted] Feb 16 '21 edited Feb 16 '21

Having to repeat myself is really annoying. I don't understand why I have to keep repeating the basic points. I don't mind leetcode. Period. I stated this multiple times and again in my edit. I'm saying that at certain point, when you ask hard level leetcode questions that require dynamic programming like island questions or some complicated search algorithm where you need to use some neat trick/memorization to get it, this is when it crosses the line because at that point it has little to do with data and science. Why do I have to keep saying that leetcode fundamental is fine? I said that hashmaps, pointers, recursions, etc. are fine. What did I get wrong?

And on your point of differentiation, there are many many other ways to differentiate candidates, whether that's complex pandas or SQL or something that Data Scientists use on a daily basis. If leetcode is fine, then why is not pandas and numpy? Such as creating simulations from scratch where you simulate expected value from binomial or bernoull's theorem, which would require knowledge of both stats, pandas, and coding? Do you see what I'm getting at?

1

u/Why_So_Sirius-Black Feb 16 '21

Hellos, do you mind if dm you some questions? I am senior stats major graduating this year but hoping to be a full fledged data scientist

4

u/Achrus Feb 16 '21

Thank you for this! I have a great respect for the SWEs I work with and aspire to be able to maintain a code base as well as they can. I entered the DS space with a background in mathematics and am a horrible coder.

What I don’t understand are the Data Scientists that say they know math so they don’t need SWE skills. In my experience, SWEs know more math than Data Scientists.

Graph theory? Your deep learning model is executed as a DAG. Your data pipeline? DAG. Knowledge bases? Not sure if it’s a DAG but they’re graphs. Topological Data Analysis? You gotta know graphs before learning simplicial complexes.

Treat machine learning as a compression algorithm or come up with a custom loss (that you didn’t find with grid search). You’ve just gotten into Information Theory. For that you need Stochastics and Real Analysis. I don’t know many of the fresh Data Scientists who have taken Real Analysis but I know many with CompSci degrees who are up to Info Theory.

Functional programming and Haskell requires Algebra, like real mathy algebra and not what they teach in HS. Algebra never clicked with me but functional programming is beautiful from a math perspective.

The thing is, Software Engineers have the math skills when Data Scientists don’t.

0

u/[deleted] Feb 16 '21

[deleted]

1

u/Achrus Feb 16 '21

I think the difference is in the type of mathematics but there isn’t a good word for it. Academically, MV calc, linalg, and diffeq are mathematics for engineering curriculum (like chemical / mechanical engineers). That is, data scientists are more studied in engineering maths while software engineers are more experienced with pure mathematics.

I only used Haskell as an example because of how crazy it is. R is great for functional stuff but then again deploying in R is a nightmare.

2

u/[deleted] Feb 16 '21

Statistics majors also don’t typically take discrete math and algorithms. Real analysis and upper div lin alg sometimes are needed for grad programs but still not anything to do with graphs. I actually dont know many CS that do Real Analysis

3

u/Why_So_Sirius-Black Feb 16 '21

Lol I have taken analysis. Proofs are hard but fun but like yo, wtf. That’s seems unfair to require such a deep rich mathematical background in addition to cs stuff. Oh well, I hope my math minor will cut it. Maybe I can look into doing a masters in comp sci online or something

1

u/Achrus Feb 16 '21

Hahaha oh god sorry. All that math isn’t (and shouldn’t be) required for data science. I want to highlight that SWEs use a lot of math a lot of math as well and the “I do math so I don’t need to know coding” attitude of Data Scientists isn’t necessarily true. Backend software development is grounded in some really advanced mathematics.

3

u/proverbialbunny Feb 16 '21

SWEs know more math than Data Scientists.

All of data science is applied statistics. Is statistics not being considered in this?

Also, most of the topics you're listing data scientists know better than vanilla software engineers. However, machine learning engineers and quant researchers tend to know quite a bit more math than the average data scientist. Maybe when you mention SWEs you mean ML engs? If you really like math, I highly recommend checking out the quant side of things. It's way more math heavy and a lot of fun.

The most common type of SWE is web dev, front end specifically. They need to know basic geometry to know where to place elements on a page, so there is some math there. The next most common type if infrastructure engineer / data engineer, and they need to know computational complexity theory. Knowing trees might help, but even graphs are a bit much. Though, maybe they help with setting up a database schema?

As a data scientist I've had to utilize graph theory for finding neighboring websites in a categorization project (it ended up working out well). Graph based models and ML are pretty rare though they are the hot stuff right now on the research side of DS. I don't think a data scientist needs to know it, but needs to recognize when to learn it, if necessary.

To say SWEs know more math is like.. it's not only false, but it might be romanticizing SWEs. If you think the grass is greener, you might want to consider doing SWE work for a while. Who knows, you might like it?

1

u/Achrus Feb 16 '21

All of data science is applied statistics. Is statistics not being considered in this?

Statistics isn’t mathematics and is more like physics where all the tools come from math. Probability theory is math though and is often taught alongside stats.

However, machine learning engineers and quant researchers tend to know quite a bit more math than the average data scientist.

I actually found data science after failing all the interviews for quant programs haha. Apparently “the math is interesting” isn’t a good answer for why you want to get into finance.

The most common type of SWE is web dev, front end specifically.

That’s where my misunderstand is. When I think of a Software Engineer, I only consider the backend devs / network engineers. Front end devs are just developers from my perspective.

Knowing trees might help, but even graphs are a bit much. Though, maybe they help with setting up a database schema?

There’s some crazy algebra involved with database design. If you’re interested, I highly recommend going down the rabbit hole of relational algebra. Trees are just for indexing and searching.

To say SWEs know more math is like.. it's not only false, but it might be romanticizing SWEs. If you think the grass is greener, you might want to consider doing SWE work for a while. Who knows, you might like it?

When I say SWEs know more math I just mean backend devs are better equipped in mathematical reasoning. I do agree though that data scientists have a larger mathematical toolbox.

Definitely enjoy the backend dev aspect a lot, I’m just not as good at it and the pay is better for DS right now. Perhaps data engineering in the future if I ever leave my current role.

1

u/proverbialbunny Feb 16 '21

Statistics isn’t mathematics and is more like physics where all the tools come from math. Probability theory is math though and is often taught alongside stats.

Ahh, that suddenly makes a lot of sense.

Is this a common view? Wikipedia says statistics is short for mathematical statistics and describes statistics as

Statistics is a mathematical body of science that pertains to the collection, analysis, interpretation or explanation, and presentation of data,[11] or as a branch of mathematics.[12] Some consider statistics to be a distinct mathematical science rather than a branch of mathematics. While many scientific investigations make use of data, statistics is concerned with the use of data in the context of uncertainty and decision making in the face of uncertainty.[13][14]

It might be ideal to be explicit about the view of statistics not being math when relevant. I can't imagine I'm the only one who thinks statistics is mathematics. It would certainly help minimize confusion.

That’s where my misunderstand is. When I think of a Software Engineer, I only consider the backend devs / network engineers. Front end devs are just developers from my perspective.

I've worked as a systems software engineer, which is the kind of backend software engineer that writes the software the industry uses. When I worked as a systems software engineer I worked on "the proxy" (that's its actual name) which is the layer 4 transit layer of the internet. Almost every ISP in the world uses it exclusively, except China, Russia, N.Korea, and some African countries.

The work was stressful because if I put a bug in code that was overlooked, we didn't have a way of reporting errors, so parts of the internet could literally be not working for months before we'd recognize it. Super intense. Can never put a bug in code. Lots of testing.

Personally from my experience, I found trees to be helpful, due to the code base size. I see each library that has a class that has a function that calls a function as a tree structure. Similar to navigating directories on your computer might have a tree view.

However, outside of that tree structures were avoided. We had custom lockless data structures for everything and then some, except trees and graphs. Technically a lockless tree could have been made if requested, but it would have been a bit of a pita and you'd be hard pressed not to argue for using an unordered_hash (dictionary in Python) as an alternative. Graphs were definitely not used.

On the networking side graphs are used by DevOps (and maybe MLOps, I don't know) as they have to connect a bunch of servers together and make sure the routing is correct. Ironically, to get a job as a DevOps person it does not require a degree. It has the lowest bar out of any dev type of work in the industry. They also need to know red-black trees because switch hardware internally often uses it, for diagnostic reasons.

For more math heavy SWE type work (outside of quant work) anything that has to do with AI is going to be math heavy. I love AI, more than ML, despite being a data scientist. I often do research into fields no one else has mapped yet and often AI type solutions are better than ML type solutions for really advanced and complex problems, but what I do is rare.

On the AI side some SWEs use it. Most notably is working on a maps or gps team. Path finding is technically AI, the simplest kind. Also scheduling and queuing problems for engineers who are mapping large systems of computers falls into AI problems, and so on. If curious: https://www.youtube.com/watch?v=TjZBTDzGeGg&list=PLUl4u3cNGP63gFHB6xb-kVBiQHYe_4hSi is a great class. A+.

Oh, and there is another kind of systems software engineer who does more advanced algorithms: People who work on database software. They study really funky (and fun) algorithms that go way beyond what school will teach. b-trees, rrb-trees, and so on. It's a lot of tree stuff, not so much on the graph side. Algorithms on the graph side tends to turn into AI real quick and very few SWEs ever do any kind of AI work. It's a topic that is almost like a bridge between DS and SWE.

There’s some crazy algebra involved with database design. If you’re interested, I highly recommend going down the rabbit hole of relational algebra. Trees are just for indexing and searching.

Oh, I see you thought of it too. I have friends who are senior systems software engineers at Snowflake. I had friends who wanted me to come work there as an SWE because I like exploring those advanced kinds of data structures. Studying the CPU cache is neat. But nah, I like my analytics more. It is a fun topic though.

Definitely enjoy the backend dev aspect a lot, I’m just not as good at it and the pay is better for DS right now. Perhaps data engineering in the future if I ever leave my current role.

System software engineers make the same or more than data scientists, due to being those crazy software engineers who study all the hardest topics. Knowing modern C++ is a must. Likewise, knowing functional programming paradigm is optional but super helpful. Do you know about SICP (and lectures)? It's MIT's old CS101 class. It's pretty difficult, but tons of fun. It's functional programming paradigm. If you're interested, it's a great place to start, though only for the ambitious.

Perhaps data engineering in the future if I ever leave my current role.

I recommend the job title infrastructure software engineer over data engineer. It's nearly the same work but infra engineers get paid roughly on par with data scientists. It's pretty chill work.

1

u/Achrus Feb 17 '21

> It might be ideal to be explicit about the view of statistics not being math when relevant. I can't imagine I'm the only one who thinks statistics is mathematics. It would certainly help minimize confusion.

Usually I just say Bayesian for mathematical statistics within the realm of Data Science. Mathematical Stats is applied probability theory but probability theory doesn't get much love, often being lumped into stats as a whole.

I think the issue is more so the definition of mathematics. The term is very broad and people will lump arithmetic, engineering, and statistics all under mathematics.

Kind of like saying: a racecar driver, a mechanic, a car collector, and an automotive engineer are all "car people." In this scenario, the automotive engineer would be the mathematician, the mechanic is the SWE, and the racecar driver is the Data Scientist.

> For more math heavy SWE type work (outside of quant work) anything that has to do with AI is going to be math heavy. I love AI, more than ML, despite being a data scientist. I often do research into fields no one else has mapped yet and often AI type solutions are better than ML type solutions for really advanced and complex problems, but what I do is rare.

I also love AI more than ML. I only see ML as a means to an end when you don't have a good AI for the problem. What keeps me in ML though is the current research in language models. Specifically transformer architectures for NLP. The transformer becomes so much more interesting when using context-free vocabularies and using data that's just a sequence of symbols rather than natural language.

> System software engineers make the same or more than data scientists, due to being those crazy software engineers who study all the hardest topics. Knowing modern C++ is a must.

Finally a reason to get back into C++! Been stuck working with Python and keep running into roadblocks with reflection, GIL, and how Python handles memory. I will definitely look into this and the courses you linked. Thank you for all the resources.

1

u/proverbialbunny Feb 17 '21

Yah, transformers are pretty cool.

I don't really have a modern C++ course that is exceptional. SICP is more brag worthy than anything. It will make you an overpowered SWE regardless what kind. Modern C++ tends to be picked up by doing projects. Zero cost abstractions and natural data types are really where C++ shines. One way to learn modern C++ is to learn Rust, as odd as that might sound. There are better tutorials out there and Rust forces one to learn to do things the right way, where C++ might let you do it other ways, but you end up shooting yourself in the food, so a good modern C++ dev is someone who is also good at Rust. They share the same concepts, just different syntax, so as odd as it might sound, you may want to consider checking out Rust.

1

u/proverbialbunny Feb 16 '21

fwiw, in 2020 data scientists with a CS background jumped up significantly to 21%. The most common degree data scientists historically and still today hold is a degree (or three) in biology.

1

u/[deleted] Feb 16 '21

Really? What about stats/biostats/applied math etc? I would imagine this is a large chunk.

1

u/proverbialbunny Feb 16 '21

Have you been on /r/statistics? While tension between stats and DS have been softening in the recent years, there is still a complex. DS is applied stats and most kinds of stats majors don't like the applied side so they go do biostats type work and similar. Some do end up as analysts though, and fewer end up migrating from analyst to data scientist, but there is definitely tension between the two fields.

Applied math often leads to AI and SWE type work. While I don't know the whole story there, there are not many data scientists with a math degree.

Data science is about pouring over data, cleaning it, analyzing it, feature engineering, and then maybe you might slap some ML on at the end of the day. Biologists not only do the same thing (collect data, clean it, analyze it, report on it), but there are little to no biology type jobs out there, so where else are they going to flock to?

1

u/[deleted] Feb 16 '21

Biology DS are probably bioinformatics, since that field values their domain knowledge. Sometimes the title may be interchangeable though in some places its called Bioinfo-DS.

Yea I have been on r/statistics and I am on the camp that thinks ML is statistics. I learned ML in a statistics department without ever touching data structures/algs and general CS. Some CS people are really surprised that one can do ML without it. These same people also overthink languages like R which leads to the notion of “R is trash and so difficult” but honestly R is a great example of how these concepts are not necessary to do ML.

Its almost like 2 entirely separate fields nowadats statistical ML and then this ML eng stuff (which I was never interested in, I want to do the former but like its really hard to do that in industry without facing these leetcode problems since most higher ups come from CS not stats).

1

u/proverbialbunny Feb 16 '21

Biology DS are probably bioinformatics, since that field values their domain knowledge. Sometimes the title may be interchangeable though in some places its called Bioinfo-DS.

I don't know. In my experience a lot of the data scientists I've hired have had biology degrees. No bioinfo that I've personally seen, though anecdotal.

1

u/Mehdi2277 Feb 17 '21

It's not about hire ups background but business relevance. I've interviewed with managers for ml roles that did not have a cs background but instead something like physics. It's still coding heavy just due to the typical work task nature. If you truly want managers with a stats background you can find a lot of them at finance companies. You'll still see a lot of leetcode over there too.

Amusingly I think math/stats heavy places have the hardest leetcode questions as those people tend to view leetcode like puzzles.

1

u/[deleted] Feb 17 '21

Yea even biostats positions these days in industry are starting to have this stuff. I was tested on easy leetcode ish problems (they were still tough for me though) for my current role and it was a shocker cuz I expected statistical programming. I was lucky to get through it since I was strong at the prob/stat and the few stat programming questions and at least didn’t completely bomb the coding relatively to others (but of course, when the other candidates are biostat/epi people the bar is lower for it lol). But against average DS it is harder to compete for sure.

Im thinking of checking this out https://www.manning.com/books/advanced-algorithms-and-data-structures?utm_source=freecontentcenter&utm_medium=website&utm_campaign=book_algorithmsanddatastructuresinaction&utm_content=article_03 and trying to implement some of it in Python/Julia.

1

u/Mehdi2277 Feb 17 '21

If you like books this is a really readable one for algorithms, https://www.algorist.com/. Book comes with slides/lectures from the creator too. Yours maybe good too, just unfamiliar with. CLRS is a classic commonly used and I've read a decent bit, but it's boring dense read.