Flipkart Interview Question for Software Engineer / Developers






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

How about dividing the base in 7 equal parts?

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

sounds correct. if all bases are equal, and height anyway is the same, then all areas are definitely equal.

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

cool answer

- Rahman November 29, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

best.. :)

- Anonymous January 24, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

The areas are equal, but they are not triangles...

- sharon February 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

perfect dude :)

- vikas August 24, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@sharon, join the base points to the vertex.
Dont form trapezoids :)

- kv391 April 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

And btw, its asking for equal (congruent) triangles and not the ones with just equal areas.
Found this,
"Using the property of the col-linearity of ortho-center, centroid, circum-center. We can get 7 non-overlapping triangles. For that matter if we include nine point center also we can get another two more non-overlapping triangles."

Its a core olympiad problem, should not have been asked in a tech interview !

- kv391 April 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Equal if atleast 2 side of triangle are equal !!

- Abhish1 June 28, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

using the property of the collinearity of orthocenter,centroid,circumcenter.we can get 7 nonoverlapping traingles.for that matter if we include ninepoint center also we can get another two more nonoverlapping triangles.

- just October 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Could you explain please?

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

suppose ABC is the triangle,with BC as base.its centriod G,circumcenter S,
orthocenter O
now 7 triangles are BSC,BSG,CSG,BGO,CGO,BOA,COA

- just October 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

What will be in case of right triangle?

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

why will they all be the same Area, any mathematical proof

- krishna March 09, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

This is not correct, for an equilateral triangle all 3 points are the same. For a right angle triangle vertex is itself the ortho-center.

- Naveen July 27, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think by equal it is not area but identification itself.
If we shuffle the 7 triangles we should not be able to identify which triangle is got from which part of the main triangle.
In mathematical terms two triangles are equals if they obey SAS or ASA rule.

- Naveen July 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

If it is equal by area below is the solution.

1. Calculate the area of whole triangle (say A)
2. One seventh of A will be area of smaller triangles (say a)
3. We need to find 3 points D, E and F inside the triangle so that ABD, BDE, BEC, CEF, CFA, AFD and DEF are the triangles equal by area.
4. Point D will exist on the line parallel to line AB at a height hd which we can calculate as below
Area of triangle ABD = AB * hd / 2 = a
hd = 2 * a / AB
5. Similarly E will exist on line parallel to line BC at a height he = 2 * a / BC
6. Similarly F will exist on line parallel to line CA at a height hf = 2 * a / CA
7. Now we got 3 lines on which D, E and F lie one on each line.
8. Say these 3 lines intersect at points A', B' and C'
9. Now we can say that D, E and F lie on line segments A'B', B'C' and C'A'
10. Now using binary search we can find the point D thereby finding points E and F.
11. Take the midpoint of line segment A'B' as D.
12. Now do a binary search on line segment B'C' such that area of triangle DBE = a
13. Similarly do a binary search on line segment C'A' such that area of triangle CEF = a
14. Now if area of triangles ADF = DEF = a then this is our solution
15. If area of triangle ADF > a > DEF then actual D should be some where in the line segment DA', so now take D as the mid point of DA' and countinue from step 12.
16. If area of triangle ADF < a < DEF then actual D should be some where in the line segment DB', so now take D as the mid point of DB' and countinue from step 12.

- Naveen July 27, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

To find points E and F we can come up with a formula rather than doing a binary search.
Complexity of the solution depends on the precision of the answer (p) and the length of the sides of the triangle (l). We need log(l*(10^p)) iterations to find the solution. If the distance is around 10 and we need precision to 2 decimals then we need to binary search 1000 points which will take log(10*(10^2)) = log(1000) iterations.

- Naveen July 27, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Equal triangle does not just mean equal in area.
equality implies congruency: i am not sure how to divide a triangle into 7 congruent triangles. maybe some clarification needed is it being asked to divide into just 7 equal areas

- Amit Priyadarshi March 26, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

dividing the base is perfect

- Anonymous November 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Dividing the Base is perfect

- Vinod April 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

What if base is not divisible by 7 ???

- Shivam May 11, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

What if the area is not divisible by 7 ?

- Russell February 05, 2012 | Flag


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