Microsoft Interview Question
Software Engineer in Testsone way to implement sine and cosine is to use taylor series.
Second way is to make a look up table for sine / cosine values from 0 to 2pi, with an interval of say 5 degrees. In this approach we will have to find the closest angle in the lookup table to find its value.
Advantages of method 2 are : -
1. we will be calculating the values only once.
2. For any angle,time to fetch the value is fast and same.O(1)
MS IDC makes fool of people.
People have to come to office on weekends due to workload and do night outs, no work life balance. They pay 10-20% more make people labour.
Do take the feedback from employees before joining MS.
And work is junk, all junk wor from Redmond is transferred to IDC. Ask any team, whether they design, implement products or just do porting or maintenance or make tools.
Error, if inputAngle <=0 || inputAngle >= Pi/2;
- Anonymous May 30, 2010triangle rightAngled at B.
Say given side is sideA
if angleA given, angleC=pi/2-angleA;
(if angleC given, angleA=pi/2-angleC;)
sideB=sideA/cos(angleC);
sideC=sideB*sin(angleC);