Data Structures and Algorithms are the identity of a good Software Developer. The interviews for technical roles in some of the tech giants like Google, Facebook, Amazon, Microsoft is more focused on measuring the knowledge of Data Structures and Algorithms of the candidates. The main reason behind this is Data Structures and Algorithms improves the problem-solving ability of a candidate to a great extent
“Choosing the best possible data structure or algorithm to solve a problem affects the time and space complexity of the solution, which the interviewer is looking for”
These skills not only help a student in getting a highly-paid job but helps him to sustain in this ever-growing software industry.
If you are going for an interview with some of the Tech Giants like Amazon, Google, Flipkart etc. or some other high paying companies for the role of a Software Developer or Backend Developer then you must be good at problem-solving. The interviews in these companies are more focused on analysing your problem-solving abilities
Ecommerce organization(Flipkart,Amazon,WalmartLabs), finance organization(Morgan Stanley, goldman sache) Technology Giants(Google,Facebook,Microsoft) are only looking for algorithmic skills during interview. They dont care for programming language or technology a candidates previously worked on because they know that if candidates have problem solving skills then he/she can understand any technology/programming languages
When interviewer asked system design problems, there main intention is to check the candidates distributed system understanding
All the above components is discussed in details in logicmojo system design lectures
Microservice architecture components
Now a days most of the developers have queries regarding system design interview prepration, here are few more tipsand steps while solving problems
Architecture evolution with time
Load balancer administrators create forwarding rules for four main types of traffic
There can be many algorithms for a particular problem. So, how will you classify an algorithm to be good and others to be bad? Let's understand the properties of a good algorithm:
1. The algorithm should efficiently use the resources available to the system
2. The computational time (the time taken to generate an output corresponding to a particular input) should be as less as possible
3. The memory used by the algorithm should also be as less as possible. Generally, there is a trade-off between computational time and memory. So, we need to find if the time is more important than space or vice-versa and then write the algorithm accordingly.
So, we have seen the three factors that can be used to evaluate an algorithm. Out of these three factors, the most important one is the efficiency of algorithms. So let's dive deeper into the efficiency of the algorithm
The efficiency of an algorithm is mainly defined by two factors i.e. space and time. A good algorithm is one that is taking less time and less space, but this is not possible all the time. There is a trade-off between time and space. If you want to reduce the time, then space might increase. Similarly, if you want to reduce the space, then the time may increase. So, you have to compromise with either space or time. Let's learn more about space and time complexity of algorithms
Even when you are creating a variable then you need some space for your algorithm to run. All the space required for the algorithm is collectively called the Space Complexity of the algorithm.
Note:In normal programming, you will be allowed to use 256MB of space for a particular problem. So, you can't create an array of size more 10^8 because you will be allowed to use only 256MB. Also, you can't create an array of size more than 10^6 in a function because the maximum space allotted to a function is 4MB. So, to use an array of more size, you can create a global array
The time taken by an algorithm also depends on the computing speed of the system that you are using, but we ignore those external factors and we are only concerned on the number of times a particular statement is being executed with respect to the input size. Let's say, for executing one statement, the time taken is 1sec, then what is the time taken for executing n statements, It will take n seconds