Informatica Interview Question for Software Engineer / Developers


Country: India
Interview Type: Phone Interview




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

Volatile just ensures that all threads see the most up-to-date value of a variable, up-to-date meaning that it may have been updated by other threads. It's not guaranteed that any operations are atomic.

For instance, when two threads both execute x = x+1 with x starting at 5, you'd expect to get 7. But it's possible that you'd read the value for x as 5 in both threads, then the first thread would add 1 to it getting 6 -- then the second thread would interrupt and increment the variable, getting 6 -- and then your write operation writing 6 to x would execute and x would have 6 instead of 7. Volatile vars don't guarantee that this won't happen. They just guarantee that if one thread updates a variable, that change will be reflected in the next read of that variable that other threads do. Without volatile, even this isn't guaranteed and a thread might be locally caching its own copy of a variable.

- Anonymous June 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Nice read for java -> jeremymanson.blogspot.in/2008/11/what-volatile-means-in-java.html

- kartikaditya June 18, 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