Google Interview Question for SDE-2s
- -1of 1 vote
count number of combinations which are not possible.- bit32413 August 05, 2017 in United States
There are 'n' empty slots.
A slot can be filled with 'O', 'E', or 'X'
A combination is possible if
1. 'O' s are placed in odd slot , 'E' a are placed in even slots.
2. 'O' and 'E' alternate among them,
i.e (OXOE) not allowed because between O s there is no 'E'; but (OEXXO) is allowed.
some allowed combinations
OEXXX, XXOEO, OXXEX
For 3 slots, not allowed combinations are
Only those combinations are considered in which O s and E s are in their respective odd and even slots.
i.e EEXXX will never be considered because a 'E' is in odd slot
A combination isn't allowed if 'O' is not followed by 'E' or vice versa
| Report Duplicate | Flag | PURGE
Google SDE-2 Algorithm
Interview Type: In-Person
Open Chat in New Window