The Software Development Life Cycle (SDLC) is a structured framework that directs the process of planning, creating, testing, deploying, and maintaining software. Its prime goal is to deliver superior, profitable, and maintainable software that meets user requirements within defined timelines and resources.
Core Phases of SDLC
Planning & Requirement Analysis – Define project scope, gather requirements from stakeholders, and assess feasibility. This stage produces the Software Requirement Specification (SRS) document.
Defining Requirements – Finalize and document functional and non-functional requirements with stakeholder approval.
Design – Create High-Level Design (HLD) and Low-Level Design (LLD) documents, outlining architecture, modules, interfaces, and database structures.
Development (Coding) – Implement the design using chosen programming languages and tools, following coding standards.
Testing & Integration – Conduct unit, integration, system, and acceptance testing to ensure the product meets SRS specifications.
Deployment – Release the software in phases (beta, full release) and ensure smooth integration into the production environment.
Maintenance – Apply updates, fix bugs, and enhance features to keep the software relevant and secure.
There is a trending term that is floating around in the Artificial Intelligence (AI) field, i.e., “RAG”. So, to satisfy the curiosity, let’s get to know what RAG is. Before that, let us have a brief idea of Generative AI.
What is Generative AI?
Generative AI is an Artificial Intelligence system capable of creating new and original content in the form of text, code, images, audio, and video by learning patterns from large datasets or Large Language Models (LLMs) and analyzing and applying them to produce contextually relevant outputs.
How does it work?
Training: Deep Learning models are trained on large datasets to learn patterns and relationships.
Tuning: Fine-tuning the AI model with LoRA/QLoRA ranking techniques or Reinforcement Learning from Human Feedback (RLHF).
Generation: The AI responds to user queries and prompts by generating text, images, audio, or video based on up-to-date, factual data.
The generative models use “Transformers” to predict the next tokens based on context and produce logical text.
Below is an example of a code snippet that uses transformers to generate the response to a user query:
Transformers: Text/code generation based on LLMs and uses self-attention for context capture.
Diffusion models: Generate high-quality images/audio by iterative denoising.
GANs and VAEs: Image synthesis, style transfer, data augmentation
Encoder-Decoder: Translation, Summarization, and Multimodal tasks.
Generative AI Applications:
Text-generation (chatbots, summarization, and code generation), Image-generation (Art, medical images), Audio-generation (voice synthesis, music creation), Video-generation (animation, simulation).
Limitations of Generative AI
Generative AI models are prone to hallucinations and thus are less accurate.
Generative AI is not real-time. It is limited to its training cut-off, i.e., it does not access updated information until it is retrained.
It lacks access to the internal and proprietary data (For example, company reports, release notes, etc.).
It works with Large models and datasets. So it is resource-intensive with respect to compute and storage. So, fine-tuning becomes difficult.
These limitations make the urge to think about an improved methodology and architecture. Here is where “RAG” comes into the picture.
What is RAG?
Retrieval Augmented Generation (RAG) is a technique that adds relevant context to AI, resulting in improved and accurate responses.
RAG Architecture
Generative AI vs RAG Comparison:
Aspect
GenAI
RAG
Accuracy
Prone to hallucinations
Grounded in retrieved sources
Knowledge Freshness
Static, limited to training cutoff
Dynamic, can access real-time data
Domain Adaptability
Weak with proprietary/internal data
Strong, integrates custom datasets
Resource Needs
High (training/fine-tuning)
Lower (retrieval pipeline setup)
Creativity
Strong (novel, diverse outputs)
Moderate (depends on retrieved context)
Traceability
Limited (no source attribution)
High (answers linked to documents)
RAG Components
Knowledge Index – An external knowledge source is a foundation for a RAG system. The knowledge source can be any domain-specific custom dataset, documents, databases, APIs, or structured tables.
Document Loader – The document loader standardizes and normalizes the documents from knowledge index data sources such as local files, web pages, cloud storage, or databases. The text splitter extracts the text, splits the text into chunks, and enriches it with metadata for the embedding phase.
Embedding – The text chunks are converted into numerical vectors using embedding models and capturing semantic meaning.
Vector Store – The embeddings are stored in a vector database or vector store. The vector database enables fast similarity searches and retrieves relevant context based on the user’s query.
Retriever – The query encoder converts the user input into a vector representation. The retriever then searches the vector database using semantic similarity or other search techniques to fetch the most relevant chunks of information.
Ranker – The ranker will carry out duplication, relevance ranking, and context enrichment on the vector embeddings. The retrieved and ranked chunks are then combined with the user query to generate a better and more accurate response.
Generator – The generator is the large language model (LLM) that synthesizes the retrieved context and user query to produce a grounded response. The modern RAG systems may use generators for query rewriting, self-evaluation, and corrective re-retrieval.
Output response – Output response is a formatted final response that is sent to the user.
Updator (Optional) – Some RAG systems use an updator to refresh and re-embed the data to ensure the knowledge base remains current and updated. The updator can be equipped with an agentic framework for automated refreshment of knowledge base.
Summary
RAG stands for Retrieval Augmented Generation.
Retrieval – Find relevant information.
Augmentation – Add data to AI’s knowledge.
Generation – Generate a better and more accurate response.
The purpose of RAG is to add relevant context to AI and generate an accurate response.
Given an array of positive integers, return the number of elements that are strictly greater than the average of all previous elements. Skip the first element.
If we list all the natural numbers below that are multiples of 3 or 5, we get 3, 5, 6, and 9. The sum of these multiples is 23.
Input Format
The first line contains T, which denotes the number of test cases. This is followed by T lines, each containing an integer, N.
Constraints
1 <= T <= 10^5
1 <= N <= 10^9
Output Format
For each test case, print an integer denoting the sum of all the multiples of 3 or 5 below N.
Sample Input 0
2 10 100
Sample Output 0
23 2318
Explanation 0
For if we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6, and 9. The sum of these multiples is 23.
Similarly, for N=100, we get 2318.
Solution:
sum_of_multiples.py
Python
#!/bin/python3
importsys
t=int(input().strip())
if1<=t<=pow(10,5):
defsum_of_multiples(k,limit):
m=(limit-1)//k
returnk*m*(m+1)//2
fora0inrange(t):
n=int(input().strip())
s3=sum_of_multiples(3,n)
s5=sum_of_multiples(5,n)
s15=sum_of_multiples(15,n)
total=s3+s5-s15
print(total)
Output:
Input (stdin)
2
10
100
Your Output (stdout)
23
2318
Expected Output
23
2318
Note:
Avoid using loops when solving this problem, as N can be large enough (about 10^9), which can cause time and space to explode. The trick is to use arithmetic series formulas.
sum_of_multiples1.py
Python
importsys
t=int(input().strip())
if1<=t<=pow(10,5):
fora0inrange(t):
n=int(input().strip())
total=0
# print("n = ", n)
if1<=n<=pow(10,9):
ifn==1:
total=n
li=[iforiinrange(1,n)if(i%3==0ori%5==0)]
total=sum(li)
print(total)
The above code has O(n) complexity; however, it fails under memory constraints. When used with the arithmetic formula, the time complexity becomes O(1).
Given 2 sets of integers M and N, print their symmetric difference in ascending order. The term symmetric difference indicates those values that exist in either but do not exist in both.
Solution:
Python
# Enter your code here. Read input from STDIN. Print output to STDOUT