Interview Questions

21200 01234 here, the bottom string represents the actual numbers(01234) ......

Software QA/Tests Interview Questions from Microsoft


(Continued from previous question...)

21200 01234 here, the bottom string represents the actual numbers(01234) ......

Question:
21200
01234
here, the bottom string represents the actual numbers(01234), the upper string represents their counts(the same also represents numbers) so, there are two 0's, one 1, two 2's, zero '3', zero '4'. Find a sequence of length '9' which satisfy this property..
number->count
0->2
1->1
2->2
3->0
4->0



maybe an answer:


Clearly 0th and 1st position has to be greater than 1 in case of length 9 digits.
To accumulate, We need 1 need to be placed for these 2 positive numbers, that make total 4 positions to be filled
0 1 2 3 4 5 6 7 8
d d 0 0 0 0 0 0 0
5 d 0 0 0 1 0 0 0
5 2 1 0 0 1 0 0 0

(Continued on next question...)

Other Interview Questions