Job interviews2:24
Job interviews · Software developer · Advanced
Making a Slow Page Fasterتسريع صفحة بطيئة
- Ms. Brandt
- Hugo
0:00 / 2:24
Transcript
- Ms. BrandtHere is a small problem. Our product page takes six seconds to load. How would you approach it?
- HugoBefore I guess, I would measure. I would find out whether the time is spent on the server, on the network, or in the browser.
- Ms. BrandtSay the measurement shows that the server is slow. What next?
- HugoThen I would look at the database queries. One common problem is that the page asks for the same data many times. If so, I would save the result for a short time, so the next visitor gets it faster.
- Ms. BrandtIs there a risk in saving the result?
- HugoYes. The saved data can become old. If a price changes, some visitors may see the old price. So I would choose how long to keep it, and I would remove it when the price is updated.
- Ms. BrandtHow would you know that the change really helped?
- HugoI would measure again with the same method. Then I would compare. I would also watch the page for a few days, because a test on my computer does not always match what real users see.
- Ms. BrandtWhat if the slow part is in the browser?
- HugoI would check the size of the images and the amount of code we send. Often the simplest fix is to make the images smaller and to load the ones below the screen later.
- Ms. BrandtNow imagine that the product manager wants a new feature, but the page is still slow. What would you say?
- HugoI would not simply say no. I would show the numbers and explain what a slow page costs us: some visitors leave before it loads. Then I would suggest an order of work, for example a small speed fix this week and the feature after that.
- Ms. BrandtAnd if the manager still wants the feature first?
- HugoThen it is the manager's decision, because the manager knows the business better than I do. I would only ask to add a simple speed check to the new feature, so it does not make things worse.
- Ms. BrandtHow would you explain the problem to someone who is not technical?
- HugoI would use an everyday example. A shop with one cashier gets a long line when many customers arrive. Saving the data is like adding a second cashier for the most common questions. People understand that quickly.
- Ms. BrandtGood. You explained your thinking, not only your answer. Thank you.