From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one.
2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会.
She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going.
Hard work beats talent when talent fails to work hard.
Sunday, May 2, 2021
System design: Leetcode.com | Google system design questions | My 30 minutes study
May 2, 2021
I got this article from Leetcode. The link is here.
In this post, I am summarizing another five of the frequent system design interview questions. Thanks to the LeetCode community for helping me prepare for the interviews. I hope this post will benefit everyone in their interview prep. 🙂
Design Proximity Server
Proximity servers are used to discover nearby attractions such as places and events, which are then recommended to Facebook users.
Users can add, update, and delete places.
Given a location expressed as latitude and longitude, users can query all the nearby places within a given distance.
Optional Follow-up: Query events near a given place around a particular time. This adds the third dimension of time to the problem.
Design Typeahead Suggestions
Google predicts and suggests a list of autocomplete queries based on the characters that we have already typed in the search box.
Suggest the top ten search queries based on the characters already typed by the user in the search box.
Assume query's popularity can be determined by the frequency of the query being searched in the past.
Design Privacy Settings at Facebook
We can set different privacy levels for the Facebook posts we publish to be only visible to a specific set of users like public, friends, friends of friends, etc.
Enable a user to specify the different levels of privacy for a post so that it is only visible to a particular set of users.
Implement two levels of privacy, Public and Friends.
Optional Complex Levels: friends of friends, custom groups
Design Top N Songs
This question is very similar to designing the system for Top N Trending topics.
Get the top N songs for a user over the past X days.
Assume popularity of a song can be determined by the frequency of the song being listened to in the past.
Design Web Crawler
Web Crawler scans the world wide web to download and index all the web pages to be made available for the search queries submitted by the users.
Given a list of seed web pages, it should download all the web pages and index them for future retrieval.
The service should handle duplicate web pages so that unique URLs are stored.
Learn more about the design goals, scale estimations, high-level design overview, and detailed architecture diagram of these problems in this video - https://youtu.be/Hq8pZ8G2Lm8
No comments:
Post a Comment