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

Any more detailed information about the coding challenge?

For example the repo references a 5Murls.txt file, but it isn't part of the repo and the blog says it needs to "output in a standardized format:", but doesn't specify what "standardized" means nor does the current code actually output anything (the printf is disabled). Does it specifically need to go to stdout or just that it exists somewhere in memory? Does it require a char* or will this char* be instantly hashed and tossed away? Does the challenge forbid the use of threads/cpus/workers? In the blog it says: "In this particular context the plugin architecture we were writing against allowed for returning the original string or a new malloc’d string" Are you allowed to muck with the original string? In the code on github it has a function that takes a const char* forcing a malloc, but it could easily just re-write the string in place if allowed.

edit: As for sorting the params, (based upon your comments about the common usage) pretty sure there is a way to do this without any string comparisons at all. Post a sanitized 5Murls.txt file and give it a go to make a patch.



The best algorithm depends upon the data presented. What is the:

- Average number of parameters

- The % that are already sorted

- The % that don't have keys that start with same letter


It also depends on the assumptions we make about the problem.

- Do we have to validate the URL strings in any way?

- What do we need to do with duplicate names?

- Are cases with small parameter names and/or small numbers of parameters common?

- How common are parameters with lengthy common prefixes?

- Is there a bound on the length of the longest common prefix of two different parameter names?

Tuning or special-casing with common cases in mind can often produce big wins.




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

Search: