Amazon Interview Question
Software Engineer / DevelopersAdding a few things to what krish said:
1). With databases see if there is high swapping activity. Ideally there should be now swapping activity. Check the state of indexes, temporary table space activity etc .
2). A system typically executes 20% of the code 80% of the time ( some say the ratio is 10/90) Then you need to profile the execution of your process and optimize the most used sections of the code.
3) Check logs including information messages to get hints for a possible delays in certain parts of programs.
If you don't understand these don't say it or the interviewer will know you have superficial knowledge.
I was asked a similar question recently in another interview. I had not worked on performance improvements before, So I talked about memory usage/shortage, database connections etc. The interviewers did not even bother to comment or lead me to anything better. I would appreciate some pointers.
Yes, it is possible that the 'infrastructure' makes the performance suffer. But there are usually ways to optimize in this case.
Yes, it makes sense to 'count the running time of an algorithm and compare it to what you'd expect'. Then it is possible that something not expected in the design happens.
Usually, we will also try to see where is the bottleneck of the system when the performance is not good. But it is really not an easy task to isolate the bottleneck.
If they say design is good, half of the battle is done. Now the problem might be with
- Krish April 14, 20071. The algorithm(S)implemented
2. The DB queries (May not have been tuned)
3. Huge DB. When the testing is done initially with little data, the performance problem might not have been found--
4. The HW/Network
5. General DB problems
6. And finally as a QA person never believe what the dev says.
So the design may be faulty :-)