Hacker News new | past | comments | ask | show | jobs | submit login

I've got a hard time imagining they were going for a solution other than you adjusting the base.

That seems to be what all restrictions, especially #7, lead to and it is a concept everybody that understands how module works should understand.

> 15. Hardcoding matrices is forbidden.

This was definitely meant to nudge you into the direction of adjusting the base.

The excessive number of rules was really weird, surely they could've just asked you to consider simpler a solution.

> Asked the interviewer if it was OK to rewrite it using only types, she asked her partner and he told me it was but that he couldn’t see the point of it and advised me it would not be the right tool for the problem given that there would be many more rules

I suppose this might've been such a hint.






I have almost 30 years of experience and I would never have thought of changing the base. I would have failed that part of the test.

But I am confident that I would have been very productive in the type of work they actually perform in reality


The problem is that adjusting the base selects for two kinds of people:

1. People who have come across that trick before.

2. People who have a lightbulb moment in the 45 minutes of the interview.

Now, given that someone has passed the test, what is the probability that it is because of 1 or 2? The VAST majority who pass the test will fall into category 1.

The test manages to have both low sensitivity and low specificity. Well done!

Most likely, the interviewers are completely unaware that the solution is only obvious to their uncurious minds because someone else told them the answer. They don’t appear to have an understanding of where quantum-leap ideas come from, or how to foster them.


> I've got a hard time imagining they were going for a solution other than you adjusting the base.

I agree that this is probably what they were going for, but it still seems a bit ridiculous that the conversion from numbers to the chosen representation is not subject to the same rules (i.e., you can call `.toString(15)`, and this definitely uses numbers under the hood!). If this is allowed, then you could also encode your numbers as the string "{n % 3}{n % 5}" and be done with it. Or if they wanted a unique encoding, "{n}{n % 3}{n % 5}" would work too!


The toString wasn't used in the solution. It was used in creating the solution. Encoding the numbers as your given string exceeds the max length of an encoded character per the rules.

I would have thought to create the matrix on the fly with a loop. Not as clever as changing the base, of course, but wouldn't that have been acceptable?



Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: