CGI-AMS Interview Question for Java Developers


Country: Canada
Interview Type: Phone Interview




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

Solution 1

.
When admin2 is trying to update the 'description', a validation can be done against the admin2 page 'description ' with the updated data from the database.if it doesn't match
alert the user saying content changed and reload the page.

solution 2

When admin1 has changed the page content send an alert message to the admin2 session asking to reload the page.

- Sv December 03, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

One way is to enforce a read before a write to the web page. That ensures that every write is on the most updated data. But even that is not sufficient. THe 'RMW has to be atomic in some manner. For example, when a read is done for a subsequent write, a locking mechanism can be used with a timeout. The locking mechanism should use some identification that the subsequent write will provide that will allow it to go through.
A plain read from the second admin will be let thru but a RMW from second admin will either return an error code (try again) or block till the first write is completed.

- haroud December 04, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can implement solutions, using compare&swap strategy or use optimistic locking and try to fail it fast, so basically update admin with message, "stale data, reloading latest one..."

- Anonymous December 08, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can we use lastUpdatedTimestamp column in the product table and when we update it should same otherwise an exception is thrown with appropriate message and the page will be refreshed by calling the getproduct service.Admin2 has to reenter the data if he wants to update on top of the last update.

- abdul hafeez February 26, 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