Software Engineer Software Developer Interview Questions

466,457 software engineer software developer interview questions shared by candidates

Given two sorted input arrays which contain a two element array of [key, value], write a function which multiplies the two arrays together and sums them where the "key" matches. Example: "v1 = [[1, 3], [2, 4], [99, 3]]; v2 = [[2,3],[5,9],[99,1]]" results in "15". I first brute forced it with O(n*m) then used two pointers which resulted in O(n+m) then he asked me to write it in O(n log m). I could not think of an algorithm at the time for O(n log m).
avatar

Software Engineer

Interviewed at Meta

3.6
Dec 10, 2015

Given two sorted input arrays which contain a two element array of [key, value], write a function which multiplies the two arrays together and sums them where the "key" matches. Example: "v1 = [[1, 3], [2, 4], [99, 3]]; v2 = [[2,3],[5,9],[99,1]]" results in "15". I first brute forced it with O(n*m) then used two pointers which resulted in O(n+m) then he asked me to write it in O(n log m). I could not think of an algorithm at the time for O(n log m).

Viewing 211 - 220 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 466,457 interview questions and reports from Software engineer software developer interviews. Prepare for your interview. Get hired. Love your job.