Intern Software Engineer Interview Questions

9,357 intern software engineer interview questions shared by candidates

Write a class that takes in a window size (n) in its constructor. The only method in the class takes in an integer, adds it into a sequence of numbers with that value, and returns the average of the last n values inserted into the sequence. Do not iterate over the sequence to calculate the average. Couldn't use STL. For example, if window size (n) is 2: update(1) returns 1 update(2) returns 1.5 update(3) returns 2.5 update(4) returns 3.5
avatar

Software Development Engineer Intern

Interviewed at Amazon

3.5
Feb 28, 2013

Write a class that takes in a window size (n) in its constructor. The only method in the class takes in an integer, adds it into a sequence of numbers with that value, and returns the average of the last n values inserted into the sequence. Do not iterate over the sequence to calculate the average. Couldn't use STL. For example, if window size (n) is 2: update(1) returns 1 update(2) returns 1.5 update(3) returns 2.5 update(4) returns 3.5

Viewing 2371 - 2380 interview questions

Glassdoor has 9,357 interview questions and reports from Intern software engineer interviews. Prepare for your interview. Get hired. Love your job.