What is Low Level Design ( LLD) System ?
Low Level Design is a detailed description of every module of software . It describes every module in detail every detail by incorporating the logic behind every component in the system . It delves deep into every specification of every system providing a m9cro level design .
The high level design fixes the what and low level design is all about how.
There are various problems that we might face while trying to design reusable , extensible and maintainable software. These problems are generally related to object creation , defining class structure , assignment of responsibilities between objects , enabling objects interaction without tightly coupling.
LOW LEVEL DESIGN is also known as Object Oriented Design (OOD) or Object Oriented Analysis and Design (OOAD). Low Level Design is a component level design process that follows a step by step refinement process. This process can be used for designing data structure , required software architecture , source code and ultimately performance algorithm . The data organization may confused may be defined during requirement analysis and then refined during required during data design work . Post build each component is specified in detail.
The LLD phase is the stage where the actual software component are designed . During the detailed phase the logical and functional design is done and design of application structure is developed during the high level design phase.
Low Level Design plays the most crucial role because these candidates are inexperienced hence not supposed to knowledge of High Level Design . Candidates having experience of more than 3 years usually face the system design interview with a mix of both HLD and LLD . This course low Level System Design focuses on the low level aspect of design .
Why Low Level Design is important?
As a software developer in any company the objective is to build software for business of the company . Building software is complex task . Change is the only constant thing in the world . As the software progresses over the years , it needs to incorporate a lot of changes the requirement keeps on changing . We can choose to build software in many ways but we need to build it in such a way that software is maintainable and extensible over the years easily . Most of the software developer interviews have data structure and algorithm . but it is not often for software developers to use these data structure in real world while building software . low level design is must for building a piece of software. As low level design focuses on how to build software from a set of requirement, how different component interact with each other ,what responsibility each component has ,it is a vital exercise to be done before actually writing a code. Writing code is a easiest part of building software if we have the design already in a place. Maintaining and extending software will be easy if design are well .As we know maintenance takes almost 70% of effort in the software development lifecycle. So the software easily maintainable and extensible .LLD plays an important in the design of software and hence directly contributes to the maintainability and extensibility of software.
How to prepare for low level design interviews
Software developers needs to learn low level design not only to crack the interviews but also to build modulers , extensible , reusable software . It is the thought process that developers needs to develop to build the software from a set of requirement .
Here is the list of things that software developers needs to learn for LLD interviews
Object oriented language The general expectation in the machine coding round or LLD round is that candidate writes object oriented code . Object oriented language revolve around everything about objects. The candidate should identify the different modes that needs to be created from the problem statement and models the classes as per the required entities along with choosing the right set of data structure depending on the cases. Learning any object oriented language is a must as candidates needs to write code using popular language such as Java , C++, Python.
Object Oriented Principles Knowing an object oriented language itself is not sufficient for writing extensible and maintainable codes . Many object oriented principles are designed to makes the software maintainable . Some of the well known principles are :
YAGNI : :You Ain't Gonna Need It is a practice in software development that states that features should only be added when required and thus help trim away excess and inefficiency development to facilitate the desired increased frequency.
DRY: :Don't Repeat Yourself is a principles that states that don't repeat the code again and again. If there is a code that is duplicate then whenever a change needs to be made the change has to be done in both places. So the developers has to remembers all the places. So the developers has to remember all the place where the code is duplicated which are difficult and error prone.
- SOLID :These are a set of 5 principles . Single Responsibility , Open Closed , Liskov Substitutions Interface Segregation and Dependency Inversion.
Apart from these there are well known principles such as favouring composition over inheritance , Encapsulating what varies , Striving for loosely coupled classes.
UML is an acronym that stands for unified modeling language and is a standard for modelling , visualizing and documenting the artefacts of software system. It is not a programming language but a tool to visually depict different types of diagrams that can be useful for building the software. There are 14 different types of UML diagrams and these diagrams are classified into 2 high level groups .
Structural diagram They represent the static view of the system . Class Diagram , Components Diagrams , Deployment Diagram , Profile Diagram and Package Diagram and part of Structural Diagrams.
Behavioral Diagram They represents the dynamic view of the system . Activity Diagram , State Diagram , Interaction Overview diagram , timing diagram , communication diagram are part of behavioral diagram.
How to solve low level design problem in interviews ?
Solving an LLD problem in an interview can be done easily if we divide the solutions into multiple stages and focuses on solving these stages one by one . LLD problems can be easily categorized into 2 types: Standalone applications and web applications.
Solving an LLD problem can be divided into 3 stages:
Clarify & Gather Requirement : The low level design interview questions are intentionally open ended unstructured similar to real life conditions . Ask the relevant questions regarding the problem and gather the complete requirement of the system. Don't assume anything beforehand and always clarify with the interview the assumption you want to take.
Class Diagram & use Case diagram & Schema Diagram :Once the requirement are gathered defines the core classes and objects , how the different classes interact with each other, and actors who interact with the system, the use cases for each actor . Draw class diagram and use case diagram for the system. Defines the relation between classes by observing the interaction between them . Interviewer may not ask to write the code to store data in actual database but they may be intrested in how the model looks like and relationship between them . It is easy to create the Schema diagram from the class diagram.
Code Finally once the thought are structured using class diagram , use case diagram and schema diagram , the candidate can start writing code. Apply the design pattern , object oriented principles & solid principles whenever is possible to make the system reusable , extensible , maintainable. Make sure the code is well structured and follow the clean coding practices to make the classes and method clean. Take care of the readability of code while taking care of all the above. YES, software engineering is hard.
Written By: Deepshikha Niyogi