Apple Interview Question for Software Engineer / Developers






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

In external syn we only synchronize the our atomic code(i.e critical section). but in classes like Vector all function are synchronized(even constructor, getter, setter,methods)

- Venkat January 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you must sync access to all shared state variables.

- jeff April 05, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

The semantics of synchronized do guarantee that only one thread has access to the protected section at one time, but they also include rules about the synchronizing thread's interaction with main memory. A good way to think about the Java Memory Model (JMM) is to assume that each thread is running on a separate processor, and while all processors access a common main memory space, each processor has its own cache that may not always be synchronized with main memory. In the absence of synchronization, it is allowable (according to the JMM) for two threads to see different values in the same memory location. When synchronizing on a monitor (lock), the JMM requires that this cache be invalidated immediately after the lock is acquired, and flushed (writing any modified memory locations back to main memory) before it is released. It's not hard to see why synchronization can have a significant effect on program performance; flushing the cache frequently can be expensive.

source: wwwdotibmdotcom/developerworks/library/j-threads1/index.html

- viv March 10, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Dude... You can not synchronize constructor. Its a compile time error.

- Sagar September 07, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is so because in case of hash function we have a%n ==number value.For example consider a case where we have three numbers 143876%[total number of array] 143876%23 say column number 9 which gives it a single hash function. However if e consider the case of using array we will have to give a sequential function in index of array
a[0] =12 ,a[1] =13 etc...

- yasha.khandelwal02 April 01, 2012 | 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