Live data from Hacker News

Data structures and algorithms I actually used while working at tech companies

blog.pragmaticengineer.com

1–10 of 547 posts

Re: Data structures and algorithms I actually used while working at tech companies

#3
It’s an interesting question why we focus so much on algorithms that are mostly not used on a day to day basis, but the topic of persistence that’s everywhere and which is often only partially understood is far from being this prominent.

I remember a stint in research, about data analytic non the less, where rarely anyone had a good grasp of SQL or any other way to persist data for that matter. It really puzzles me to this day.

Might be me finding most ORMs to be harmful if used without understanding of the underlying technologies.

Re: Data structures and algorithms I actually used while working at tech companies

#4
I recently had an A-ha moment when I realized that the problem I was trying to solve admitted a simple solution with dynamic programming, something I had never used outside programming competitions.

The problem was to divide a text into a number of tweets to make it a thread, with the obvious constraint that no tweet should have more than 280 characters, but you still wanted to minimize some cost based on how far your tweets were from 280 chars and where you divided them (e.g., dividing after a full stop is better than after a comma, which is better than between two works, which is way better than midword).

With a reasonable cost function, this really seems a textbook dynamic programming example (possibly much more credible than the entering-a-treasure-cave-with-a-rucksack story).

Re: Data structures and algorithms I actually used while working at tech companies

#6
I once coded a function to calculate edit distance. It was the algorithmic highlight of my career :)

But the general understanding of algorithms and complexity did help even in CRUD apps. It gives the bricks to form mental model of the underlying system. I don't need to code a b-tree but I may need to tweak its params.

Re: Data structures and algorithms I actually used while working at tech companies

#7
post #4

I recently had an A-ha moment when I realized that the problem I was trying to solve admitted a simple solution with dynamic programming, something I had never used outside programming competitions. The problem was to divide a text into a number of tweets to make it a thread, with the obvious constraint that no tweet should have more than 280 characters, but you still wanted to minimize some cost based on how far you…

> no tweet should have more than 280 characters, but you still wanted to minimize some cost based on how far your tweets were from 280 chars

That immediately brings Tex box badness to my mind. And the related line wrapping algorithm: http://www.tug.org/TUGboat/tb21-3/tb68fine.pdf

Re: Data structures and algorithms I actually used while working at tech companies

#8
post #5

Would you rather be interviewed on algorithm questions or Ravens progressive matrices? They both test the same thing, but at least one you can study for, is somewhat relevant to the job (and is legal).

Can you not study Ravens progressive matrices?

Re: Data structures and algorithms I actually used while working at tech companies

#9
A good wood worker tends to know the tools of the trades and more importantly know when to not use a tool and when to invent a new one.. That said not every cabinet is a work of art some are just there to be functional for long enough to justify their creation. I feel system interviews that dive deep about decisions and insights are far more useful than hitting a leetcode jackpot. Though it puts a high bar on the interviewer as well.

Re: Data structures and algorithms I actually used while working at tech companies

#10
I've used Dijkstra algorithm for calculating distance in a graph once. It was a highlight of that month. Of course I had to look it up(despite learning it and implementing it at university). Who remembers this stuff exactly after years of glueing libraries together? And even if you remember - won't you check it anyway just to be sure?

It's OK to ask people general questions (what's algorithmic complexity, what kind of algorithms and data structures they know about, what are the tradeofs, etc).

But expecting people to remember the exact steps of an algorithm they last used 10 years ago at university is just stupid. It's like asking engineers to remember the tensile strength of a material they could use once a decade. That's what the documentation is for. It will take 3 minutes to look it up when I need it (if I need it at all).

Post reply on HN