Software Design Interview Questions

649 software design interview questions shared by candidates

Implement a Singleton. Now, implement it another way (with the data member initially equaling NULL). Next, if the system has several users, how will you prevent concurrent access and deal with two users entering the 'if' at once in the first call (while still NULL) resulting in more than one singleton instance? What will you add to the code and where? How will you deal the fact that your previous answer is irrelevant in the majority of cases when the member is no longer NULL? (Double-checked locking)
avatar

Software Student Design

Interviewed at Intel Corporation

3.9
Aug 11, 2013

Implement a Singleton. Now, implement it another way (with the data member initially equaling NULL). Next, if the system has several users, how will you prevent concurrent access and deal with two users entering the 'if' at once in the first call (while still NULL) resulting in more than one singleton instance? What will you add to the code and where? How will you deal the fact that your previous answer is irrelevant in the majority of cases when the member is no longer NULL? (Double-checked locking)

Viewing 351 - 360 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 649 interview questions and reports from Software design interviews. Prepare for your interview. Get hired. Love your job.