Live data from Hacker News

Data structures and algorithms practice problems and their solutions

medium.com

1–10 of 20 posts

Re: Data structures and algorithms practice problems and their solutions

#2
As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]?

0. https://en.wikipedia.org/wiki/Imperial_examination

Re: Data structures and algorithms practice problems and their solutions

#3

As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]? 0. https://en.wikipedia.org/wiki/Imperial_examination

How much math do programmers need?

https://danluu.com/math-bias/

Re: Data structures and algorithms practice problems and their solutions

#4

As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]? 0. https://en.wikipedia.org/wiki/Imperial_examination

This is a valid criticism from a practitioner point of view. From someone doing research in algorithms and data structures or someone just curious about it at an intellectual level, there is a different criticism:

All this focus on algorithms for the sake of interview-preparation gives the false impression that the field is a closed body of work. In reality it is an active and lively field of research with many (even most) basic questions not yet understood.

Someone could go through these 500 questions and for (almost) all of them formulate variants/extensions that would be open research questions. So instead of memorizing them, ask for each: Is this the best possible solution? Can I prove it? What if I restrict what the algorithm can do? What if I give the algorithm extra powers? What if the data comes online? What if the input is noisy? What if I want to optimize space usage instead of time? Is there a trade-off between the two? Etc. etc.

And related to the parent question: does the problem model a real practical problem? Why not? Can the model be changed to be more realistic?

All that being said, at a first look, the list seems like a quite nice collection of techniques.

Re: Data structures and algorithms practice problems and their solutions

#5
Some of these answers are not great, and wouldn't stand up to interview scrutiny. For example, the "Check if linked list is palindrome or not" problem says copying the list would be too expensive. The proposed answer (recursion) some how avoids this.

The solution is technically right, but it's making a copy of the list too. The intuition is wrong.

Re: Data structures and algorithms practice problems and their solutions

#6
post #4

As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]? 0. https://en.wikipedia.org/wiki/Imperial_examination

This is a valid criticism from a practitioner point of view. From someone doing research in algorithms and data structures or someone just curious about it at an intellectual level, there is a different criticism: All this focus on algorithms for the sake of interview-preparation gives the false impression that the field is a closed body of work. In reality it is an active and lively field of research with many (even…

Not to mention it suggests these problem exist in isolation. These are neat problems with neat-looking solutions, mostly curated for elegance. Some are useful for embedded programming (doing X or Y in place or under certain time complexity).

This is almost never what you encounter in practice. In practice, you tend to get handed someone's creaking code and asked to build upon it.

Re: Data structures and algorithms practice problems and their solutions

#7
post #4

As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]? 0. https://en.wikipedia.org/wiki/Imperial_examination

This is a valid criticism from a practitioner point of view. From someone doing research in algorithms and data structures or someone just curious about it at an intellectual level, there is a different criticism: All this focus on algorithms for the sake of interview-preparation gives the false impression that the field is a closed body of work. In reality it is an active and lively field of research with many (even…

My post wasn’t intended to be a criticism - I was genuinely interested to know the answer.

I work on what are considered hard CS problems and I rarely find the difficult part is knowing some data structure or algorithm, but in finding a way of translating real world problems into something that makes sense in code.

Re: Data structures and algorithms practice problems and their solutions

#8

As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]? 0. https://en.wikipedia.org/wiki/Imperial_examination

Surely you know about Rosalind ? It's an online collection of programming problems related to bioscience. Each problem has a pamphlet with biological/genetic background.

There is no online IDE you must use, and no time limit. However, you're asked to paste or upload the output within a few minutes of downloading the randomly generated input dataset, so your solutions must be efficient. Rosalind encourages Python and provides relevant tutorials, but you can use any language you like. Rust, Lua, Javascript, Smalltalk, LISP, Nim, INTERCAL, Bash or Scala - it's up to you.

Re: Data structures and algorithms practice problems and their solutions

#9
post #8

As scientist (Molecular Biology background) who has transitioned to being a part-time self-employed developer, how often do you CS/CE people use any of this in real life? Is all this just equivalent to the Chinese imperial civil service examination system [0]? 0. https://en.wikipedia.org/wiki/Imperial_examination

Surely you know about Rosalind ? It's an online collection of programming problems related to bioscience. Each problem has a pamphlet with biological/genetic background. There is no online IDE you must use, and no time limit. However, you're asked to paste or upload the output within a few minutes of downloading the randomly generated input dataset, so your solutions must be efficient. Rosalind encourages Python and…

I have seen Rosland before [0]. It is fun, but the really difficult problems are the ones with tons of biological edge cases. The level of complexity biology throws at you is truly staggering.

0. http://rosalind.info/problems/locations/

Post reply on HN