Ask HN: Does anyone actually use data structures/algorithms at work?
6 points| rbnsl | 1 year ago
I imagine any regular SWE at <insert-product-focused-company> just ends up using libraries that themselves implement all the data structure/algo pieces, leaving you with just abstractions.
Anyone here regularly using/thinking about these? And I don’t just mean small things like when to use an array vs a map but the more complex stuff
cmpalmer52|1 year ago
So my solution was to turn each phase’s graph into a binary tree by converting the n-tree to a b-tree where each node has a parent, a child, and a sibling to make traversal easy. Then I gathered all of the nodes into a single ordered array of structs and used array indices to reference parent, child, sibling for each phase.
To trace up, you selecting the starting node and the phase and it would walk up the graph to a source or you could specify a source node and transverse down by phases to create a downstream trace showing all affected customers.
Each node also had protective devices, like fuses and switches, that could be activated/deactivated or predicted as sources of outages.
At the time, I could downstream trace to every customer of a substation in a second or less when most GIS based network traces took 10-15 seconds sometimes. Upstream traces were almost instantaneous. Plus, our customers often converted CAD to GIS and the lines lacked spatial connectivity without a lot of cleanup, but my trace engine could handle disconnected lines and devices that weren’t spatially connected by using attributes.
It was the biggest use of my data structures and algorithms knowledge that I’ve used and it was good enough for a software patent.
BOOSTERHIDROGEN|1 year ago
gavin_|1 year ago
Whether or not you use them in your work depends on the industry you work in. I reckon at Databricks or <insert-tech-focused-company> they used plenty of algorithmic knowledge and lots of complex data structures early on. But for <insert-product-focused-company> like you mentioned, I think practical product development skills are way more important -- architecting BE systems and knowing how to organize FE components in a modular and extensible way. Thinking like a user becomes more important than thinking like a scientist.
BOOSTERHIDROGEN|1 year ago
oxfordmale|1 year ago
Unless you work at the cutting edge, developing new database engines or cutting edge algorithms, you rare use data algorithms. My day to day challenges are not the algorithms but understanding requirements from humans.
JohnFen|1 year ago
We need efficiency and control, and that usually requires developing our own data structures and algorithms rather than using what's in standard libraries. This is amplified by our need to keep the use of third-party libraries to an absolute minimum.
NoddyCode|1 year ago
Plus, writing algorithms gives you lots of practice with recursion and iteration, and knowing when to use which where. And it's fun! You may not use the knowledge directly, but you do pick up a lot of little useful nuggets for real enterprise development.
jbjbjbjb|1 year ago
I think a lot of developers, even ones that studied computer science, don’t see it as useful or relevant. I feel like that makes them underestimate what the modern computer is capable of and also want to reach to the next shiny object to add to the stack.
PaulHoule|1 year ago
usgroup|1 year ago
qwertyuiop_|1 year ago
giantg2|1 year ago