Bloomberg LP Interview Question for Financial Software Developers






Comment hidden because of low score. Click to expand.
2
of 2 vote

@callbacker..If u know the answer can you please explain the sequence of steps in detail? That would be really helpful..

- KingKong.. June 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

sure.. here's the outline:
- Shell fork()'s and the child process exec()'s the image of the command (gcc in this case).
- The shell does not call wait() or waitpid(), because that would cause the command to run in foreground and shell prompt won't return until child is finished.
- So what shell does is install signal handler for SIGCHILD signal. When the child finishes, the kernel sends SIGCHILD signal to parent (the shell in this case), and shell calls the signal handler. In the signal handler, shell calls wait() or waitpid(), which reads the return value of the child process (so that child process does not become a zombie).
Voila!

- callbacker June 26, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Involves shell handling background process.
1. listing
2. when background process wants to access terminal, controlling through signals SIGTTOU, SIGTTIN

- AmitG November 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

exec is called by gcc and the executable for foo.c is loaded by the loader. Ofcourse before this load happens, linking needs to happen as well. The executable may have dynamically linked libraries and the load sys calls need to be embedded in the final executable image.

- landyaBhai June 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Thanks for that call backer..

- Kingkong July 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if the child process exit()'s before the parent process while parent process doesn't call wait()/waitpid(), then child process is in the status of Zombie....

- beyondfalcon August 17, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More