Algorithms, Blockchain and Cloud

Microsoft Interview Question – Compute the Area of the Triangle


The following seems an easy question, to get the area of the rectangluar triangle with the slope equals to 10 and the height equals to 6.

triangle Microsoft Interview Question - Compute the Area of the Triangle

rectangluar triangle

If your answer is 30 (10×6/2), then you are falling into the trap: Such triangle doesn’t exist at all!

It does not exist!

If we label the triangle with the following,

Triangle with Labels

What we can get are:


If we add these two equations:

After simplification, we have:




Thus,

because .

If, , , we can plot the graph,

plot-for-triangle-max

The maximum value for function y is 25, which means that the maximum value of c is

Such triangle does not exist (the height is 6, which exceeds the maximum length)!

Typical Microsoft. If something is wrong then it is by design and you are stuck with it.

Software Engineer Interview Experience

Interview Tips

Interview Questions

–EOF (The Ultimate Computing & Technology Blog) —

766 words
Last Post: How to Lock out (WorkStation) on Windows?
Next Post: How to Cache WeChat Token via PHP?

The Permanent URL is: Microsoft Interview Question – Compute the Area of the Triangle (AMP Version)

Exit mobile version