Capgemini Interview Question for Senior Software Development Engineers


Country: India
Interview Type: In-Person




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

Singleton Pattern.

- Anoop December 30, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Singleton pattern will have only one object.But the question is about syncing state of all objects of that class.this pattern won't be applicable.

- Sv January 02, 2016 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The class can contain a static list of the weak-references of all the objects instantiated for the class. Whenever a function which modifies the state is called for an object, the object can call a corresponding static function in the class, which in turn, can call the same function for all the other existing (not garbage collected) objects for that class.

- Sumeet Singhal January 02, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The class could keep its state in static (transient) member variables rather than normal member variables. And the objects would modify this static state. This way, every object has its state synched.

- Nitin Gupta January 15, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

TextBox class can implement Cloneable interface. By default the clone method will do shallow copy of the given object. The "textbox" could be String member of another referenced class.
So, the solution goes like this. Every TextBox class object are cloned to each other. And as cloning provides shallow copy, the same referenced class object is shared amongst all the cloned TextBox class object.

- shoyeb.ibuse January 19, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Actually just having the member variables in static is not enough. We need them to be static volatile.

- aks April 02, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Observer pattern

- Nanda April 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Observer pattern can address this.

- Nanda April 03, 2016 | 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