Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It tests esoteric (aka borderline useless) knowledge. There's a big difference between that and, say, knowing how to use something actually useful like double pointers.

I had no idea how the C parsing algorithm worked for +++ et al, and I'm an expert C programmer. Then again, I'd also never use such ridiculous constructs in production code.



It's not that esoteric. You need to see it in a broader scope than simply something that the C standard specifies. It's about how parsing is traditionally done: by splitting input into token using a longest-match if multiple token fit the begin of input. Then you can use the token to do things.

Even if you don't know that much about the subject, you can still have an interesting reasoning about it. Seeing that it is ambiguous is already a good observation. You then can propose way to resolve the ambiguity and touch (willingly or not) upon the topics of operator precedence, associativity, greedy matching.

Those topics are not only relevant in parsing either, for instance associativity is an important concept for list operations such as folding (a right fold is different from a left fold).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: