Pergunta de entrevista da empresa Google

How many ways that you can choose 3 desserts from a menu of 10?

Respostas da entrevista

Sigiloso

23 de jun. de 2012

Just to clarify: the original reviewer's answer - C(10,3) - is indeed incorrect. More specifically, C(10,3) represents a number of ways to pick 3 DISTINCT desserts. The problem statement does not suggest that the desserts should be unique; moreover, it's very natural to order three identical desserts! I believe the correct answer to be a sum of C(10,3) /* number of ways to pick 3 distinct desserts */ + 10 * 9 /*number of ways to pick 2 matching and 1 distinct dessert */ + 10 /* number of ways to pick 3 matching desserts */ = 220

15

Sigiloso

8 de ago. de 2012

If order matters (it would to me if I were eating them), and repetition is allowed, the answer would be 1,000 since you can choose any of the 10 for the first, second and third dessert resulting in 10 X 10 X 10 possible dessert sequences.

2

Sigiloso

10 de jun. de 2012

C (10, 3) = 120 - This is very simple

5

Sigiloso

13 de set. de 2014

10x10x10 = 1000

Sigiloso

22 de set. de 2015

10*9*8 = 720 combinations

Sigiloso

26 de abr. de 2017

45 I suppose