You can also follow https://www.facebook.com/codingpill for Silicon Valley style interview questions
CodingPill
@CodingPill
Mock interview practice http://www.codingpill.com
Posts made by CodingPill

RE: System Design questions

RE: How to debug segmentation fault? What are the best practices to avoid segmentation faults in the code?
Start with the stacktrace. Figure out who is causing the segfault (either use the debugger or print all the variables that are involved). Now you need to find out where in your code things start going out of track. You can use a binary search technique setting a few checkpoints (could be either debugging breakpoints or print statements) until you isolate the place where the bug initiates from.

RE: Find out the set of denominations
My bad, should be something more like
for (i=1; i<N; ++i) {
if (a[i] > s[i]) {
coins.push_back(i);
++s[i];
for (int j=i; j+i<N; ++j)
if (s[j] > 0) ++s[j+i];
}
}O(n^2)

RE: Find out the set of denominations
@eyfmharb See my comment above, the Sieve of Eratosthenes can be O(n log log n) if implemented carefully.
for (i=1; i<N; ++i) {
if (a[i] > 0) {
coins.push_back(i);
for (int j=i; j<N; j+=i) a[j];
}
}proving that the complexity is O(n log log n) is quite complicated. You can find the proof if you google it.

RE: how to caculate the π
Let's assume you have a square of length 1x1. Draw a circle of radius 1 inside the square. pi is the ratio between the area of the circle and the area of the square.
Now pick a few hundred thousand numbers inside the square. Count how many of them are inside the circle. Compute the ratio and you have a pretty good approximation of pi.

RE: Lets create a group to discuss Design/OOD Qn every week
If you need some inspiration you can follow us on Facebook for daily system design and coding interview questions