Liron comments on Quixey - startup applying LW-style rationality - hiring engineers - Less Wrong
You are viewing a comment permalink. View the original post to see all comments and the full post content.
You are viewing a comment permalink. View the original post to see all comments and the full post content.
Comments (25)
It might be. I suggest you go ahead and apply.
/me looks up the job description on the website
I suspect I'm not qualified. I don't know Python (the only languages I'd consider myself competent in are C++ and Perl) and am basically at the "fresh out of college" level of competency at programming.
On the other hand... I think I can solve those screening questions!
I think you can do this in O(1) space, actually. Would it be inappropriate to post a solution here?
Edit: Actually, I guess my solution does technically use O(log(n)) space, because it takes O(log(n)) space to store an unsigned integer that can grow arbitrarily large...
I'm not sure I understand the question properly. Is the list you're given as input literally a permutation of the first N integers, or is it an arbitrary list of N things? If you're not allowed to "look at" the N items in the list and have to use an implementation that always performs the same transformation of the input, this is impossible. If N equals 3, there are six possible output cycles you can produce...
{a,b,c} -> {a,b,c} {a,b,c} -> {a,c,b} -> {a,b,c} {a,b,c} -> {b,a,c} -> {a,b,c} {a,b,c} -> {b,c,a} -> {c,a,b} -> {a,b,c} {a,b,c} -> {c,a,b} -> {b,c,a} -> {a,b,c} {a,b,c} -> {c,b,a} -> {a,b,c}
none of which include all 3! permutations of {a,b,c}. So you have to "cheat"... which should be possible, because everything is stored as just bits (integers) anyway...