Software Development Intern Interview Questions

2,990 software development intern 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 771 - 780 interview questions

Glassdoor has 2,990 interview questions and reports from Software development intern interviews. Prepare for your interview. Get hired. Love your job.