Q4 What Aspects Would You Consider While Designing A Web Crawler
This is one of the most common systems design interview questions asked at the Amazon interview. While designing a web crawler, the following aspects need to be considered –
- Prioritize web pages that are dynamic as these pages appear more frequently in search engine rankings
- The crawler should not be unbounded on the same domain
- Build a system that constantly tracks new web pages
Prep For The System Design Interview
In addition to coding interviews, system design is a required component of the technical interview process at many tech companies.
Practice common system design interview questions and compare your results with sample solutions: discussions, code, and diagrams.
Additional topics for interview prep:
Suggested topics to review based on your interview timeline .
Q: For interviews, do I need to know everything here?
A: No, you don’t need to know everything here to prepare for the interview.
What you are asked in an interview depends on variables such as:
- How much experience you have
- What your technical background is
- What positions you are interviewing for
- Which companies you are interviewing with
More experienced candidates are generally expected to know more about system design. Architects or team leads might be expected to know more than individual contributors. Top tech companies are likely to have one or more design interview rounds.
Start broad and go deeper in a few areas. It helps to know a little about various key system design topics. Adjust the following guide based on your timeline, experience, what positions you are interviewing for, and which companies you are interviewing with.
What Is Program Documentation Used For
The interviewer might want to make sure you know the differences between each aspect of documentation when completing system design projects. You can use your answer to assure the interviewer of your in-depth knowledge of how to apply each documentation process.
Example:”I use program documentation to give accurate descriptions of the inputs and outputs of a system as well as the processing features of various program modules. I’ve found this helps guide programmers on my team during the construction phase of a design.”
You May Like: How To Schedule A Job Interview
How Do You Design A Shared Drive
Hiring managers ask this to explore algorithm basics and backgrounds. Before you begin, make sure you understand the purpose of the task. Knowing if the changes will be registered in real time, if locking will be necessary and if it needs to be naturally convergent will help you give a complete answer.
Example:”This system works on differential synchronization. It is keeping two or more copies of the same document synchronized with each other in real time, so if a change is made on one version, the same alteration happens on all the others. It is a complex challenge, but differential synchronization is scalable and fault tolerant. The three common approaches are ownership, event passing and three way merges. I last had to do this to support in-house document sharing for one of our clients. They wanted real-time collaboration, so three-way merging was not a good option since changes are lost and cannot take effect, as major collisions are common. I used event-passing to allow for real-time collaboration as the locking or ownership approach would only allow the first one opening the document to make any adjustment. This served our client well, as its employees were able to work collaboratively even when out of office or on different schedules.”
What Are Three Ways Of Measuring The Performance Of Systems
We must use the following three performance metrics to measure the system’s performance.
- Availability: To check the response time
- Latency: To check the speed of message delivery time
- Throughput: To study the transmitted data at a specific time
Integrating these metrics would help assess the whole system design, its workings, and user interaction.
Recommended Reading: How To Crack The Pm Interview
How Is The Google Interview Different From Other Companies
Google isnt shy about sharing their hiring practices. In fact they have a whole page dedicated to exactly that.
The interview process begins with at least one phone screen and, if successful, a series of onsite interviews. The Google phone screen and onsite portions are fairly typical across the board of technical interviewing, but the process at Google is unique in a couple specific details:
You May Like: What Should I Wear To A Job Interview
What Kind Of Files Can Be Stored Within An Organizational System
You might be asked this question to gauge your concept of keeping your design elements organized within an online system. You can highlight your organizational and technical skills by addressing the question and providing evidence of how you used this concept in your past roles.
Example:”The main file types I integrate within an organizational system include master, table, transaction, mirror, temp, log and archive files. Each file type will have specific properties that categorize it according to system and user information, chronological lists and backup data.”
Recommended Reading: Email Rejecting Candidate After Interview
System Design Problem Solving Approach
To have a structured way to approach system design problems, you can follow these steps. Try to follow them when solving practice system design problems.
Ask clarifying questions. Specify all requirements to understand what exactly your design should do.
Often, system design problems are very vague, like “Design Twitter”. It is your responsibility to scope what exactly Twitter functionality is, how many users we will need to support, and so on.
Scope business requirements.
It is a good idea to think about what your design should achieve from the business perspective. What would we or potential stakeholders mostly care about? Should we be able to handle millions of users? Should your service have 99.99% uptime? Should each request be processed in 300ms? Should the data be safely replicated and never lost?
System design is about engineering, but behind most systems, there are real-world and business requirements. Show that you understand this and care about it.
Do estimations. Estimate the number of users you will need to support, disk space and network bandwidth you will need, and so on.
Before designing a performant system, it is good to have an idea of how performant it really should be. Designing Twitter for 10 and 1000000 people are two very different tasks. Use the requirements from the previous two steps for your estimations.
Think about the extra details of your system.
How would you test it? What about security? What are alternative designs?
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers--------------------------L1 cache reference 0.5 nsBranch mispredict 5 nsL2 cache reference 7 ns 14x L1 cacheMutex lock/unlock 25 nsMain memory reference 100 ns 20x L2 cache, 200x L1 cacheCompress 1K bytes with Zippy 10,000 ns 10 usSend 1 KB bytes over 1 Gbps network 10,000 ns 10 usRead 4 KB randomly from SSD* 150,000 ns 150 us ~1GB/sec SSDRead 1 MB sequentially from memory 250,000 ns 250 usRound trip within same datacenter 500,000 ns 500 usRead 1 MB sequentially from SSD* 1,000,000 ns 1,000 us 1 ms ~1GB/sec SSD, 4X memoryHDD seek 10,000,000 ns 10,000 us 10 ms 20x datacenter roundtripRead 1 MB sequentially from 1 Gbps 10,000,000 ns 10,000 us 10 ms 40x memory, 10X SSDRead 1 MB sequentially from HDD 30,000,000 ns 30,000 us 30 ms 120x memory, 30X SSDSend packet CA-> Netherlands-> CA 150,000,000 ns 150,000 us 150 msNotes-----1 ns = 10^-9 seconds1 us = 10^-6 seconds = 1,000 ns1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns
Handy metrics based on numbers above:
Latency numbers visualized
Recommended Reading: How To Do Good On Job Interview
Things To Do During The Interview
To ace the Amazon system design interview, you must keep four key things in mind:
- What kind of books? Is it going to be e-books or just regular books?
- How many users are we looking at?
- What will be the transactions per second?
You must ask questions related to scaling, performance, API, etc.
How Do You Answer System Design Interview Questions
- Ask questions to the interviewer for clarification: Since the questions are purposefully vague, it is advised to ask relevant questions to the interviewer to ensure that both you and the interviewer are on the same page. Asking questions also shows that you care about the customer requirements.
- Gather the requirements: List all the features that are required, what are the common problems and system performance parameters that are expected by the system to handle. This step helps the interviewer to see how well you plan, expect problems and come up with solutions to each of them. Every choice matters while designing a system. For every choice, at least one pros and cons of the system needs to be listed.
- Come up with a design: Come up with a high-level design and low-level design solutions for each of the requirements decided. Discuss the pros and cons of the design. Also, discuss how they are beneficial to the business.
The primary objective of system design interviews is to evaluate how well a developer can plan, prioritize, evaluate various options to choose the best possible solution for a given problem.
You May Like: The Container Store Interview Questions
Section 1: Messaging & Pub
When you design and build large-scale and distributed systems, for that system to work cohesively and smoothly, it is important to exchange information between the components and services that make up the system. But as we have seen before, systems that rely on networks suffer from the same weakness as networks – they are fragile. Networks fail and its not an infrequent occurrence. When networks fail, components in the system are not able to communicate and may degrade the system or cause the system to fail altogether . So distributed systems need robust mechanisms to ensure that the communication continues or recovers where it left off, even if there is an “arbitrary partition” between components in the system.
Publisher / Subscriber Messaging
This is a very popular paradigm for messaging. The key concept is that publishers ‘publish’ a message and a subscriber subscribes to messages. To give greater granularity, messages can belong to a certain “topic” which is like a category. These topics are like dedicated “channels” or pipes, where each pipe exclusives handles messages belonging to a specific topic. Subscribers choose which topic they want to subscribe to and get notified of messages in that topic. The advantage of this system is that the publisher and the subscriber can be completely de-coupled – i.e. they don’t need to know about each other. The publisher announces, and the subscriber listens for announcements for topics that it is on the lookout for.
How To Prepare For The System Design Interview In 2022
For many software engineers, the System Design Interview remains a mysterious challenge.
Most engineers have never actually worked on large-scale systems before, so having to explain how to build one seems daunting. And because system design interview questions can be so open-ended, it is hard to know the right way to prepare.
Before I spent eight years working on distributed systems at Microsoft and Facebook, I definitely felt this way. But now, as someone who has participated in hundreds of system design interviews, I can assure you that there is a way through.
In this post, I will discuss:
What interviewers are looking for in a System Design Interview
How any developer can prepare to confidently answer System Design questions
Also Check: Data Analyst Coding Interview Questions
Briefly Explain What Microservices Mean
These constitute an architectural style, which uses loosely coupled services to structure an application.
It separates a big application into a bunch of independent, modular services. These modules can be created, used, and maintained separately. Traditional monolithic apps cant keep up with the pace and reliability of microservices. Each independent service in the program has its own codebase and logic since the application is divided into separate services. Application Programming Interfaces allow these services to communicate with one another. If a system designer wants to create a more scalable application, microservices are perfect for that. Because of its cutting-edge features and modules, microservices make it considerably simpler to scale applications.
Things To Do Before The Interview
Read Also: How To Record An Interview On Zoom
Briefly Describe Three Types Of Distributed System Failures
System failures are often a result of software or hardware issues. The primary memorys contents are typically lost after system failures, whereas the secondary memory is always safe. When a system malfunctions, the CPU is unable to carry out the execution, which may cause the system to reboot or freeze.
- Communication Medium Failure
This kind of failure happens mainly due to failures in the communication links or node shifting.
- Secondary Storage Failure
When the data on a secondary storage device cannot be accessed, the situation is referred to as a secondary storage failure. It may be caused by a variety of factors, such as parity issues, medium contamination, or node crashes.
Use The Star Response Technique
Formatting your responses using the STAR interview response technique is a strategy to help you craft answers that illustrate your knowledge and qualifications through specific experiences. STAR is an acronym for Situation, Task, Action and Result. Using the STAR method, discuss an applicable situation, identify the task you needed to complete, outline the actions you took and reveal the results of your efforts to demonstrate your skills to the interviewer.
Don’t Miss: How To Prepare For An Internship Interview
System Design Interview Questions Pattern
System design interview consists of open-ended processes facilitating a creative discussion between the candidate and the interviewer. Consequently, there are no ready answers to be followed during System Design Interview. However, a typical system design question ends in designing a system based on the problem. Therefore, we have created a standard answer framework to crack each question in a systematic way.
My Preparation Strategy For System Design Interviews With Silicon Valley Companies
In software engineering, system design defines the components, modules, interfaces, and data for a system to meet specified requirements. Most companies do not ask system design to freshers. However, when I was interviewing for a Full-Time Software Engineer role, a few companies had system design interview rounds.
In this blog post, I will talk about the various type of system design interviews and how I prepared for them.
Read Also: How Do You Answer Interview Questions
Explain Your Approach For Designing A Shared Drive
This question is asked for analyzing algorithm basics and backgrounds. Before you start answering, try to figure out what the recruiters are actually asking. You can go for features like the changes are registered in real-time, locking will be necessary and it can be made naturally synced.
Example: The system follows a unique synchronization strategy. It maintains two or more copies of the same document synchronized with each other in real-time, so if a change is made on one version, the same is reflected in the others.
It is a difficult task, but differential synchronization is optimal and fault-tolerant. The three approaches included are ownership, event passing, and three-way merges. For real-time collaboration, instead of a three-way merge, I used event-passing as the locking or ownership approach allows the first one opening the document to make alterations. This approach came out successful.
What Are The Inputs And Outputs Of System Design
The interviewer likely wants to evaluate your knowledge of how to design basic input and output elements within a system. You can use your answer to highlight your working knowledge as well as your skills for designing these elements.
Example:”In my last position, I designed a service-based system that required specific inputs like proposed requirements, modified DFDs, situation analysis and my conceptual data model. The outputs on that project ended up as a data schema concerning the conceptualized model and a hierarchy diagram representing the web page map used to outline the system structure.”
You May Like: Cyber Security Questions For Interview