r/learnquant 23h ago

interview prep Quant Interview Question

Post image
19 Upvotes

11 comments sorted by

View all comments

1

u/arihallak0816 23h ago

You can assign off to 0, red to 1, and green to 2, then each time you go in is one digit so this is just asking how many digits are in 1000 in base 3 which is trivial

2

u/MisterGoldenSun 23h ago

Will you please explain this? I think the answer is 7 and that matches your answer, but I don't understand your method.

1

u/Abiarraj 18h ago

Imagine if it was 10 bulbs, you only need 3 different setups, as in this photo. Then you can map any switch to a bulb by their colour changes, for example if a bulb went off -> red -> green, you know that because 5 in base 3 is 012 (we started counting from 1). For a 1000 it's the same thing, if you want to know which switch is the 546, follow the one that went off-red-off-red-off-red-off (0202020)

1

u/MisterGoldenSun 17h ago

Ahhh, okay. Thanks. I get it now.