Wrong. Questions aren't designed to be memorized. It shouldn't take months, or years, to prepare for this stuff if you already have a CS background unless you're really slow.
Wrong. Questions aren't designed to be memorized. It shouldn't take months, or years, to prepare for this stuff if you already have a CS background unless you're really slow.
Do you know that 'detect a cycle in a linked list' question? I can't imagine many people being able to answer that without having seen the question previously.
It's trivial to explain:
x^n = x(x^2)^((n-1)/2), if n is odd
= (x^2)^(n/2) , if n is even
Knowing that (or having figured that out yourself if an interview was your first exposure to this problem), it's even more trivial to implement, making it a math quiz far more than a programming exercise. (Though I later turned it into a programming exercise entirely to exploit an arbitrary eye bleedecution bug in the human brain: https://gist.github.com/LnxPrgr3/7154873d3eb8b1e5960851628c7...)Maybe that's what they intended. It's certainly legit if the job will have you actually doing, rather than applying, math. Except that it concludes you can math if you're smart enough to pretend to derive the answer you memorized after encountering it before. You might accidentally hire a bunch of crypto nerds.
The difficult thing about that shortcut isn't that you couldn't come up with it, it's that you wouldn't think to try coming up with it unless you are in a particularly painful situation.
I don't view this exponentiation speedup stuff as math-specific, it's something you can come across when efficiently updating string checksums under random access modifications and concatenations, or when solving some graph problem where you exponentiate an adjacency matrix.
Do you want to work with people who memorize solutions or do you want people who are innovative, genuine problem solvers who've solved interesting problems?
Google apparently has an NDA for the interview questions they ask, so they're trying to avoid quizzing people on stuff that they've memorized. I know any place I worked at always tried to ask "fresh" questions to people. There's just no point if they already know the answer.
Dude, is your definition of problem solving limited only to Algos and datastructs?
Because I can imagine sql optimization in the following ways: 1. Compiler modification to use different instructions 2. Hinting branch predictors 3. Modifying the database environment to use different operations under the hood 4. Use a different hardware 5. Use a different language 6. Allocate different memory configs 7. Use SSD
Do you even realize that CS is not algos and datastructs only?
An insight that can only come from experience and to someone who is actually interested in this.
I want to work with people like you, not with the person who can solve some stupid dynamic programming puzzle but can't do any real interesting stuff in the real world.