Amazon Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Phone Interview
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.
not sure this is efficient but Doubly Linkedlist with additional capability(See below) could solve the problem:
- HuggableAtol March 12, 2012Consider:
------C1 -- C2 -- C3
================
R1 || L1 -- L2 -- L3
.......||....|........|.........|
R2 || L4 -- L5 -- L6
.......||....|.........|........|
R3 || L7 -- L8 -- L9
The above diagram clearly explains L1 points L2 (next/prev element in row) and L3 (next/prev element in the column) and so on .
so the linkedlist class will be:
class node{
int data;
node *rowNext;
node *columnNext;
node *rowPrev;
node *columnPrev;
void delete row();
void delete column();
void delete element(){
//this one is tricky but a count of indices would make the deletion simpler along with updating the next elements in the current and adjacent row/column;
}
-to delete a column use columnNext to free the memory and update the rowPrev node's address everytime.
-to delete a row use rowNext free the memory and update the columnPrev node's address
-to delete an arbitrary element complex procedure [Update next and adjoint elements -- Creating a function would solve the problem]
****************************************
for the second part of the problem there is something called as DDEML (Dynamic Data Exchange Management Library).