summing-up the interview (internal drilling 1)
Interview training for the second MS project
For a product, how to test it.
Generally, it includes the following items
1, function
2, Security
3, performance and stress
4, Usability
5, Globalization
6, Compatibility
For a function, how to test it.
Generally speak, it can also consider as a product, but here we should focus more on the fnction
1, function
Positive => { Normal, Memory address }
Negative => { null, out of size }
Thread safety
2, Security and so on...
Some interesting problems
1), 100 people want to take a plane, and one of them is a fool, as a result he may take the wrong seat, and he is the first persion to board the plane, and the people after him will take the right if their seats are available, otherwise they will take a seat by random. The question is: what is the probability of the last persion can take his right seat?
///Any persion before the 100th sits on the fool's seat <=> The 100th persion sits on his own seat ///The 1st: 1/n = (n-1)/n*(n-1) ///The 2nd: (n-2)/n * 1/(n-1) = (n-2)/n(n-1) ///The 3rd: (n-2)/n * (n-3)/(n-1) * 1/(n-2) = (n-3)/n(n-1) ///The n-1: 1/n(n-1) ///Add all the above: 1/2
2), How to find the middle node from a linkedlist
///Use two pointers, the first pointer move 1 node every time, and the other move 2 node every time ///When the second reach the end, the 1st pointer holds the middle node's address---The extend problems: how to find the nth node from the bottom? Let one pointer move n node then the second start move
how to check if the linkdlist has rings? Also let one pointer move 1 node per time, the other move 2 nodes per time, and if they meets, we can sure that the linkedlist has rings.
3), How to draw a 1/8 circularity
But here I use the function CanvasRenderingContext2D.arc(...), If the function only provide Draw point, I think we also can achieve it: find out the relationship between x and y, and there scop, the use loop draw points.
4), To be do