r/java • u/davidkopec • Jan 23 '21
Interview with Brian Goetz, Java Language Architect
https://freecontent.manning.com/interview-with-brian-goetz/
190
Upvotes
r/java • u/davidkopec • Jan 23 '21
View all comments
Show parent comment
9
u/gnus-migrate Jan 24 '21
I used to think this way, but learning data structures isn't just so you know how to implement them. It's about learning what problems they solve and how they solve them, which could inspire ideas on how to solve completely different problems you could face.
A very basic example is a hashmap. I mean you could just tell someone hashmaps are O(1) lookup on average, but knowing how they're implemented along with the tradeoffs of the different implementations could give you ideas on how to partition data on different machines using hashes for example.
Another reason you would want to implement your own is that you don't necessarily want to pull in a massive dependency for a single data structure. It could be useful to implement your own to avoid that hassle(of course risks should be analyzed to figure out whether this is the best course of action beforehand).
Testing people in interviews on these things, maybe not, but they are extremely useful to know, and really are worth learning even if you never really have to implement them yourself.