|
Sure. Here's a log file of page accesses on our server. It's a CSV. The first column is the user, the second column is the page, and the third column is the load time for that page in milliseconds. We want to know what is the most common three page path access pattern on our site. By that I mean, if the user goes to pages A -> B -> C -> A -> B -> C the most common three page path for that user is "A -> B -> C". user, page, load time
A, B, 500
A, C, 100
A, D, 50
B, C, 100
A, E, 200
B, A, 450
etc.
So for this first question you should give an answer in the form of "A -> B -> C with a count of N".We would have two files, one simple one that is possible to read through and calculate by hand, and one too long for that. The longer file has a "gotchya" where there's actually two paths that are tied for the highest frequency. I'd point out that they'd given an incomplete answer if they don't give all paths with the highest frequency. The second part would be to calculate the slowest three page path using the load times. In my opinion it's a pretty good way to filter out people that can't code at all. It's more or less a fancy fizzbuzz. |
I feel like this is a fun thought experiment, but instead of thinking about "gotchas" I would be more open to having a discussion about edge cases, etc... The connotation of gotchas just seems to be like a trap where if you hit one, you've failed the interview.