Myntra Interview Question for SDE-2s
- 0of 0 votes
A mechanical engineer is writing a design specification for two gears to transmit motion between two parts, A and B, in a machine she is designing.- nik.cse2005 March 13, 2015 in United States
the distance between A and B is equal to D.
There are n types of gears, Agear type of i has a radius Rj and cost Cj.
The two gears specified, i and j , must have Ri+Rj >= D, inorder for there to be a way of placing them so that they touch and work togeather. The objective is
to find the pair which costs the least.
You need to produce a design table that gives the most suitable match for every gear type in the list. For every gear type 'i', you need to consider its description (Ri,Ci)
and list the gear type 'j' to pair with 'i' in table position T[i]. The best map might be the same type(Ti=i). if there are multiple solutions with the same cost,
choose the gear with the largest radius.If both the cost and radius you need are found in more than one gear type, choose the type with the smallest index j.
If no radius can be found that allow the distance D to be covered, table should contain 0.
R1 R2 ... Rn
C1 C2 ... Cn
T1 T2 ... Tn
| Report Duplicate | Flag | PURGE
Myntra SDE-2 Arrays
Open Chat in New Window