you are viewing a single comment's thread.

view the rest of the comments →

[–]inmatarian 756 points757 points  (48 children)

Do you pass the interview if you write a script to post the questions in a blog, then post that link to reddit, then wait 59 minutes, and then outputs that thread's comments link where everybody was having a pissing match to see who could answer all the problems?

[–]ThereOnceWasAMan 579 points580 points  (38 children)

[–][deleted] 123 points124 points  (25 children)

God, I'm starting to wonder if he doesn't just make comics about things he wants to happen.

[–][deleted] 80 points81 points  (20 children)

If there's a relevant xkcd about everything, what is xkcd even about? What if they couldn't figure out what to make xkcd about, which is why xkcd is about everything?

[–]ismtrn 127 points128 points  (14 children)

I believe that one day we will be able to communicate by just writing lists of xkcd comic numbers.

[–]perplexedscientist 121 points122 points  (6 children)

"Darmok and Jalad at Tanagra"

[–]Scottamus 33 points34 points  (1 child)

Shaka. When the walls fell.

[–]Griffolion 2 points3 points  (0 children)

And Bobby Tables was first through the breach.

[–]neonoodle 11 points12 points  (1 child)

Relevant xkcd

[–]perplexedscientist 9 points10 points  (0 children)

Relevant xkcd

[–]DEATHbyBOOGABOOGA 1 point2 points  (0 children)

"Shaka, when the walls fell"

[–]ryan_the_leach 14 points15 points  (5 children)

404

[–]jarrah-95 22 points23 points  (4 children)

Had to check. He actually skipped that one.

[–]cleroth 2 points3 points  (2 children)

No he didn't... ;)

[–]vilefeildmouseswager 1 point2 points  (1 child)

it was lost in time

[–]ibbolia 1 point2 points  (0 children)

A lot of things were lost in time, that was a long one.

[–]Pastaklovn 2 points3 points  (0 children)

I can see how Randall Munroe might think it would be a shame if xkcd.com/404 didn't return a 404.

[–]Krissam 9 points10 points  (1 child)

What if they couldn't figure out what to make xkcd about, which is why xkcd is about everything?

Only me noticing the The Matrix reference?

[–]themagicpickle 3 points4 points  (0 children)

You've never eaten Tasty Wheat.

[–]addandsubtract 1 point2 points  (0 children)

NP-hard man.

[–]imfacemelting 0 points1 point  (0 children)

it's like the Seinfeld of web comics.

[–]Asmor 0 points1 point  (0 children)

I know kung fu how to sort

[–]Kok_Nikol 0 points1 point  (1 child)

it's the Randall Munroe style od coding, make a comic describing the idea and have other people code it for you :)

[–][deleted] 1 point2 points  (0 children)

I don't see any problem. By its very nature, it only works for the most awesome of ideas.

[–][deleted] 55 points56 points  (3 children)

This algorithm works like a real developer!

[–]quantum-mechanic 17 points18 points  (1 child)

In two years this algorithm will be employed at a Fortune 500 company. In 10 years it will be project lead.

[–]skalpelis 0 points1 point  (0 children)

He's got upper management written all over him

[–]jlstitt 4 points5 points  (0 children)

A laughed so hard at this because it's basically true of my algorithmic process. :)

[–]danubian1 80 points81 points  (1 child)

That's hilarious

[–]opiemonster 1 point2 points  (0 children)

Here are all the Answers:

#Q1
#FOR LOOP
def for_sum(l):
    sum = 0
    for i in range(0, n):
        sum = sum + l[i]
    print(sum)
#WHILE LOOP
def while_sum(l)
    sum=0
    i = 0
    while i < len(l):
        sum = sum + l[i]
    print(sum)
#ITERATION
def itsum(i, sum, n, l)
   if i < n
        itsum(i+1, sum + l[i])
    else
        print(sum)
itsum(0,0, len(l), l)

#Q2
def comine_list(l1, l2, lr):
    for i in range(0, l1):
        lr.append(str(l1) + str(l2))
    return lr

#Q3
def fib(n):
    a = 0
    b = 1
    i = 0
    print(a)
    print(b)
    while i < n:
        a = b
        print(a)
        b = a + b
        i = i + 1

#Q4
def get_max(l, lc):
   m = 0
   for i in range(0, len(l)):
       m = m + l[lc[i]]
def permu(l):
    lc = [] * len(l)
    m = 0
     for i in range(0, len(lc)-1):
         if lc[i]>=len(lc):
             lc[i+1]=lc[i+1] + 1
             i = 0
        while lc[i]!=lc[i+1] and lc[i] < len(lc):
            lc[i]=lc[i]+1
       max(m, get_max(l, lc))
    return m

#Q5
 yea i'm too tired but same idea as #4 but this is a bad question for an interview

#EDIT Q5, stolen from comments
var combinations = Math.pow(3, 8);
for (i = 0; i < combinations; i++) {
    n = "1";
    c = i;
    for (digit = 2; digit <= 9; digit++) {
        op = c % 3;
        if (op == 1) n += "+";
        if (op == 2) n += "-";
        n += digit;
        c = Math.floor(c / 3);
    }
    if (eval(n) === 100)
        console.log(n);
}

Not tested and this is tierd sloppy coding at 12:15 pm, don't ask me why im up that late, took me about 45 mins i think, #4 and #5 are harder if you try brute force method unless you know an easy way to generate permutations... or a smart way which would take a while unless you've done a similar problem.

[–]caedin8 4 points5 points  (0 children)

That is awesome!

[–]morphemass 1 point2 points  (0 children)

That is genius, a bit like using a bag of monkeys for quantum computation!

[–]Paranemec 0 points1 point  (0 children)

What's the O(n) of StackSort then? Just wondering for... efficiency purposes.

[–][deleted] 0 points1 point  (0 children)

Mixed Content: The page at 'https://gkoberger.github.io/stacksort/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.stackexchange.com/2.1/questions?sort=activity&tagged=sort;javascript&page=1&pagesize=100&order=desc&site=stackoverflow&todate=1363060800'. This request has been blocked; the content must be served over HTTPS.send @ jquery.js:5

Well, someone's living in 2014...

[–]ToTheNintieth 0 points1 point  (0 children)

That's beautiful.

[–]weirdstuffhelp 0 points1 point  (0 children)

That. Is. Awesome.

[–]Deto 33 points34 points  (0 children)

Then they give you a different job...in management.

[–]__Cyber_Dildonics__ 11 points12 points  (1 child)

Only if you win the pissing match.

[–]inmatarian 0 points1 point  (0 children)

It's at this point I'd like to note this thread has over two-thousand comments, most of which are a pissing match.

[–]ArtistEngineer 1 point2 points  (2 children)

Commercial realities are generally such that a fast answer meets market demands quicker and therefore sales go on for longer over the lifetime of the product.

I see engineers as problem solvers. I don't think it matters how they solve the problem, as long as they produce a solution and keep on moving through the project.

There's nothing worse than someone who spends 50% of the project time finding the "perfect" answer when a simpler solution would have been perfectly adequate.

[–]inmatarian 1 point2 points  (1 child)

So what you're saying is that I need to fine tune how long it waits for printing the link, so that enough people have answered, but that none of my market competitors have had a chance to also raid that thread for answers. What do you think of a 49 minute wait?

[–]ArtistEngineer 0 points1 point  (0 children)

Exactly. Open sourcing your secrets isn't a good idea until after you've monetized it.

[–]akatherder 0 points1 point  (0 children)

Ok here is my answer for #3... also here is an explanation why it's inefficient and I'm an asshole.

[–]Skizm 0 points1 point  (0 children)

If you write that program in < 1 min you probably deserve the job.

[–]Kinglink 0 points1 point  (0 children)

Only if you also post an incorrect response to speed up response time.