3

*looks drowsy* Ugh my head..

You know what, guys? If you can freshly and directly remember how to do this:

- calculate the time complexity for each type of loop and code structure

- knowing how to write the following regex:
"A 15-digit number starting with a possibility of a group of 1-2 digit numbers, segregated into three 5-digit numbers tuples with three different separator characters, evaluated ahead"

- mentally work out how to reverse an array's indexes (swapping algorithm) without writing anything down

- know how to optimize a binary search in your head

then kudos to you. lmao
I'm rusty. It took me a while..

Comments
  • 1
    Nope, I would fail. And I‘m not ashamed to admit. That‘s just the typical bullshit that you don‘t need in your every day work.
    Maybe regex is an exception in that it can actually be useful sometimes. But not useful enough to be a necessity to master.
    What do you mean by optimize a binary search?
  • 1
    "Starting with a possibility" is incorrect English. Instructions should either be verbose and well structured with plenty of examples or be rigorously grammatically correct to avoid ambiguity.
  • 0
    The others aren't very hard, excluding that I have no idea what "each type of loop" is. I'm pretty good at finding time complexity though and since it's a tree walking proof for the most part I don't need paper unless the algorithm is really big or complicated.
  • 1
    @Lensflare Well, one of the interview questions talked about taking into account all edge cases (such as start index being -1 and end index being 1 or something) and that my answer didn't take those into account but only a few, so they recommended I 'optimize' my algorithm this way.

    As for work experience.. I've needed this type of stuff when writing custom and efficient search and document manipulation functions to efficiently handle millions of documents and e-mails at top speed.. just a lot of custom stuff.
  • 0
    @lbfalvy Apparently answering O(n2) for a nested for loop was incorrect because of some starting initialization index, they said. I think the correct answer as O(logN).
  • 0
    @CaptainRant What are the outer and inner loop's initializer, step and repetition criteria - the stuff inside the parentheses? Log(n) would most likely be i=1 to n with *2, but other variations exist.
  • 0
    @CaptainRant "optimize" sounds wrong for me in this case. You can optimize for speed or storage used. What you have described I’d call "making it robust".
    Not an expert, though 🙂
Add Comment