Bank of America Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: In-Person
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
I think the main problem with your solution is the lack of a restore method. When using a memento you don't want to replace an existing object with a memento, you want to change the existing object's state back to how it was when the memento was taken. Your originator doesn't allow for that.
- Anonymous March 21, 2013I'd stick on a restore method, and probably create a separate class for the memento because it probably doesn't need all of the originator's functionality and in many cases not all of its state. For example, if the originator is a word processor and it's creating a memento of the characters typed, you wouldn't want to clone the whole word processor.