I was recently asked an interview question whose answer I am curious to know, although I could not answer during the interview itself: Given user A and user B are running their tasks on a ubuntu 12.04 server as non-root user. User A is running mongodb with 52.2% memory usage. Is there a program in python which user B can run such that user A's program terminates itself or kills itself.
My Attempt: I tried to read a very large file into memory as user B. However, on doing so user B's program itself gets terminated or killed by the operating system. Is there someway of killing another user's memory intensive program as non-root user?
The interviewer gave me hint..he said if your process (user B) is more memory intensive than user A, then user A's process will automatically get killed in sometime. But I am not able to understand as to how can I design such a memory intensive program