Apple Interview Question for Software Engineer / Developers






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

Use watchdog

- ANS May 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Check out to see if there is any closed loop in the graph.

- yasha.khandelwal02 April 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Check if there is a cycle (circlular wait) in resource allocation graph.
1) There are two kinds of nodes in the graph - process node and resource node.
process node - process or thread
resource node - mutex, semaphore; for mutex, a resource has only one instance, while a semaphore may have mutiple instances
2) When a process P requests a resource R, add a request edge (P->R) into resource allocation graph
3) When a process is granted a resource, request edge (P->R) is atomically transformed into assignment edge (R->P).
4) For system where each resource only has one instance, there exists a cycle in resource allocation graph iff there is deadlock.

- jzhu May 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

deadlock can be detected by analyzing thread dumps. We can us

jstack -l PID > file.txt

To get the thread dump.

Or use utility called jvisualvm on mac

- Mayank Jain August 23, 2017 | 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