
Algo Deck: an open-source collection of 200 cards on algorithms - teivah
https://github.com/teivah/algodeck
======
contingencies
Unpopular opinion: Programmer time is more valuable than machine time.
Maintenance is 90% of the life of a system. Therefore, just know the concepts
for each .md file, be able to describe their general properties, and be able
to work with existing implementations in the real world. Formal complexity is
rarely useful, because on cheap hardware very inefficient code scales very
well. Certainly, don't re-implement basics like sort, graph traversal or
queuing algorithms unless there is a pressing need.

For example, it is infinitely more useful (faster implementations, more proven
code, less maintenance overhead, free upgrades) to be familiar with _iconv_
and the data available in the Unicode database than to memorize random facts
about encodings.

~~~
TeMPOraL
> _Unpopular opinion: Programmer time is more valuable than machine time.
> Maintenance is 90% of the life of a system._

That's actually the _popular_ opinion.

Unpopular opinion: programmer time is more valuable than machine time up until
the product starts to scale and/or outlives the savings. A programmer spending
a week longer on doing something right might cost you a couple thousand
dollars up-front, and would repay itself only in a decade. Then you scale
200x, and suddenly that suboptimal code is bleeding you those thousands of
dollars a week.

Very unpopular opinion: the above examples is a good case; if your AWS bill
gets too large, somebody in the company will start asking questions. What
usually happens is that performance is _externalized_ to end-users. It's their
CPUs that burn through fossil-fuel-generated electricity that much faster and
can no longer run more than a few apps at the same time; it's their mobile
phones that need to be replaced a year early because of the aggregate bloat.
It's their sanity that's being assaulted by laggy, constantly acting up
devices. But it doesn't manifest itself as a separate line item on the
company's books, so nobody gives a damn. Instead, laziness and shoddy
craftsmanship is explained away by economic self-interest.

~~~
contingencies
Friends don't let friends use cloud hosting.

------
cycrutchfield
As somebody that interviews a lot of candidates, I almost never ask rote
memorization questions like these. I have to wonder, are there people who do?
What sort of signal do you hope to gather by doing so?

~~~
jldugger
It's probably better to think of it as the building blocks for answering more
complicated questions. E.g. you write an algorithm and one of the followups
the interviewer asks you is the runtime of it. Well, you used a hash table, so
lookups are constant time, but you iterate over the keys, which is is linear
in the size of the table. So when you do some work linear in the size of the
input for each item in the table, you can work out that's a quadratic algo.
That sort of thing.

~~~
koube
That's how I thought of it when I was studying leetcode, and that's the advice
I give to other people when they ask how I got my job. Each leetcode solution
was another tool in my toolbox. The more tools you have, the easier it will be
to put two things together for a larger solution, or to modify a tool to fit a
new problem.

I understand the resistance to flash cards as rote memorization without being
able to build upon them, I think that's a cogent criticism. At the same time I
think some people will be able to take advantage of this to build their
toolbox.

And as a minor note, I personally love when people can name an algorithm or
concept. There was one interview that I think I completely failed, but I was
able to name (but not write out) a concept. I actually incorrectly name
dropped Hamming distance, when it was actually the Levenshtein distance, but I
was able to diagram the concept behind it. I passed that interview (to my
tremendous surprise), and I think the name drop and the simple diagram helped.

------
gwilliams
_boolean checkExactlyOneBitSet(int num) {_

 _return (num & (num - 1)) == 0;_

 _}_

That looks like it'll fail when num == 0. I think it should be:

    
    
      return num && ((num & (num - 1)) == 0);

~~~
anentropic
maybe posting a github issue would be helpful

------
melling
I followed the link for Anki on the iPhone and it’s $25. No other options?

~~~
typicalhn
The authors (imho valid) argument (paraphrased) is that if you have 1k usd to
buy a phone when there are equally functional and more open 100usd phones then
you can pay $25 for an app.

Otherwise buy a $100 android and use the free app. Or use the windows and
Linux versions (free too)

~~~
iillexial
That’s a strange argument. There are many Android phones that cost $1k. Also,
my iPhone didn’t cost $1k

