5 ms·
I once jokingly answered in an interview question about time complexity something that is seemingly incorrect but is actually correct. Everyone knows object lo
by ThatGuysGood 23d ago
I once jokingly answered in an interview question about time complexity something that is seemingly incorrect but is actually correct.
Everyone knows object lookups (hash maps) are generally O(1) complexity and thus more performant than arrays for looking up values.
And that becomes a rule of thumb - codified as law.
But it’s not always true. For example if you know the index, the array lookup is significantly faster in virtually all languages.
But I answered in a way that sounded like it was exactly wrong. And it was treated as such.
To me, it sums up the problem with corporate intelligentsia. And it gave me yet another reason to be fake and lie all the time.
While I think the nuance should separate the strong from the weak, instead you just get snapped to a grid of mainstream talking points anyway, so you have to stick to that grid up front if you know what’s best! Choose the right paths and they are rigid