Many people may have seen some image processing software, which can express a picture "fade out", reaching this effect, generally need to randomly draw pixels on the screen, and finally fill the entire explicit area. The usual implementation method is such that we have a random function f (n), you can get any of the integers between 1-n, and ensure that the uniform distribution is required, then this F (N) is used to make a cycle, It is easy to achieve the effects described in the previous. The current problem is such that for a N * N screen area, use such an algorithm to draw pictures, how much is its complexity? How to improve it and reduce complexity?
BTW, I really admire Microsoft, and the topic of the problem is a strong application background and practical significance. It is also required that the interviewer combines a few aspects of knowledge flexibly, temporary preparation is completely useless, or usually Accumulation, and a little "intuition" for programmers.
You are welcome to express our opinions through Comment. After a while, I will announce the answer.