by smnscu · 9y ago · 0 comments
And to avoid being called hypocritical, here's off the top of my head how the answers would look like (I don't use Python very often either):
1. len(thingie)
2.
def bubsort(arr):
if not arr: return None
for i in range(len(arr)):
for j in range(i+1, len(arr)):
if arr[i] > arr[j]: arr[i], arr[j] = arr[j], arr[i]
return arr
3. def revtree(node):
if not node: return None
node.left, node.right = revtree(node.right), revtree(node.left)
return node
edit: works well for something coded on the toilet: https://gist.github.com/andreis/69a242330617b2a62753ce604e27...Because, you know, they invented Ruby on Rails and Homebrew? Incredible, really. You were so adamant on being hostile that you managed to put yourself over Max Howell and DHH in a couple of sentences. These people have made valuable contributions to the tech industry as it stands today. This is a fact and not an opinion. They invented Homebrew and Ruby on Rails.
Good job, you solved the problems and are more likely to be hired by Google than Max Howell. Except he created the most popular package manager in OSX history and companies still can't see that.
First, Homebrew is just a rehash of package managers that were available on unices for more than a decade. Then, from what I hear, Homebrew was (still is?) badly designed and implemented for quite a long time, which is not an evidence of author's high skills (as a programmer, anyway).
Don't look now, but you just failed every interview I've ever conducted. Maybe consider a field where the skill you've just demonstrated would be useful -- politics, perhaps?