Having a fast and responsive app is orthogonal to “knowing your big Os”. Unfortunately, most tech companies over-emphasize algorithms in interviews and downplay systems knowledge, and I believe that’s one reason behind sluggish apps and bloated systems.

I’ve seen this play out repeatedly. Interviewers ask a LeetCode-style coding question, which is then followed by the ritual of discussing time and memory complexity. Candidates ace the answers. But then… their “real” code suffers from subtle yet impactful performance problems.

  • affiliate@lemmy.world
    link
    fedilink
    arrow-up
    17
    ·
    1 year ago

    O(n2) means that as the input n grows, it takes exponential time to process.

    this is really pedantic, but O(n2) is quadratic, not exponential. the exponential runtimes are things like O(2n). when n gets even modestly big (say n=100), youre looking at a difference of 2100 ≈ 1.26×1030 vs 1002 = 10,000. this is just to say that exponential runtime is really in a class of its own.

    but otherwise i think this was a pretty good explanation of the concept