
The Intuitive Guide to Data Structures and Algorithms - leeny
https://www.interviewcake.com/data-structures-and-algorithms-guide
======
Veedrac
One thing I find generally worth improving with these sorts of introductions
is that they always seem to introduce data structures as a pick-and-mix bag of
prebuilt parts, rather than a set of techniques which allow you to enforce
_properties_ which allow you to build objects that do what you want
efficiently. Teaching the former is like teaching a physicist all the
different kinds of gear systems, rather than the math that lets you model
them.

Knowing how binary heaps and hash maps work is great, because binary heaps and
hash maps are very useful data structures, but knowing the fundamental reasons
behind them in a way that composes to building new things is much more useful.
What happens when you want properties that someone hasn't already built a data
structure for, at least as far as you can find? (Pet example: ordered
container with efficient append and the ability to query the maximum of any
subslice length k in O(log k). Extension: what are the minimal assumptions you
need to do better, eg. amortized O(1)?)

I think this contributes to the attitude where programs are built out of
monolithic, ill-fitting parts rather than actually looking at the problem and
building the solution which does the right thing, the right way. (Pet example:
if you designed websites as data structures and the browser to support doing
so efficiently, 90% of requests on a site like Reddit would be a single
`memcpy`.)

What I would attempt is rather than saying

"Here's one way we could do it: <explaination of pre-baked hash table>."

talk about the underlying tool first

"One tool that can help us is hashing: <explaination of general technique and
why its properties are useful>. In this example we want <these properties> but
can't immediately get it because our data has <these properties>. But we can
apply hashing to get <technique that looks decent but has caveats>. Handling
the caveats by doing <hash table things> gives us a data structure called a
hash table."

Yes, this is probably a harder way to handle things, but I'd like to think
it'd be worth the trouble.

~~~
chrisweekly
That was a clearly-written, knowledgable, info-dense and effective bit of
writing you just did, @Veedrac. Ever considered doing more of the same, and
delivering the kind of educational material you just described?

~~~
trishume
You can subscribe to Veedrac's HN comments on RSS like I do. I've found a
bunch of people like Veedrac regularly write really interesting things in HN
comments, so I wrote an app that lets you subscribe to them:
[http://hnblogs.thume.ca/](http://hnblogs.thume.ca/)

------
andrei_says_
A small thing: the slide in subscription popover contains language which is
dangerously close to the dark pattern of framing refusals as guilt/shame
inducing.

A simple no thanks would do.

Because “they won’t remember what you did but hey will remember how you made
them feel” and this made me feel “eww”.

~~~
gameguy43
Yeah, agreed. I'm thirsty for that install rate but more importantly I want us
to be a force for good.

Fixed in master. Not freaking pushing while we're sitting at #1 unless I have
to tho :P

Edit: Thanks for the note!

~~~
andrei_says_
You’re very welcome.

------
cbzehner
Interview cake is amazing. The way the problems are presented and the hints
are given is often better than what you'll get in an actual interview setting.

After using it myself, I could not recommend it any more highly.

~~~
irl_zebra
Same here, actually helped me in real life a lot, worth the money. No
affiliation with them. Their IDE sucks though.

~~~
gameguy43
:) New one is on the way! It's taken a while, but it's getting close.

~~~
bogomipz
Any chance of getting Go added to the list of available languages? It looks
like there is almost everything except Go.

~~~
gameguy43
It's on our list!

Out of curiosity: is Go actually your most comfortable language? Or are you
just interested in using Interview Cake to get some more practice with it?

~~~
pdimitar
In my eyes is extremely easy to [superficially] statically analyze, plus it
has enforced formatting at the language level.

Not the most comfortable language but a very worth addition!

------
victorhooi
I was tempted to buy this - howevever, what turned me away was the
subscription fee - it says:

> No subscriptions to cancel—this is a 1-time charge. > Access lasts (3
> months) 1 year.

So sure - the fee may not automatically renew - but then you lose access to
all the material after a year.

Is there not simply a way to pay for the course, and own a copy?

~~~
yawboakye
I've had the same concerns but I think--this is all my thoughts, no official
sanction--Interview Cake started by catering to people who had interviews
coming up, and so it didn't look like they will need more than a year's
access. Neither would they need the material after they got the job. But I
think @gameguy43 will see your comment and hopefully take it up with his team.
I'd love to have eternal access, but then the 1-time charge might be bumped up
too. Who knows?

------
gameguy43
Thanks for the post! Original author here. Happy to answer questions.

~~~
tenaciousDaniel
I really love this. Frustratingly few articles/posts/courses actually follow
through on their promise to make difficult material intuitive. I'm only
halfway through your Big-O post but it's already obvious that you've put a lot
of care into really making it accessible.

Well done!

~~~
gameguy43
That is soooo great to hear because every time we "finish" writing a new piece
we end up spending literal /months/ obsessively polishing it before taking it
live.

I always worry that we're just spinning our wheels. But it's great to hear
that the extra effort is showing through :)

------
quickben
A beautiful, amazing, and informative set of knowledge.

Sadly, an experience tarnished by the _three_ , _full page_ prompts for email
subscription, right in the middle of the information flow.

------
partycoder
I think these styles of puzzles borrow a lot from competitive programming
(e.g: ACM, IEEE).

And while competitive programming requires skill, what you do most of the time
is collaborative programming: create software that interoperates with other
software, with a user, that is maintainable, etc. Software without these
skills quickly becomes really expensive and hard to maintain.

------
gregable
This is really beautiful. I love that the images are SVGs as well, makes
perfect sense for these line drawings. Though it is a little bit of a bummer
that all of them have embedded fonts, even those that don't use text.

~~~
gameguy43
Oh iiinteresting I guess we are doing that! Probably not too hard to fix.
Thanks for pointing that out!

They used to be just inline svgs (instead of img tags), but (at least a couple
years ago) our research suggested using img tags was better for SEO and screen
readers and even page load time.

edit: (Of course, when they were just inline svgs, they got the fonts for free
from the surrounding webpage).

So far I'm thinking we'll just turn off the embedded fonts for images that
don't have text. Definitely not expert on this stuff though--open to other
advice!

------
codingninja15
@gameguy43, this is great guide. What resources were most helpful when
constructing this guide? Any specific books?

------
hbk
Take it easy with that email stuff. You say "no spam" but its literally
spammed all around the page.

------
nixgeek
What kind of 'annual renewal' rate do you get at $199/yr?

Is there a good reason not to just do $199 lifetime?

------
neeleshs
This looks good, but I prefer my copy of Algorithm Design Manual by Skiena.

