## Facebook Interview Question for Software Engineer / Developers

Country: -

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

Is it a human mouth? an open mouth or a closed mouth? Is a mouth guaranteed to be present or not? If so how many mouths can exist in a single picture? Is the picture always in a particular orientation. These are some questions that could be asked as clarification.

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

good questions.

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

Is the rest of the face also on the picture (eyes, nose)?

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

An automatic face morphing algorithm is proposed. The algorithm automatically extracts feature points on the face, and based on these feature points images are partitioned and face morphing is performed. The algorithm has been used to generate morphing between images of faces of different people as well as between different images of the face of an individual. The results of both inter- and intra-personal morphing are subjectively satisfactory.

ref-->/
ccrma.stanford.edu/~jacobliu/368Report/index.html

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

This can be solved using graphs.
1) each pixel in the image would represent a vertex in a graph with an edge between 2 neighboring pixels. The weight of the edge should be proportional to the darkness of the pixel.
2) identify different connected components (eye, node, mouth) in the image using spanning tree algorithm.
3) the last of the puzzle is to identify which of the connected component is the mouth. each connected component (eye, nose, mouth, etc) would be represented as a vertex in a graph and the edge weight is proportional to their distance from each other. using shortest path, you can identify 2 pair of eyes and the component that is farthest from the eyes is the mouth.

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

1) "The weight of the edge should be proportional to the darkness of the pixel." you said the VERTEX represents the pixel. So which pixels' darkness did you mean when mentioning edge weight?
2) "an edge between 2 neighboring pixels" based on this you will have no separate islands in the graph; but one single component. So why the spanning tree algorithm?

Your solution doesn't make any sense to me.

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

@future googler: it is not mentioned that the picture will have a full face. It can be only lips in the picture. I think different approach is needed. One basic property of lips is two points having three different lines touching them. I think if we consider a graph with nodes as pixels. Then each pair would have three lines where lines starting from one point would end in the other. Probably lines have different properties which can be figured out. I this can be one point to be considered. Also, the pair of points could be eyes too. These are just my thoughts.
Note that I don't have a solution/algorithm/design right now.

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

Viola Jones ....

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.

### 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.