New Grad Software Engineer Interview Questions

2,866 new grad software engineer interview questions shared by candidates

A shop in HackerLand contains n items where the price of the ith item is priceli]. In one operation, the price of any one item can be increased or decreased by 1. Given q queries denoted by the array queryll, find the minimum number of operations required to make the price of all items equal to each queryli] (0 ≤ i < q).
avatar

Software Engineer New Grad

Interviewed at IBM

3.9
Sep 18, 2024

A shop in HackerLand contains n items where the price of the ith item is priceli]. In one operation, the price of any one item can be increased or decreased by 1. Given q queries denoted by the array queryll, find the minimum number of operations required to make the price of all items equal to each queryli] (0 ≤ i < q).

Viewing 2071 - 2080 interview questions

Glassdoor has 2,866 interview questions and reports from New grad software engineer interviews. Prepare for your interview. Get hired. Love your job.