Program Specialist Interview Questions

1,809 program specialist interview questions shared by candidates

There is an array of n size.... elements appear exactly twice...and elements are 1 to N//2 - 1.. For ex N = 8 ..arr = 3 2 4 2 1 3 1 4 And another array bonus of size N ... If an soldier can attack...if he gets a partner to the right....and the max bonus is within the range l to r ....get max bonus ...and if no partner found ....no bonus to be collected.... Rules for partner... The right element...new partner to be found should be a multiple of the current l partner... Once a partner is found..max bonus can be taken from the range...in above example ..index 0 ....element is 3....his next partner will be either 3 only or 6(here not the case...).. So l= 3 r = 3...li (index0) ri (index5)...so index 0soldier found an partner..so he can attack ...so he will choose the max value from bonus list 0...5 index ...if bonus list was say suppose 30 10 40 20 10 40 20 70...he'll pick 40...as it lies in the scope of attack (index 0-5)... 40 is added to total bonus ..... Like wise ..every index is checked for partner ..and mac bonus in tht range selected and added .... Final Max Bonus to be returned....
avatar

Specialist Programmer

Interviewed at Infosys

3.6
Aug 20, 2024

There is an array of n size.... elements appear exactly twice...and elements are 1 to N//2 - 1.. For ex N = 8 ..arr = 3 2 4 2 1 3 1 4 And another array bonus of size N ... If an soldier can attack...if he gets a partner to the right....and the max bonus is within the range l to r ....get max bonus ...and if no partner found ....no bonus to be collected.... Rules for partner... The right element...new partner to be found should be a multiple of the current l partner... Once a partner is found..max bonus can be taken from the range...in above example ..index 0 ....element is 3....his next partner will be either 3 only or 6(here not the case...).. So l= 3 r = 3...li (index0) ri (index5)...so index 0soldier found an partner..so he can attack ...so he will choose the max value from bonus list 0...5 index ...if bonus list was say suppose 30 10 40 20 10 40 20 70...he'll pick 40...as it lies in the scope of attack (index 0-5)... 40 is added to total bonus ..... Like wise ..every index is checked for partner ..and mac bonus in tht range selected and added .... Final Max Bonus to be returned....

Viewing 201 - 210 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 1,809 interview questions and reports from Program specialist interviews. Prepare for your interview. Get hired. Love your job.