To be honest, seeing about 200 lines that looked like this:
typedef struct Abc {
Abc *n;
Abc *p;
void *d;
} Abc;
Abc *foo(Abc *p, void *x)
{
Abc *n;
n = malloc(sizeof(Abc*));
n->p = NULL;
n->n = p;
n->d = x;
p->p = n;
return p;
}
Note, there are at least 3 (edit: at least 4) bugs in the above code. None should be syntax errors.Sorting it out was a bit of a challenge. I think the specific question that I was looking at deobfuscated into reading words and definitions in from the command line and maintaining them in a sorted list, then looking up the words and printing their definitions.
And I agree, it was a great interview question. I even had the ability to sit in front of the computer and test my fixes to make sure it worked.