Epic Systems Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Written Test
Or two...
The reasoning behind saying that there's 3 is if one is Nike, one is Reebok, and one is Fubu, the conditions are satisifed.
However, there's another way to satisfy the conditions...there are 2 shoes, and both are New Balance, or some brand that's none of Nike, Reebok, and Fubu!
Or two...
The reasoning behind saying that there's 3 is if one is Nike, one is Reebok, and one is Fubu, the conditions are satisifed.
However, there's another way to satisfy the conditions...there are 2 shoes, and both are New Balance, or some brand that's none of Nike, Reebok, and Fubu!
In fact, it's good to show that these are the only two possibilities assuming a shoe can't be of multiple brands at the same time. Let the number of Nike shoes be N, Reebok R, Fubu F, and others O.
Then,
ALL = N + R + F + O
ALL - N = 2 => R + F + O = 2
ALL - R = 2 => N + F + O = 2
ALL - F = 2 => R + N + O = 2
From these, we deduce
N = R = F and 2 N + O = 2
Since we seek only non-negative integer solutions, either O = 2 and N = R = F = 0, or N = R = F = 1 and O = 0
It doesn't seem like the kind of problem you'd write equations for -- it seems like a straight-up logic problem -- but I ended up writing equations when I found two different solutions and wanted to know whether there were any more. As I showed, the two solutions I identified are the only two.
The answer is simply three shoes, it's because all are being circulated one-by-one and rest two remain of the other brand, so the most possible answer seems to be 3. Else and otherwise it was mentioned that there may be possibility of zero amount of original value.
There are three pairs, when you say all those shoes are reebok except 2,meaning 1 is reebok,other two are fubu and Nike.
Same applies in other two statements aslo.
I suppose that this method of solving it with equations works too, assuming all the shoes are one of Reebok, Nike, or Fubu. One other solution is possible if you don't make that assumption (namely, both shoes could be none of Nike, Reebok, or Fubu, and there would then be 2 shoes).
The one issue I have with assuming "both shoes could be none of Nike, Reebok, or Fubu," is the original problem says "All the shoes are Nike....(.etc)" In order to satisfy the "All shoes" condition with each brand, you must have at least 1 shoe that is of that brand. Given that, the only answer I see is 3.
It's also possible that you're over-thinking it with the formulas.. The question states "all of the shoes are..." for each brand, which leads to the safe inference that each of the said brands is represented by at least one shoe. Answering "2" disregards the indication that there is at least 1 of the other brands. So I think the answer, and the only answer, is 3.
I think two is the correct answer. Here's why:
All = x ("All" is "X" because we don't know how many shoes exist),
so if all shoes are Rebok minus 2 of them, then "All" is x-2
also, if "All" shoes are Nike minus two of them, then, again, x-2,
finally, "All" shoes are Fubu minus two of them, thus x-2 again.
so,
(x-2) AND (x-2) AND (x-2) = x
(x-2) + (x-2) + (x-2) = 0
3x-6=x (also written as 1x)
3x-6-1x=0
2x-6=0
2x=6
x=3
It all depends on how you interpret "All the shoes are Reebok..., All of the shoes are Nike..., etc" If Nike or Reebok or Fubu are 0, then you logistically cannot say "All of the shoes are x except..." You have to have at least 1 of something to say something 'is' or 'are'. But yes, this can be solved via the formulas above to assure yourself.
Three!
- lucky March 21, 2012