Skip to content
Courses
DSA to Development
For Working Professionals
Data Structure & Algorithm Classes (Live)
System Design (Live)
JAVA Backend Development(Live)
DevOps(Live)
Data Structures & Algorithms in Python
For Students
Interview Preparation Course
GATE CS & IT 2024
Data Science (Live)
Data Structure & Algorithm-Self Paced(C++/JAVA)
Master Competitive Programming(Live)
Full Stack Development with React & Node JS(Live)
For School Students
CBSE Class 12 Computer Science
School Guide
Python Programming Foundation
All Courses
Tutorials
Data Structures & Algorithms
DSA for Beginners
Data Structures
Arrays
Matrix
Strings
Linked List
Singly Linked List
Doubly Linked List
Circular Linked List
Doubly Circular Linked List
Linked List Tutorial
Stack
Queue
Tree
Generic Tree
Binary Tree
Binary Search Tree
AVL Tree
B Tree
B+ Tree
Red Black Tree
Tree Data Structure Tutorial
Heap
Hashing
Graph
Set Data Structure
Map Data Structure
Advanced Data Structure
Data Structures Tutorial
Algorithms
Analysis of Algorithms
Design and Analysis of Algorithms
Asymptotic Analysis
Asymptotic Notations
Worst, Average and Best Cases
Searching Algorithms
Linear Search
Binary Search
Searching Algorithms Tutorial
Sorting Algorithms
Selection Sort
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Heap Sort
Counting Sort
Radix Sort
Bucket Sort
Sorting Algorithms Tutorial
Greedy Algorithms
Dynamic Programming
Graph Algorithms
Pattern Searching
Recursion
Backtracking
Divide and Conquer
Mathematical Algorithms
Geometric Algorithms
Bitwise Algorithms
Randomized Algorithms
Branch and Bound
Algorithms Tutorial
Complete DSA Tutorial
Competitive Programming
Company Wise SDE Sheets
Facebook SDE Sheet
Amazon SDE Sheet
Apple SDE Sheet
Netflix SDE Sheet
Google SDE Sheet
Wipro Coding Sheet
Infosys Coding Sheet
TCS Coding Sheet
Cognizant Coding Sheet
HCL Coding Sheet
DSA Cheat Sheets
DSA Sheet for Beginners
SDE Sheets
FAANG Coding Sheet
Love Babbaar Sheet
Mass Recruiter Sheet
Product-Based Coding Sheet
Company-Wise Preparation Sheet
Top Interview Questions
Top 100 DSA Interview Questions Topic-wise
Top 50 Array Problems
Top 50 String Problems
Top 50 Stack Problems
Top 50 Heap Problems
Top 50 Linked List Problems
Top 50 Tree Problems
Top 50 Graph Problems
Top 50 Problems on Recursion Algorithms
Top 20 Interview Questions on Greedy Algorithms
Top 20 Interview Questions on Dynamic Programming
Top 50 Problems on Dynamic Programming (DP)
Top 20 Interview Questions on Hashing
Interview Questions on Top 10 Algorithms
Commonly Asked Data Structure Interview Questions
Puzzles
All Puzzles
Top 100 Puzzles Asked In Interviews
Top 20 Puzzles Commonly Asked During SDE Interviews
Top MCQs on Puzzles with Answers
Crossword Puzzle Of The Week
ML & Data Science
Learn Python
Machine Learning
Machine Learning Tutorial
Maths for ML
ML Projects
Data Science using Python
Data Science using R
Data Science Packages
Pandas Tutorial
NumPy Tutorial
Data Visualization
Data Visualization with Python
Python Data Visualization Tutorial
Matplotlib Tutorial
Bokeh Tutorial
Plotly Tutorial
Seaborn Tutorial
Data Visualization with R
Data Visualization with R
Plotly Tutorial
ggplot Tutorial
Data Visualization Tools
Tableau
Power BI
Data Analysis
Data Analysis with Python
Data Analysis with R
Deep Learning
Deep Learning Tutorial
Deep Learning Projects
NLP Tutorial
OpenCV Tutorial
Interview Questions
Machine Learning Interview Question
Deep Learning Interview Question
Python Interview Questions
Top 50 R Interview Questions
ML Frameworks
Tensorflow
PyTorch
PyTorch Lightning
System Design
System Design Tutorial
What is System Design
Key Terminologies in System Design
Analysis and Architecture of Systems
Scalability in System Design
Databases in System Design
High Level Design or HLD
Low Level Design or LLD
Communication Protocols
Web Servers and Proxies
Case Studies in Designing Systems
Complete System Design Tutorial
Software Design Patterns
Factory Pattern
Observer Pattern
Singleton Design Pattern
Decorator Pattern
Strategy Pattern
Adapter Pattern
Command Pattern
Iterator Pattern
Prototype Design Pattern
All Design Patterns
System Design Roadmap
Top 10 System Design Interview Questions and Answers
Interview Corner
Company Preparation
Top Topics
Practice Company Questions
Interview Experiences
Experienced Interviews
Internship Interviews
Competitive Programming
Multiple Choice Quizzes
Aptitude for Placements
Languages
C
C++
Java
Python
JavaScript
PHP
R Tutorial
C#
SQL
Scala
Perl
Go Language
Kotlin
Web Development
HTML
HTML Tutorial
Free HTML Course
HTML Cheat Sheet
CSS
CSS Tutorial
Free CSS Course
CSS Cheat Sheet
CSS Preprocessors
SASS
LESS
JavaScript
JavaScript Tutorial
Free JavaScript Course
JavaScript A to Z Complete Guide
JavaScript Cheat Sheet
JavaScript Programming Examples
ReactJS
ReactJS Tutorial
Free ReactJS Course
ReactJS Frameworks
NextJS
React Material UI
React Bootstrap
React Suite
Ant Design
ReactJS Reactstrap
BlueprintJS
Node.js
Node.js Tutorial
Express.js
PHP
PHP Tutorial
PHP Programming Examples
AngularJS
AngularJS Tutorial
AngularJS Cheat Sheet
AngularJS Frameworks
Angular PrimeNG
Angular ngx Bootstrap
jQuery
jQuery Tutorial
jQuery Cheat Sheet
jQuery Frameworks
jQuery UI
jQuery Mobile
jQwidget
TypeScript
JSON
CSS Frameworks & Libraries
Bootstrap
Bootstrap Tutorial
Bootstrap 5
Bootstrap Cheat Sheet
Tailwind CSS
Bulma
Pure CSS
Materialize CSS
Foundation
Semantic UI
Primer CSS
Spectre CSS
JS Other Frameworks & Libraries
Lodash
D3.js
Vue.js
Underscore.js
TensorFlow.js
Collect.js
Fabric.js
p5.js
CS Subjects
Mathematics
Operating System
DBMS
Computer Networks
Computer Organization and Architecture
Theory of Computation
Compiler Design
Digital Logic
Software Engineering
DevOps
GIT
AWS
Docker
Kubernetes
Microsoft Azure Tutorial
Google Cloud Platform
School Learning
English Grammar
School Programming
Mathematics
Number System
Algebra
Linear Algebra
Trigonometry
Set Theory
Statistics
Probability
Geometry
Mensuration
Logarithms
Calculus
CBSE Syllabus
Class 8 Syllabus
Class 9 Syllabus
Class 10 Syllabus
Class 11 Syllabus
Class 12 Syllabus
Maths Notes (Class 8-12)
Class 8 Notes
Class 9 Notes
Class 10 Notes
Class 11 Notes
Class 12 Notes
Maths Formulas (Class 8 -11)
Class 8 Formulas
Class 9 Formulas
Class 10 Formulas
Class 11 Formulas
Math Calculators
NCERT Solutions
Class 8 Maths Solution
Class 9 Maths Solution
Class 10 Maths Solution
Class 11 Maths Solution
Class 12 Maths Solution
RD Sharma Solutions
Class 8 Maths Solution
Class 9 Maths Solution
Class 10 Maths Solution
Class 11 Maths Solution
Class 12 Maths Solution
Science Notes
Class 8 Notes
Class 9 Notes
Class 10 Notes
Physics Notes (Class 8-12)
Class 8 Notes
Class 9 Notes
Class 10 Notes
Class 11 Notes
Class 12 Notes
Chemistry Notes (Class 8-12)
Class 8 Notes
Class 9 Notes
Class 10 Notes
Class 11 Notes
Class 12 Notes
Biology Notes (Class 8-12)
Class 8
Class 9
Class 10
Class 11
Class 12
Social Science Syllabus
Class 7 SS Syllabus
Class 8 SS Syllabus
Class 9 SS Syllabus
Class 10 SS Syllabus
Social Science Notes
SS Notes (Class 7-12)
Class 7 Notes
Class 8 Notes
Class 9 Notes
Class 10 Notes
CBSE History Notes (Class 7-10)
History Class 7
History Class 8
History Class 9
CBSE Geography Notes (Class 7-10)
Geo. Class 7
Geo. Class 8
Geo. Class 9
CBSE Civics Notes (Class 7-10)
Civics Class 7
Civics Class 8
CBSE Previous Year Papers
Maths
Physics
History
Georgraphy
Political Science
Economics
Commerce
Business Studies
Class 11th Notes
Class 12th Notes
Business Studies Complete Guide
Accountancy
Class 11th Notes
Class 12th Notes
Accountancy Complete Guide
Microeconomics
Class 11th Notes
Microeconomics Complete Guide
Statistics for Economics
Class 11th Notes
Statistics for Economics Complete Guide
Macroeconomics
Class 12th notes
Macroeconomics Complete Guide
Indian Economic Development
Class 12th Notes
Indian Economic Development Complete Guide
Management
Income Tax
Finance
CBSE Class 12 Previous Years Papers
Economics - Paper 2020 Set 2 (58/2/2)
Economics - Paper 2020 Set 2
Economics - Paper 2020 Set (58/1/3)
Economics - Paper 2020 Set (58/1/2)
Accountancy - Paper Code: 67/1/1, 2020
Accountancy - Paper Code: 67/1/2, 2020
Accountancy - Paper Code: 67/1/3, 2020
Accountancy - Paper Code: 67/2/1, 2020
Accountancy - Paper Code: 67/2/2, 2020
Accountancy - Paper Code: 67/2/3, 2020
Accountancy - Paper Code: 67/4/1, 2020
Business Studies - Paper-2019 Set 1
Business Studies - Paper 2019 Code (66-2-1)
Business Studies - Paper-2020 Set 1
Business Studies - Paper-2020 Set 2
Economics - Paper 2020 Set 1
Economics - Paper 2020 Set 2 (58/2/3)
Economics - Paper 2020 Set 3
Economics - Paper 2020 Set 3 (58/3/2)
Economics - Paper 2020 Set 3 (58/3/3)
Economics - Paper 2020 Set 4 (58/4/1)
Economics - Paper 2020 Set 4 (58/4/2)
Economics - Paper 2020 Set 4 (58/4/3)
Economics - Paper 2020 Set 5 (58/5/1)
Economics - Paper 2020 Set 5 (58/5/2)
Economics - Paper 2020 Set 5 (58/5/3)
Commerce Complete Guide
GATE
GATE 2024 Live Course
GATE Computer Science Notes
Last Minute Notes
GATE CS Solved Papers
GATE CS Original Papers and Official Keys
GATE CS 2023 Syllabus
Important Topics for GATE CS
GATE 2023 Important Dates
Other CS Exams
ISRO
ISRO CS Original Papers and Official Keys
ISRO CS Solved Papers
ISRO CS Syllabus for Scientist/Engineer Exam
UGC NET
UGC NET CS Notes Paper II
UGC NET CS Notes Paper III
UGC NET CS Solved Papers
Banking Exams Study Material
RRB Clerk 2023 Exam
SBI Clerk
SBI Clerk Syllabus
General Awareness
English
Quantitative Aptitude
Reasoning Ability
SBI Clerk Practice Papers
SBI PO
SBI PO Syllabus
General Awareness
English
Quantitative Aptitude
Reasoning Ability
Previous Year Papers
SBI PO Practice Papers
IBPS PO
IBPS PO 2022 Syllabus
English Notes
Reasoning Notes
Previous Year Papers
Mock Question Papers
General Awareness
IBPS Clerk
IBPS Clerk Syllabus
English Notes
Previous Year Papers
UPSC Study Material
Geography Notes
History Notes
Modern Indian History Notes
Medieval Indian History Notes
Ancient Indian History Notes
Complete History Notes
Science & Tech. Notes
Ethics Notes
Polity Notes
Economics Notes
Government Schemes (Updated)
UPSC Previous Year Papers
SSC CGL Study Material
SSC CGL Syllabus
General Studies
English
Reasoning
Subjectwise Practice Papers
Previous Year Papers
Student
Campus Ambassador Program
School Ambassador Program
Project
Geek of the Month
Campus Geek of the Month
Placement Course
Competitive Programming
Testimonials
Student Chapter
Geek on the Top
Internship
Careers
Jobs
For Job Seekers
Get Hired: Apply for Jobs
Job-a-thon: Hiring Challenge
For Recruiters
Corporate Hiring Solutions
Practice
All DSA Problems
Problem of the Day
GFG SDE Sheet
Curated DSA Lists
Beginner's DSA Sheet
Love Babbar Sheet
Top 50 Array Problems
Top 50 String Problems
Top 50 DP Problems
Top 50 Graph Problems
Top 50 Tree Problems
Contests
GFG Weekly Coding Contest
Job-A-Thon: Hiring Challenge
BiWizard School Contest
All Contests and Events
Home
Saved Videos
Courses
GBlog
Puzzles
What's New ?
Change Language
Trending Now
Data Structures
Algorithms
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
Java
C
C++
ReactJS
NodeJS
Competitive Programming
Aptitude
Puzzles
Projects
Web Development
▲
Similar Topics
DSA
20.6k+ articles
Experiences
11.6k+ articles
Interview Experiences
10.7k+ articles
Marketing
4.3k+ articles
On-Campus
3.1k+ articles
Strings
3k+ articles
Amazon
1.8k+ articles
Internship
1.5k+ articles
Microsoft
810+ articles
Experienced
620+ articles
Goldman Sachs
260+ posts
Popular articles
Recent articles
Merge two sorted arrays
Last Updated: 03 October 2023
Given two sorted arrays, the task is to merge them in a sorted manner.Examples:Input: arr1[] = { 1, 3, 4, 5}, arr2[] = {2, 4, 6, 8}Output: arr3[] = {1, 2, 3, 4, 4, 5, 6, 8
...read more
Arrays
Microsoft
Amazon
Goldman Sachs
Snapdeal
Zoho
Linkedin
Quikr
Visa
Synopsys
Brocade
Juniper Networks
Sorting
Mathematical
Amdocs
Merge Sort
Insertion Sort
DSA
Design a stack that supports getMin() in O(1) time and O(1) extra space
Last Updated: 17 April 2023
Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() which should retur
...read more
Microsoft
Amazon
Adobe
Flipkart
Goldman Sachs
VMWare
Snapdeal
Paytm
Sapient
SAP Labs
FactSet
Kuliza
Stack
STL
GreyOrange
DSA
Merge two sorted arrays with O(1) extra space
Last Updated: 26 September 2023
We are given two sorted arrays. We need to merge these two arrays such that the initial numbers (after complete sorting) are in the first array and the remaining numbers a
...read more
Arrays
Microsoft
Amazon
Goldman Sachs
Snapdeal
Zoho
Linkedin
Quikr
Synopsys
Brocade
Juniper Networks
Sorting
Mathematical
Amdocs
Merge Sort
Insertion Sort
DSA
Similar Topics
DSA
20.6k+ articles
Experiences
11.6k+ articles
Interview Experiences
10.7k+ articles
Marketing
4.3k+ articles
On-Campus
3.1k+ articles
Strings
3k+ articles
Amazon
1.8k+ articles
Internship
1.5k+ articles
Microsoft
810+ articles
Experienced
620+ articles
Puzzle 9 | (Find the fastest 3 horses)
Last Updated: 25 May 2023
There are 25 horses among which you need to find out the fastest 3 horses. You can conduct a race among at most 5 to find out their relative speed. At no point, you can fi
...read more
Goldman Sachs
Accolite
MakeMyTrip
Puzzles
Logical Puzzles
Introduction and Array Implementation of Queue
Last Updated: 25 May 2023
Similar to Stack, Queueis a linear data structure that follows a particular order in which the operations are performed for storing data. The order is First In First Out (
...read more
Arrays
Goldman Sachs
Queue
DSA
QuickSort - Data Structure and Algorithm Tutorials
Last Updated: 09 September 2023
QuickSort is a sorting algorithm based on the Divide and Conquer algorithm that picks an element as a pivot and partitions the given array around the picked pivot by placi
...read more
Adobe
Qualcomm
Samsung
Goldman Sachs
SAP Labs
Target Corporation
HSBC
Divide and Conquer
Sorting
Quick Sort
DSA
Stock Buy Sell to Maximize Profit
Last Updated: 13 July 2023
The cost of a stock on each day is given in an array. Find the maximum profit that you can make by buying and selling on those days. If the given array of prices is sorted
...read more
Arrays
Microsoft
Amazon
Morgan Stanley
Oracle
Flipkart
Directi
Samsung
Goldman Sachs
Walmart
Paytm
Accolite
Hike
Sapient
SAP Labs
MakeMyTrip
Quikr
Ola Cabs
Pubmatic
Swiggy
DSA
Merge Sort - Data Structure and Algorithms Tutorials
Last Updated: 06 July 2023
Merge sort is defined as a sorting algorithm that works by dividing an array into smaller subarrays, sorting each subarray, and then merging the sorted subarrays back toge
...read more
Microsoft
Amazon
Oracle
Qualcomm
Goldman Sachs
Snapdeal
Paytm
Target Corporation
Grofers
Divide and Conquer
Sorting
Boomerang Commerce
DSA
Check whether two Strings are anagram of each other
Last Updated: 03 October 2023
Given two strings. The task is to check whether the given strings are anagrams of each other or not.An anagram of a string is another string that contains the same charact
...read more
Strings
Amazon
Goldman Sachs
Nagarro
anagram
DSA
Reverse words in a given string
Last Updated: 13 September 2023
Given a string, the task is to reverse the order of the words in the given string.Examples:Input: s = "geeks quiz practice code"Output: s = "code practice quiz geeks"Input
...read more
Strings
Microsoft
Amazon
Adobe
Morgan Stanley
Goldman Sachs
Cisco
Paytm
Accolite
Payu
Zoho
MAQ Software
SAP Labs
MakeMyTrip
Reverse
Wipro
school-programming
CBSE - Class 11
DSA
How to determine if a binary tree is height-balanced?
Last Updated: 19 June 2023
A height balanced binary tree is a binary tree in which the height of the left subtree and right subtree of any node does not differ by more than 1 and both the left and r
...read more
Tree
Microsoft
Amazon
Goldman Sachs
Walmart
Belzabar
Paytm
Intel
InMobi
Synopsys
Zillious
Self-Balancing-BST
DSA
Queue using Stacks
Last Updated: 10 July 2023
The problem is opposite of this post. We are given a stack data structure with push and pop operations, the task is to implement a queue using instances of stack data stru
...read more
Microsoft
Amazon
Adobe
Morgan Stanley
Oracle
Flipkart
Goldman Sachs
D-E-Shaw
Walmart
Accolite
InMobi
MAQ Software
MakeMyTrip
InfoEdge
Stack
Queue
STL
DSA
Write a function to get the intersection point of two Linked Lists
Last Updated: 10 April 2023
There are two singly linked lists in a system. By some programming error, the end node of one of the linked lists got linked to the second list, forming an inverted Y-shap
...read more
Linked List
Microsoft
Amazon
Qualcomm
Goldman Sachs
D-E-Shaw
Snapdeal
Accolite
MAQ Software
MakeMyTrip
Visa
Zopper
FactSet
DSA
Find first non-repeating character of given String
Last Updated: 22 May 2023
Given a string S consisting of lowercase Latin Letters, the task is to find the first non-repeating character in S.Examples:Input: "geeksforgeeks"Output: fExplanation: As
...read more
Strings
Amazon
Morgan Stanley
Goldman Sachs
D-E-Shaw
Accolite
Payu
MAQ Software
MakeMyTrip
InfoEdge
Ola Cabs
OATS Systems
Teradata
Tejas Network
cpp-pair
DSA
Ugly Numbers
Last Updated: 10 February 2023
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first 11 ugly numbers. By convention, 1 is
...read more
Arrays
Goldman Sachs
Paytm
Mathematical
series
divisibility
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
Courses
871k+ interested Geeks
Complete Interview Preparation
Explore
15k+ interested Geeks
Complete Test Series for Service-Based Companies
Explore
133k+ interested Geeks
JAVA Backend Development - Live
Explore
Recently Published
UX Design Process: A Complete Guide
Read
Why to Choose Java For Backend Development?
Read
Top 10 Django Projects For Beginners With Source Code
Read
How Hotstar and JioCinema Manages Millions of Live Users?
Read
Best Internet Security Suites to Protect your Devices
Read
Top 10 Heroku Alternatives That You Can Try
Read
Top Engineering Colleges in Bangalore 2023
Read
AVG Antivirus: Your Ultimate Defense Against Viruses and Malware
Read
Best Way to Master Java Spring Boot Microservices – A Complete Roadmap
Read
Improve your Coding Skills with Practice
Try It!
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !