$1000 coding challenge from E la Carte (YC S10)
42 points| rajatsuri | 14 years ago |elacarte.com | reply
Test your skills at http://www.elacarte.com/challenge and win $1000
Rules: Winner gets $1000. Next 5 top-ranked applicants get $100 each
Time and quality of submitted code are both factored into rankings.
[+] [-] thedufer|14 years ago|reply
[+] [-] o1iver|14 years ago|reply
[+] [-] georgemcbay|14 years ago|reply
There's nothing stopping anyone who really cares from getting the entire challenge ahead of time and then doing their pre-worked-out for-reals answer entries from a new IP address.
[+] [-] rajatsuri|14 years ago|reply
[+] [-] ryanfitz|14 years ago|reply
[+] [-] genieyclo|14 years ago|reply
[+] [-] rajatsuri|14 years ago|reply
[+] [-] anonymoushn|14 years ago|reply
The problem statement makes it seem that the grid presented to the customer is an array of 36 squares, where every square that corresponds to a letter or number that occurs in any index of any possible special (whether it is the special today or not) has been crossed out. How is the customer to deduce anything from this that he or she could not already deduce from the published list of possible specials?
[+] [-] alexis-d|14 years ago|reply
[+] [-] rajatsuri|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] oleg_kikin|14 years ago|reply
> We have received your submission and will be responding shortly
[+] [-] theycallhimtom|14 years ago|reply
[+] [-] rajatsuri|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] ColinWright|14 years ago|reply
[+] [-] swanson|14 years ago|reply
[+] [-] trickjarrett|14 years ago|reply
[+] [-] blhack|14 years ago|reply
If the former: what language, what assumptions can we make about the environment?
[+] [-] rajatsuri|14 years ago|reply
for q2 - just the answers are sufficient
for q3 - submit an explanation of how you'd tackle the problem, or code
[+] [-] Joshim5|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] Ben_Dean|14 years ago|reply
[+] [-] anonymoushn|14 years ago|reply
[+] [-] mherdeg|14 years ago|reply
The problem statement (paragraphed): Chef Claudio loves to have food specials but likes knowing what each day's specials are to be a challenge.
So, he assigns a random 3-digit alphanumeric code to each of the 250 items he might make and publishes this list. [1] [2] [3]
Each day, he chooses a set of five items to make and uses a grid with a square for each of the 36 letters/numbers to let guests know if a particular item they want is a special that day. [4]
To do this, for each of the digits of each item, he crosses out that square on the grid (if the square is already crossed out, he makes no change). [5]
What is the probability (to the ten-thousandths place) that a guest chooses an item and the grid makes it appear to be today's special when in fact it is not? [6] [7]
What is the probability (to the ten-thousandths place) that a guest chooses an item and the grid makes it appear to be unavailable as today's special when in fact it is available? [8]
---------------------------------------------------------------
[1] There's a list of 250 items.
[2] Each item has a "code" consisting of three alphanumeric characters. Each character was randomly chosen -- so "AA0" is a possible item name.
[3] No two items have the same code. (NB: This is not explicitly stated and does affect the outcome.)
[4] Five randomly chosen items are "specials" today.
[5] Everyone can see "today's codes": a list of all the characters that are in at least one "special". So for example if the specials are "AA1", "AA2", "AA3", "AA4", and "AA5", everyone can see that "today's codes" are the characters "A12345".
[6] We say an item "appears to be a special" if all the characters in its code are in "today's codes".
[7] We want to know:
What is the probability that,
A quick & dirty Monte Carlo simulation proceeds as follows:[A] This is how to generate the probability that this happens in a single trial.
(1) Store a list of 250 distinct three-character alphanumeric strings, chosen from the alphabet 0...9A...Z. This is "the list".
(2) Randomly choose five items from "the list". Record the five items as "today's specials". For each letter in each item, record the fact that "this letter is one of today's codes."
(3) Compute the denominator: how many items on "the list" contain today's codes.
(4) Compute the numerator: how many items on "the list" contain today's codes and are not one of "today's specials".
(5) Return the numerator divided by the denominator as the probability, in this trial, that you picked an apparent special which was not actually a special.
[B] Perform [A] a lot of times and average the probability returned in each trial.
This is not amenable to a quick Monte Carlo simulation. But after 100k trials it does seem to stabilize into one approximate region.
The actual answer that the system apparently wants (via brute force & curl) I do not understand at all. Seems like it's off by an order of magnitude. I must have messed up an assumption.
---------------------------------------------------------------
[8] This never happens - it's zero.
[+] [-] mherdeg|14 years ago|reply
I say "roughly" because they're almost the same order of magnitude, but still off by a few insignificant digits.
I wonder whether that has something to do with either of these assumptions I made:
[3] No two items have the same code.
[4] Five DISTINCT randomly chosen items are "specials" (it is not possible for today's specials to be the first item on the list five times).
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] VernatKhisamov|14 years ago|reply
[deleted]
[+] [-] alFoX|14 years ago|reply
[deleted]