Live data from Hacker News

Interviewing programmers: Analysis taster (work in progress)

solipsys.co.uk

1–10 of 34 posts

Re: Interviewing programmers: Analysis taster (work in progress)

#2
This one is awesomely embarassing. I submitted a quick response, but it turned out to (probably) be quite pessimal. Heh.

The challenge was of the category that triggers my "oh, that's easy!" knee-jerk response, and I still think it's easy. It's just that my knee didn't jerk towards the solution shown by RiderOfGiraffes, which really feels like the best one. :)

I think I'll blame job stress for my performance when it comes to this one.

Re: Interviewing programmers: Analysis taster (work in progress)

#3
post #2

This one is awesomely embarassing. I submitted a quick response, but it turned out to (probably) be quite pessimal. Heh. The challenge was of the category that triggers my "oh, that's easy!" knee-jerk response, and I still think it's easy. It's just that my knee didn't jerk towards the solution shown by RiderOfGiraffes, which really feels like the best one. :) I think I'll blame job stress for my performance when it…

I wouldn't claim my solution is the best. In fact, I think it's definitely not the best. It is, however, a starting point for comparison.

Given your comment I'd be interested to know which is yours - email me your submission ID?

Re: Interviewing programmers: Analysis taster (work in progress)

#5
post #4

Is there a full size image so I can read the labels and find my submission? :)

It wasn't intended for that purpose, but stand by ...

EDIT: OK, I've uploaded a larger version where the labels are readable, but I've had to change the layout so the nodes don't overlap. The lengths of the edges are now not always realted to the distance, although it's approximate.

http://www.solipsys.co.uk/Writings/x.dot.png

Note: Yours might still not be on it, as yours might be one of the outliers. You can email me your ID and I'll try to find time to send you some data. Or you can wait.

Re: Interviewing programmers: Analysis taster (work in progress)

#6
post #4

Is there a full size image so I can read the labels and find my submission? :)

It wasn't intended for that purpose, but stand by ... EDIT: OK, I've uploaded a larger version where the labels are readable, but I've had to change the layout so the nodes don't overlap. The lengths of the edges are now not always realted to the distance, although it's approximate. http://www.solipsys.co.uk/Writings/x.dot.png Note: Yours might still not be on it, as yours might be one of the outliers. You can email…

I see a "g902.d" on that graph -- is that a typo?

EDIT: and also a g900.d and a g901.d. Maybe not a typo after all.

Re: Interviewing programmers: Analysis taster (work in progress)

#7
post #4

Is there a full size image so I can read the labels and find my submission? :)

It wasn't intended for that purpose, but stand by ... EDIT: OK, I've uploaded a larger version where the labels are readable, but I've had to change the layout so the nodes don't overlap. The lengths of the edges are now not always realted to the distance, although it's approximate. http://www.solipsys.co.uk/Writings/x.dot.png Note: Yours might still not be on it, as yours might be one of the outliers. You can email…

Thanks - that's a bit better of a teaser. I'm happy to see mine isn't red, but it's pretty tightly clumped in the main group of solutions. That's not really surprising as it's not that far off from your reference solution, which seems to be the most straightforward way to go about it.

Re: Interviewing programmers: Analysis taster (work in progress)

#9
post #6

Earlier quoted context omitted.

It wasn't intended for that purpose, but stand by ... EDIT: OK, I've uploaded a larger version where the labels are readable, but I've had to change the layout so the nodes don't overlap. The lengths of the edges are now not always realted to the distance, although it's approximate. http://www.solipsys.co.uk/Writings/x.dot.png Note: Yours might still not be on it, as yours might be one of the outliers. You can email…

I see a "g902.d" on that graph -- is that a typo? EDIT: and also a g900.d and a g901.d. Maybe not a typo after all.

The 900's are my reference solutions. I'm intending to create solutions with the various feature sets to try to create clumps around them. If there are suitable submissions, I'll just identify and use them instead. For example, g080.d is pretty central.

Re: Interviewing programmers: Analysis taster (work in progress)

#10
post #8

How are you computing your similarity measure between routines?

I'm replacing recognised keywords with their initial letter, other symbols with "x", removing all spacing, retaining all punctuation, and then using a Levenshtein distance.

For example, this:

  void condense_by_removing(
      char *z_terminated ,
      char char_to_remove
      ) {
    char *p_read;
    for (p_read = z_terminated;*p_read;p_read++)
      if (*p_read != char_to_remove)
        *z_terminated++ = *p_read;

    *z_terminated = '\0';
  }
gets mapped to this:

  vx(c*x,cx){c*x;f(x=x;*x;x++)i(*x!=x)*x++=*x;*x='\0';}
I'm debating inserting braces around every block to assist with the similarity concept, but that's hard to do automatically without fully parsing the routine. The above "fingerprint" would then become this:

  vx(c*x,cx){c*x;f(x=x;*x;x++){i(*x!=x){*x++=*x;}}*x='\0';}
Post reply on HN