# Interview questions in Beijing, China

Microsoft Interviews in Beijing

www.microsoft.com / HQ: Redmond, WA

41 Interviews in Beijing (of 8,422)

## Interview Questions in Beijing

Rand(7) from Rand(5) The simple solution is to implement RandBin() using Rand5(). int RandBin() { } Sorry this UI posts without warning int RandBin() { int rand5Res = Rand5(); return rand5Res < 2 ? 0 : rand5Res < 4 ? 1 : RandBin(); } And then use RandBin() to implement Rand7; int Rand7() { int rand = RandBin() << 2 | RandBin() << 1 | RandBin(); return rand < 7 ? rand : Rand7(); } int rand7() { while(1) { int n = ((rand5()%2)*4 + (rand5()%2)*2 + (rand5()%2)*1); if(n == 0) continue; return n; } } The rand5()%2 will generate 0 and 1 with equal probability and we need 3 bits since we are going from 000 upto 111. So we call this function thrice for each bit position. Show More Responses |

Given a set of strings. Check if a new string is equal to any of them. Here equal means the letters are the same, like abbc=bacb |

Give an idea to show how to rearrange the array a1, a2, ..., an, b1, b2, ... bn into a1, b1, a2, b2, ..., an, bn with O(n) computation time cost and O(1) extra memory cost. |

Implement Fibonacci in log_n time |

The student cards are 7 digit numbers, from 0000000 to 9999999. If they are not in order and I would like to make it in-order. I will give you 6 helpers, how will you help me to solve this problem and the complexity of solving this problem. |

how do you know about marketing? do you have any experience of marketing? |

No special questions. |

The questions are not so much tough, basically general question, the most important thing you have do is to convince recruiter that you could transfer previous skills to new role or position. |

How to evaluate a company? What is the company you analyzed? |

What impact do console game sales have on mobile game sales. |

**1**–

**10**of

**1,871**Interview Questions