when you interview
please remember your basic data structures
like linked lists and trees
because i get pretty depressed
when i think about all the so-called
senior software engineers who don’t remember
this stuff or think it is all beneath them
i mean what have you been
doing all this time
writing linear searches
(that would explain a lot)
or architecting your way into a permanent
state of irreplaceable expertise
by erecting fucked up towers of xml and wsdl
schemas backed up by executable uml

oh god my head hurts
just thinking of the evil that people do
in the name of a little convenience

i once asked a candidate what kind
of structure he would use to do
pagination in a word processor

he said frankly i dont give a shit
so i thanked him for his time and
showed him the door
it’s probably the most honest response
i’ve ever heard


This entry was posted in Uncategorized. Bookmark the permalink.

15 Responses to interviewing

  1. Noons says:

    Why use a linked list for pagination when you can create an entire new framework for every page? And if you can attach to it an acronym that sounds “kewl” and declare it the new universal standard, that shoul;d earn extra kudos, no?
    (removing tongue from cheeck)

  2. Seamus says:

    Well thats a better question that “How many starbucks are in Seattle” or “Why is a manhole round”.

  3. Rannick says:

    Hashmap. The answer is always hashmap.

  4. Miguel Curacas says:

    Frankly, I don’t give a shit. 😀

  5. Jim says:

    Not giving a shit is not only the honest answer, it’s also the correct answer. Do whatever’s easiest, and when the profiler comes back with pagination at the top of the list — *snrk* — that’s when it stops being a waste of time to dedicate any brain cycles whatsoever to making pagination fast. Any earlier is premature optimization.

    P.S. I’ve been coding for twenty years, professionally for ten, and I cannot remember a single time I’ve seen appreciable performance benefit from a linked list. I *can* think of times I’ve used linked lists, or seen them used, in which they turned out to be a poor fit. The real practical use case is that it’s much easier to manage a linked list in C than it is to manage a linear array that can grow and shrink dynamically. Who gives a shit, indeed.
    P.P.S. Trees are super-useful though.

    • I feel you bro.

      The ‘do it tough’ culture of software eng, where most decisions are ego based and not convenience/common sense based is why i gave it a go, and I am now packing my bags to work at some organic farm, and after that start some off-gridder type of place for me.

      After learning ruby, i just cant see any reason to dibble in c/c++ or god forbid python. Unfortunately i am (was) in only 1% of programmers who thought that way, and since we have a democracy (a.k.a. crab basket) people just outvote anything that will get something done and out of your system. Instead they want to be the most productive galley rower on the boat… Cow-orkers indeed.

      Wage slave exit strategy

      C++ programming pioneer hacks off-grid, DIY, smart home

      I guess I came back around with those links as a public service announcement, since dad hacker of this site kept me from totally going bonkers doing my programming days 🙂


  6. FeepingCreature says:

    Personally, I’m partial to “linked list of arrays”. No wasted space for large insertions. Starts out with O(1) index, degenerates to O(n) under repeated modification. Constant-time deletes and inserts if you already have an index position, and it works well as an immutable data structure. It’s basically the best of linked lists and arrays combined, for only a mild slowdown from the double indirection. And when random access becomes too slow, you can always relinearize it by just copying it all into a new array.

  7. jerry can says:

    What is a “word processor”?

  8. I once used a double linked list to make a LRU cache for my own personal open source project which I made with a very strong “Not invented here” bias. But that was an open source project where it didn’t matter that it took nearly three years for me to finish the program.

    In my day job, no real client would be willing to wait three years for us to implement something like that; we would be crazy not to use an off-the-shelf library to implement something as low-level as a LRU.

    – Sam

  9. chrislynn5 says:

    I really think we should give a shit a little more. I’ve been coding for 15 years solid and work with more people that don’t give a shit and the code sucks, doesn’t work, and they don’t care. I mean if we are to do this 8+ hours a day, we should enjoy it.
    As for your question, maybe I’m missing something. What does pagination have to do with a word processor. Are you discussing the construction of your own word processor? When in a Word Processor do you paginate? I use pagination controls, .NET, to handle display, then datasets for data. But you can skin that cat many ways. I remember using recordsets. I love .NET and C#, and vb.NET. I’m simple and maybe I’m missing something.

  10. landon says:

    What does pagination have to do with a word processor?

    All word processors I’m aware of have to do page (and line) breaking. It’s harder than it sounds (go find Knuth’s treatment of this in TeX — he had some grad students work on the problem, and if I remember correctly it turns out to be NP-hard, though heuristics do a great job).

    TeX’s data structures are simple. Not all questions are The Big Question. Sometimes I toss out a lot of small questions.

  11. chrislynn5 says:

    So the answer is to create your own word processor.

    I don’t see the issue with pagination. It’s based on other “knowns”, i.e. page defintion meaning how many characters, objects, etc. So if you store each character as an array item then for presentation purposes have those “knowns” check each time for display adjustment (i.e. formatting rules). And if you allow insert page breaks, then search for that control character break in the array to do the same. I’ve never written a document editor/word processor but depending on what language and standard’s base you use, I wouldn’t think it to be that hard. But the conversation is interesting. Thank you.

  12. LOVE this.
    Are you intentionally paying homage to “Archy and Mehitabel,” by Don Marquis?

  13. landon says:

    @Preeva: Yes. I love Don Marquis’s stuff.

  14. Travis says:

    When you interview me,
    Please think about the code you write
    To avoid useless topics.
    I get pretty irate
    When I encounter these so-called
    “Technical interviewers” who think recalling
    Their vapid minutia is such a core skill.

    I mean, what do you think
    I should do with my time?
    Write Quicksort inline?
    (That would explain a lot…)
    Or keep the code base in a state
    Of perpetual disrepair
    By tightly coupling specific container types
    Into every API possible?

    Oh God my head hurts
    Just thinking of the talent interviewers lose
    in the name of feeling superior.

    I once was a candidate who could
    Answer all of those questions;
    I was fresh out of college.

    Now I ask my own perverse questions
    To those who waste my time. And they
    May show me the door,
    But none ever give a response
    That is correct.

    (Editors at last!)

Comments are closed.