Google Onsite L5 || Coding round 2

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-10-23Added By Anonymous
Source:Β Link
🧭 Experience: unknown
βœ… Outcome: Bombed this round.
πŸ’° Compensation: unknown
πŸ“ Location: unknown
🏒 Company: Google
πŸŽ“ Education: unknown
🎁 Benefits: unknown
πŸ“… Offer Date: unknown

There is a list of N ~1000 objects (can be whatever: dog, cat, house, tree, etc.) There is a list of M ~1000 additional binary features ("is it green", "is it a living thing", "does it have four legs"...)
There is a NxM table providing the value of each feature for each object.
cat, dog, tree chair
it is green 1. 0. 1 0
is it a living. 1. 1. 1. 0
does it has 4 legs. 1. 1. 0. 1
xyz 1 0 0. 0
+

is it a cat 1 0 1 0

Objective : give minimum no of binary questions we can ask to determine the answer. In beginning we dont know that what user has gueessed
Human.isGuessCorrect(String s) - true or false
is it a living,does it has 4 legs,it is green - 3 step does it has 4 legs, it is green - 2 step

No idea, how to approach this.Bombed this round.
Comments