4 ms·
Wouldn't the question about the moving average be a good one though? It should be quite obvious that you can calculate a moving average without remembering more
by quarktasche 11y ago
Wouldn't the question about the moving average be a good one though? It should be quite obvious that you can calculate a moving average without remembering more than the current average and the window size. Given that, time and space complexity should be obvious. I think it would be a fine question to see if the interviewee has any idea what complexity means.
Or was it a more complicated moving average case (exponential etc) where the algorithm was given and you were asked to determine the complexity?
- collyw 11y agoHow many jobs will it be relevant to?
- quarktasche 11y agoWhich part? Figuring out how to efficiently calculate a moving average seems like a good question for basic maths skills to me. About complexity theory, there is already a lot of discussion about it's relevancy in the comments. My point was meant more along the line that, if you value a basic understanding of complexity theory, the question asked of the GP seems reasonable.