Re:Data structures and algorithms I actually used while work...
by suyash on Wednesday July 15, 2020 @04:22AM
(#23842592)
I've used Sort method several types both in Java and JavaScript but they way it's used it as a library function, I don't need to write my own sorting algorithm. Same for Data Structure commons ones I've used are found in Java Collections - ArrayList, LinkedList, HashMap, Set etc. For Deep Learning have used several algorithms that are best practices and common data structures like Tensors and Vectors. I realize the value of knowing the theoretical underpinning but practically speaking these are only ever written one by library creators, no idea why companies insist everyone to know these and implement by heart, they can ask much more interesting practical problems.
[ Parent
| on HN ]
Re:Data structures and algorithms I actually used while work...
by entha_saava on Wednesday July 15, 2020 @05:37AM
(#23843011)
The point is, they should not actually require candidates to recall these things from memory. But there is certainly value in the non-memorization part of this knowledge and the ability to solve this kind of problems distinguish people who can think from those naive jobsworths. If nothing, they are better than back-of-the-newspaper if-you-have-seen-the-answer-you-know-the-answer kind of trick questions.
Re:Data structures and algorithms I actually used while work...
by Cthulhu_ on Wednesday July 15, 2020 @04:26AM
(#23842616)
Java is an interesting one; while you don't write the sorting algorithm, you do write the sorting conditions, a function that returns a number depending on the compared values. Likewise there's hash functions, although in practice those will be generated by your IDE or Lombok. (I haven't been into Java for a while so there may be better alternatives, iirc Scala and / or Kotlin solve it as well)
Re:Data structures and algorithms I actually used while work...
by ajuc on Wednesday July 15, 2020 @04:43AM
(#23842712)
Most of the time instead of writing or even using sort you're better off using a sorting collection like TreeSet or TreeMap.
No need to sort everything again after adding 1 element.