Competitive Programming and Backend are two really different fields, but I feel that there's a great connection between them. Backend Development is mainly about storing User Data, and building endpoints and queries to efficiently retrieve them. Once you get the hang of it, it becomes fairly easy. Honestly, I don't even feel that there's anything challenging in it unless you have a really big project to build where there are tons of endpoints and jobs. Even that, to be honest, will just require better project structure and you're sorted.
The real challenge for me, though, is deciding the format of the databases. I had learnt a Software Design principle in one my classes, and till date, I think it's the best way to efficiently design any project. Here's the 6-step procedure:
The last point emphasizes that we should always keep checking all our steps and validate our steps. Although the design principle says that the repetition should be restricted only to the designing phase, I make sure I'm following the steps even while implementation.
The real challenge for me, though, is deciding the format of the databases. I had learnt a Software Design principle in one my classes, and till date, I think it's the best way to efficiently design any project. Here's the 6-step procedure:
- Specify the problem
- Specify Data Structures
- Define Format of Data Structures
- Specify Algorithm
- Look for modularity
- Repeat above steps
The last point emphasizes that we should always keep checking all our steps and validate our steps. Although the design principle says that the repetition should be restricted only to the designing phase, I make sure I'm following the steps even while implementation.
Looking for Modularity
Let's look at the second-last point again - Modularity. This point not be as important for some fling side projects as they are for bigger projects with a lot of code and data. The ease of Debugging is inversely related to the Chaos of Code. Once we figure out the different things that a project does, we can subdivide the features into modules. This gives us a rough idea of all the things that we need to do to complete the project. Now, the features can be assigned to people as tasks. The 6th step of repetition can be used, that is, let's say we divided our project into feature A and B. So the 5 steps can again be applied to simplify feature A, and likewise, for B. I love this step because the ease with which you are able to build any project totally depends on this very step of designing.Algorithm Specification
This is a fairly obvious point. Although there isn't any big 'algorithm' for every endpoints response, specifying what happens in every step is perhaps the core part of designing.
Data Structures Specification
This is the 2nd point in the 6-step procedure. Specifying the Data Bases. The next step, Specifying the Format of Data Bases is closely linked with this step too. Together, these steps decide your project's real scalability. In today's world, Data plays the most important role in everything. All AI, ML, etc applications that you want to build in your project will need a lot of Data, any website that you build will need you to store User's data, and your content. All this data needs to be stored in such a way that it is efficiently retrieved in the fastest possible time from the Data Base.
This step, honestly, is the toughest one for me. Sure, you can build a side project in any format you want, but how you store that data will impact the difference in response times when your project starts to scale. Imagine the amount of optimizations that engineers at Google, Facebook and Amazon must have done to deliver such quick response times! And this is the area, where most Backend Developers must strive to improve.
Backend Developers must know what kind of Data Base would maintain their project after scaling. Usage of Graphs, Trees, LinkedLists is something which I have never done in my projects. Certainly there must be ways & situations to implement these in real-life projects. The question is, how do we decide when to use which data structure?
There is a lot of theory that could give you some idea about applications of Data Structures, but if you're a good coder, I can say that you don't like memorizing. Referencing the conditions needed for usage of a DS is not as good as being able to visualize the project through that application.
So now the question is, how do we get to the state where we can decide for ourselves what kind of optimizations to use & when?
By practicing cases where it can be used and actually implementing it on code. That's where Competitive Programming comes in. CP is something that will definitely teach you how to optimize everything in your project. That is the best way to learn the applications of Data Structures and Algorithms I've found till date. Building an API or a Website is easy, but making it efficient is tougher. That is the challenge you should aim for.
Comments
Post a Comment