Adobe Interview Question for Member Technical Staffs


Team: Live Cycle
Country: India
Interview Type: In-Person




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

A* graph search with the heuristic function equal to the manhattan distance between the start state and the goal state

- mayank gupta October 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I asked him whether x,y,z co-ordinates of vertex are given or not. He told nothing is given.
Anyway I came up with this data structure (6-ary tree like).

struct node{
int point[3];
struct node* east;
struct node* west;
struct node* north;
struct node* south;
struct node* top;
struct node* bottom;
}

Then told him that to search for a node we can do BFS. However he was not satisfied. He was asking me to improve it.
I could not come up with better DS.

What I was lacking ??

- Nitin Gupta October 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i think it can be done like this cuboid all sides are equal so u can simply have int point instead int point[3] and based on size of the point we can store it in list .eg the input node are like this 50 30 49 20 11 2 22 then in first node store 50 in first list next 30 comes so again move 50 to second node and store 30 in first next 49 comes now move 50 to 3rd position 49 in 2nd now 20 move 49 to 3rd and 50 4th and 20 to 2nd then for 11 make it as first then for 2 make this as first node now for 22 all the entry in first node is done so check 22 comes in between which node 20 and 30 so put 22 as first entry on node 20 if u do like this searching will be more easy then bst only thing here is considering each node size is unique .please let me know any thing wrong.

- Anonymous October 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Anonymous :- From where did you get this idea "in cuboid all sides are equal". I learnt this property for cubes only. Anyway, I asked interviewer if co-ordinates are given or not. He told me nothing is given. If co-ordinates along with length,breadth and hight of cuboid would have been given then no need to use 6 pointers here, we can traverse simply by comparing co-ordinates moving accordingly.

Comments please.

- Nitin Gupta October 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think he was not satisfied because every node can be reached many different ways. Suppose if you reached a node traversing n nodes then it can be reached 6^n ways. This is exponential and therefore BFS would be inefficient. I would say go to the first node by traversing as much left, below and behind then traverse all the nodes layer by layer, row by row, cell by cell.

- Naveen Reddy Mandadi October 20, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think you should treat this problem as a Maze Problem

- Shwetank Gupta October 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I thought it as graph problem. Can you explain a bit more ?

- Nitin Gupta October 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

i think take a 3D array to store each cuboid and take another 3D array to store chain of cuboid like
struct cuboid
{
int east;
int west;
int north;
int south;
int top;
int bottom;
}
cuboid chain_of_cuboid[][][][][][];

- sukusuku October 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

in above its not 3D array its 6D array

- sukusuku October 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

above both comment is not valid ignore it

- sukusuku October 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Using an Octree structure may solve the problem.

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

Imagine the cuboid center to be the named point of reference. Then the problem will pan down to "finding search algorithm from a given sent of points (centers) in a 3-D space".
So, one possible data structure that can be used is
struct center
{
int/float x; #x-direction ref
int/float y; #y-direction
int/float z; #z - direction
}

- Anonymous October 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

In one of my comment, I have written that I asked interviewer that whether co-ordinates of points are given or not. He said NO. So we can't use this approach.

- Nitin Gupta October 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

arrange the cuboid by length, width, and height in a k-d tree

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

I believe we shld treat this as a normal graph and do a DFS (since it wld be faster than BFS in this case). Seems to me as a rip off the problem wherein we need path between 2 given nodes in a graph, also herein we may have more than 1 solution (obviously) and the next question that wld come up wld be to find the shortest path (Dijiktra shld be answer of that). Cube or cuboid used here wld just be distraction. Do comment your thoughts

- Anonymous October 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Oct tree could have been used in case these were cubes (but why complicate stuff, its overkill) and k-d tree cannot be, they have Nearest Neighbour algo (NN) but k-d trees have left child smaller and right side larger property which doesn't fit here.

- Anonymous October 12, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

int * a;
	char * str;

- asdasd December 01, 2013 | 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