Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • GfG 160: Daily DSA
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • System Design Tutorial
  • What is System Design
  • System Design Life Cycle
  • High Level Design HLD
  • Low Level Design LLD
  • Design Patterns
  • UML Diagrams
  • System Design Interview Guide
  • Scalability
  • Databases
Open In App
Next Article:
Designing Google Maps | System Design
Next article icon

Designing Google Maps | System Design

Last Updated : 12 Jan, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

A web mapping tool called Google Maps offers a range of geographic data, such as street maps, satellite photos, streets' aerial views, real-time traffic reports, and directions. There are several versions of it available, such as web, mobile, etc. In this article, we will see the system design of Google Maps

google-maps-system-design

Important Topics for the Google Maps System Design

  • What is Google Maps?
  • Requirements for Google Maps System Design
  • Capacity estimation for Google Maps System Design
  • Why we use Quad Tree in Google Maps?
  • Low -Level Design for Google Maps System Design
  • High-Level Design of Google Maps
  • System Design Diagram of Google Maps
  • Database design of Google Maps System Design
  • Scalability of Google Maps
  • Microservices and API used for Google Maps
  • Components Details of Google Maps

What is Google Maps?

Google Maps is a web mapping service developed by Google. It offers satellite imagery, aerial photography, street maps, 360° interactive panoramic views of streets (Street View), real-time traffic conditions, and route planning for traveling by foot, car, bicycle, or public transportation.

Users can access Google Maps through a web browser on a computer or through the Google Maps mobile app on smartphones and tablets.

Google-Map-(1)
Google

Requirements for Google Maps System Design

Functional Requirements for Google Maps System Design

  • Map Display:
    • The system should display maps with different levels of zoom.
    • Provide support for different map views such as satellite, terrain, and street view.
  • Location Search:
    • Allow users to search for locations by entering addresses, landmarks, or geographical coordinates.
  • Provide and recommend the fastest route: 
    • Providing the source and destination place, the system should provide/recommend the optimal route by distance and time and also depending on the type of transportation
  • Traffic and weather Information:
    • Display real-time traffic conditions on the map.
    • Provide traffic predictions and suggest optimal routes based on current traffic jams.
    • Weather updates (storms etc)
  • Near me Model:
    • We search near me example, grocery, gym, saloon etc.
    • Place people have visited more with more rating it comes on top, it show the opening time, services they provide, etc.
    • And let suppose we want to visit at that place then it shows the routes.

Non Functional Requirements for Google Maps System Design

  • Availability: There should be very little downtime and high availability for the system.
  • Scalability: A large number of concurrent users and requests should be supported by the system.
  • Accuracy: Information from the system ought to be current and accurate.
  • Security: User data should be protected and the system should be secure.
  • ETA accuracy can be impacted by: weather, road quality, accident, road block there is no math formula to detect it.

Capacity estimation for Google Maps System Design

Data Storage:

  • Map Data:
    • Estimated at 1 Petabyte (PB).
    • 1 PB = 1,000 Terabytes (TB) = 1,000,000 Gigabytes (GB)
  • Traffic Data:
    • Hundreds of TB daily.
    • Assuming 500 TB/day, 500 TB * 365 days = 182,500 TB annually.
  • POI Data:
    • Estimated over 100 TB.

Server Resources:

  • Processing Power:
    • Handling billions of user requests and real-time updates requires massive computational power.
    • Precise server counts and processing capabilities are not publicly available.
  • Memory and Storage:
    • Each server needs sufficient memory and local storage to handle tasks efficiently.
    • Server specifications vary based on their purpose (rendering, routing, search).

Network Bandwidth:

  • User Requests:
    • Billions of requests daily for map tiles, navigation, and POI searches.
    • Assuming an average of 10 TB of data transferred per request, 10 TB * 1 billion requests = 10,000,000 TB or 10,000 PB of daily bandwidth.

Overall Capacity:

  • Data Storage: Potentially several Exabytes (EB).
    • 1 EB = 1,000 PB
  • Servers: Millions globally.
  • Network Bandwidth: Massive, spanning multiple continents.

Why we use Quad Tree in Google Maps?

Google Maps doesn't actually use a pure quad tree for its overall data structure. However, it utilizes concepts similar to those used in a quad tree within certain functionalities. Here's why:

Data Types in Google Maps:

  • Google Maps deals with two main types of data:
    • Static data: Map imagery, street layouts, landmarks.
    • Dynamic data: Traffic flow, location of users, POIs with recent updates.

Quad Tree's Advantages:

  • Spatial Efficiency: A quad tree excels at partitioning 2D space into smaller grids, focusing on areas with more data points. This reduces unnecessary searches in sparsely populated areas.
  • Fast Lookups: By recursively dividing space, quad trees enable efficient lookups for points within specific regions. This benefits functionalities like finding nearby POIs or calculating routes.

Google Maps Implementation:

  • Google Maps implements similar techniques but not a strict quad tree for several reasons:
    • Dynamic Data Variations: Traffic and user locations constantly change, requiring a more flexible structure than a static quad tree.
    • Varying Data Density: Different regions have varying densities of roads, POIs, and traffic data. A quad tree's rigid grid may not efficiently handle such discrepancies.

Example implementation:

Code for map-like scenario
# Create a quad tree with initial bounds
map_tree = QuadTreeNode(bounds=(0, 0, 100, 100))

# Add points representing landmarks or POIs
map_tree.insert((25, 35))
map_tree.insert((70, 80))
# ... (add more points)

# Find points within a search region
search_region = (50, 50, 75, 75)
points_in_region = map_tree.find_points_in_region(search_region)
print(points_in_region) 

Low -Level Design for Google Maps System Design

Google Maps' low-level design with illustrative images:


1. Data Structures:

  • Map Data:
    • Stored in distributed file systems like Google File System (GFS) and Bigtable.
    • Map tiles organized geographically to facilitate efficient retrieval.
    • Image compression techniques utilized to optimize storage and bandwidth.
  • Traffic Data:
    • Real-time traffic flow stored in stream processing frameworks like Apache Flink.
    • Historical data archived in data warehouses like Google BigQuery.
    • Data aggregated and updated constantly to provide dynamic traffic information.
  • Point of Interest (POI) Data:
    • Stored in geospatial databases like Google Maps Platform's Geocoding API.
    • Structured with details like name, category, location, and user reviews.
    • Continuously updated to ensure data accuracy and freshness.

2. Data Processing and Retrieval:

  • Map Tile Serving:
    • Content Delivery Networks (CDNs) geographically distributed to deliver map tiles quickly based on user location.
    • Caching mechanisms implemented to reduce server load and improve response times.
  • Traffic Flow Calculations:
    • Algorithms like Dijkstra's shortest path algorithm used to calculate dynamic routes based on real-time traffic conditions.
    • Edge weights in the pathfinding graph constantly updated with traffic data.
  • POI Search and Querying:
    • Spatial indexing techniques like R-trees and k-nearest neighbors (kNN) used for efficient POI search based on user queries.
    • Fuzzy matching algorithms handle typos and partial input for improved search results.

3. User Interface and Rendering:

  • Interactive Map View:
    • WebGL library utilized for responsive and smooth map rendering on various devices.
    • Layers implemented for displaying map tiles, traffic overlays, and POIs separately.
  • Turn-by-Turn Navigation:
    • Precise road network data and GPS location used to provide accurate turn-by-turn instructions.
    • Voice prompts and visual guidance ensure smooth navigation on various routes.
  • User Interactions and Customization:
    • APIs designed for integrating features like route saving, location sharing, and personalized map styles.
    • Touch interactions and gestures optimized for mobile device usage.

4. Communication and Protocols:

  • Map Tile Requests:
    • Protocol Buffers (protobuf) used for efficient map tile request and response messages.
    • Binary format reduces message size and transmission time.
  • Real-time Traffic Updates:
    • Streaming protocols like MQTT or WebSockets employed for real-time traffic information exchange between servers and client devices.
    • Push notifications used to alert users about sudden traffic changes.
  • API Communication:
    • RESTful APIs used for user interaction and integration with third-party applications.
    • OAuth authentication ensures secure access and data privacy.

Note:

This is a high-level overview of Google Maps' low-level design. The actual implementation involves complex algorithms, distributed systems, and constant innovation to ensure its functionality and scalability.

High-Level Design of Google Maps

The high-level design's components are described in detail in the low-level design, with an emphasis on their functions and interactions.

Example :- For a particular element, such as the Maps Rendering Service, for instance

  • Geo-coordinates and zoom level are input.
  • Overlay rendering and tile generation are processed.
  • Produced: Detailed Map Tiles

There are several components that make up Google Maps' low-level design (LLD), including:

  • Rendering of maps: This part is in charge of producing maps of any place on the planet. It makes use of a range of data sources, including terrain data, satellite imagery, and street-level imagery.
  • Routing: This part is in charge of giving users directions to their destination while accounting for other variables like road closures and traffic patterns. To determine the fastest and shortest routes, it employs a number of different algorithms.
  • Place search: This feature is in charge of assisting users in locating establishments, eateries, landmarks, and other locations of interest. It draws from a wide range of data sources, including social media posts, restaurant reviews, and business listings.
  • Real-time data processing: This part is in charge of handling data that is received in real-time from various sources, including social media, weather stations, and traffic sensors. It updates the maps and gives users the most recent information using this data.

Three primary layers comprise Google Maps' high-level design (HLD):

  1. Presentation layer:
    • The presentation layer is in charge of rendering the maps and giving users the option to look up locations and directions.
  2. Application layer:
    • This layer is in charge of managing real-time data and processing user requests as well as request routing.
  3. Data layer:
    • This layer manages the databases' data storage and retrieval.

System Design Diagram of Google Maps

A system such as Google Maps needs to be carefully designed with many different components and their interactions in mind. This is a high-level system design overview :

Core Components:

  • Map Data Storage:
    • To store and manage the enormous amount of map data, which includes roads, landmarks, points of interest, and real-time traffic information, a massive distributed datastore is required. For effective data retrieval, spatially partitioned data structures such as quadtrees or geohashes can be utilized.
  • Geolocation Services:
    • To provide location-based services and ascertain the current location of a user, precise geolocation capabilities are essential. To determine user coordinates, this entails integrating with data from cellular networks, Wi-Fi, and GPS systems.
  • Routing Engine:
    • Taking into account a number of variables, including user preferences, traffic conditions, and road types, a robust routing engine determines the quickest or shortest path between two points. Graph algorithms such as A* or Dijkstra's can be used to determine the best routes.
  • Map Rendering Engine:
    • Based on the user's location and zoom levels, an effective map rendering engine creates map tiles. In order to do this, map data must be retrieved, processed, and appropriately styled and labelled from the datastore.
  • Search and Navigation:
    • Users can locate particular places, companies, or points of interest with the help of a strong search and navigation system. This entails giving precise navigational instructions and indexing map data for effective search.
  • Real-time Traffic Updates:
    • In order to provide precise estimated travel times and recommend alternate routes, real-time traffic information is essential. This entails gathering traffic data and feeding it into the routing engine from multiple sources, including sensors, GPS units, and user input.

Google-Map-System-Design-(1)

Database design of Google Maps System Design

A distributed database architecture is used by Google Maps to provide scalability and reliability. For real-time analytics, they might use Bigtable on Google Cloud, and for structured data, they might use Cloud SQL, a relational database which is already mention in System Design diagram.

Google Maps stores its data in multiple databases. A few of the important databases are:

  • Map data database: This database houses the terrain information, satellite imagery, and street-level imagery.
  • Routing database: Road network information, traffic patterns, and road closures are all stored in the routing database.
  • Places database: This database contains information about places, such as social media posts, restaurant reviews, and business listings.
  • Real-time data: Information from traffic sensors, weather stations, and social media platforms is stored in this database.

Scalability of Google Maps

One extremely scalable system is Google Maps. It employs a number of strategies, such as the following, to manage numerous concurrent users and requests:

  • Load balancing :- Google Maps employs load balancers to disperse traffic among several servers. This makes it possible for the system to manage even the highest traffic volume.
  • Replication :- Data is replicated by Google Maps among several servers. This contributes to maintaining high system availability and preventing data loss.
  • Caching :- Google Maps caches information that is accessed often. This lessens the strain on the database servers and enhances performance.

Microservices and API used for Google Maps

The architecture of Google Maps is based on microservices, with each component implemented as a separate microservice. This enables us to swiftly roll out new features and scale each component independently.

Google Maps makes use of the following APIs:

  • Maps API: With this API, programmers can incorporate Google Maps into their own apps.
  • Directions API: Developers can determine the optimal path between two locations with the help of the Directions API.
  • Places API: Developers can use the Places API to look up and retrieve details about establishments, eateries, and tourist destinations.
  • Geocoding API: Developers can use the geocoding API to convert addresses to coordinates.
  • Distance Matrix API: Developers can use the Distance Matrix API to determine the time and distance between various locations.

For various operations, the APIs use common HTTP methods like GET, POST, and PUT:

  • GET: Get information, like directions or map tiles.
  • POST: Send in data, like user location updates or newly contributed points of interest.
  • PUT: Modify current information, like a company's address or operating hours.

Components Details of Google Maps

  • Map Server:
    • The map data must be stored and served by the map server. Usually, a distributed file system like Google Cloud Storage is used to store the map data. To efficiently serve the map data, the map server employs a number of strategies, including load balancing and caching.
  • Routing Service:
    • The routing service is in charge of figuring out the most efficient path between two points. Numerous factors, including user preferences, road types, and traffic conditions, are taken into consideration by the routing service. The routing service employs a number of algorithms, including Dijkstra's algorithm and A* search, to determine the optimal path.

Next Article
Designing Google Maps | System Design

S

smitvaghaw8il
Improve
Article Tags :
  • Geeks Premier League
  • System Design
  • Geeks Premier League 2023

Similar Reads

    Non-linear Components
    In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
    11 min read
    Spring Boot Tutorial
    Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
    10 min read
    Class Diagram | Unified Modeling Language (UML)
    A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a project—like developers and designers—understand how the system is organized and how its components interact
    12 min read
    Unified Modeling Language (UML) Diagrams
    Unified Modeling Language (UML) is a general-purpose modeling language. The main aim of UML is to define a standard way to visualize the way a system has been designed. It is quite similar to blueprints used in other fields of engineering. UML is not a programming language, it is rather a visual lan
    14 min read
    Steady State Response
    In this article, we are going to discuss the steady-state response. We will see what is steady state response in Time domain analysis. We will then discuss some of the standard test signals used in finding the response of a response. We also discuss the first-order response for different signals. We
    9 min read
    System Design Tutorial
    System Design is the process of designing the architecture, components, and interfaces for a system so that it meets the end-user requirements. This specifically designed System Design tutorial will help you to learn and master System Design concepts in the most efficient way from basics to advanced
    4 min read
    Backpropagation in Neural Network
    Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the model’s predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
    9 min read
    Polymorphism in Java
    Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
    7 min read
    3-Phase Inverter
    An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
    13 min read
    What is Vacuum Circuit Breaker?
    A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
    13 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
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
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

'); // $('.spinner-loading-overlay').show(); let script = document.createElement('script'); script.src = 'https://assets.geeksforgeeks.org/v2/editor-prod/static/js/bundle.min.js'; script.defer = true document.head.appendChild(script); script.onload = function() { suggestionModalEditor() //to add editor in suggestion modal if(loginData && loginData.premiumConsent){ personalNoteEditor() //to load editor in personal note } } script.onerror = function() { if($('.editorError').length){ $('.editorError').remove(); } var messageDiv = $('
').text('Editor not loaded due to some issues'); $('#suggestion-section-textarea').append(messageDiv); $('.suggest-bottom-btn').hide(); $('.suggestion-section').hide(); editorLoaded = false; } }); //suggestion modal editor function suggestionModalEditor(){ // editor params const params = { data: undefined, plugins: ["BOLD", "ITALIC", "UNDERLINE", "PREBLOCK"], } // loading editor try { suggestEditorInstance = new GFGEditorWrapper("suggestion-section-textarea", params, { appNode: true }) suggestEditorInstance._createEditor("") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } //personal note editor function personalNoteEditor(){ // editor params const params = { data: undefined, plugins: ["UNDO", "REDO", "BOLD", "ITALIC", "NUMBERED_LIST", "BULLET_LIST", "TEXTALIGNMENTDROPDOWN"], placeholderText: "Description to be......", } // loading editor try { let notesEditorInstance = new GFGEditorWrapper("pn-editor", params, { appNode: true }) notesEditorInstance._createEditor(loginData&&loginData.user_personal_note?loginData.user_personal_note:"") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } var lockedCasesHtml = `You can suggest the changes for now and it will be under 'My Suggestions' Tab on Write.

You will be notified via email once the article is available for improvement. Thank you for your valuable feedback!`; var badgesRequiredHtml = `It seems that you do not meet the eligibility criteria to create improvements for this article, as only users who have earned specific badges are permitted to do so.

However, you can still create improvements through the Pick for Improvement section.`; jQuery('.improve-header-sec-child').on('click', function(){ jQuery('.improve-modal--overlay').hide(); $('.improve-modal--suggestion').hide(); jQuery('#suggestion-modal-alert').hide(); }); $('.suggest-change_wrapper, .locked-status--impove-modal .improve-bottom-btn').on('click',function(){ // when suggest changes option is clicked $('.ContentEditable__root').text(""); $('.suggest-bottom-btn').html("Suggest changes"); $('.thank-you-message').css("display","none"); $('.improve-modal--improvement').hide(); $('.improve-modal--suggestion').show(); $('#suggestion-section-textarea').show(); jQuery('#suggestion-modal-alert').hide(); if(suggestEditorInstance !== null){ suggestEditorInstance.setEditorValue(""); } $('.suggestion-section').css('display', 'block'); jQuery('.suggest-bottom-btn').css("display","block"); }); $('.create-improvement_wrapper').on('click',function(){ // when create improvement option clicked then improvement reason will be shown if(loginData && loginData.isLoggedIn) { $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status) }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ } $('.improve-modal--improvement').show(); }); const showErrorMessage = (result,statusCode) => { if(!result) return; $('.spinner-loading-overlay:eq(0)').remove(); if(statusCode == 403) { $('.improve-modal--improve-content.error-message').html(result.message); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); return; } } function suggestionCall() { var editorValue = suggestEditorInstance.getValue(); var suggest_val = $(".ContentEditable__root").find("[data-lexical-text='true']").map(function() { return $(this).text().trim(); }).get().join(' '); suggest_val = suggest_val.replace(/\s+/g, ' ').trim(); var array_String= suggest_val.split(" ") //array of words var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(editorValue.length { jQuery('.ContentEditable__root').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // script for grecaptcha loaded in loginmodal.html and call function to set the token setGoogleRecaptcha(); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status); }, }); });
"For an ad-free experience and exclusive features, subscribe to our Premium Plan!"
Continue without supporting
`; $('body').append(adBlockerModal); $('body').addClass('body-for-ad-blocker'); const modal = document.getElementById("adBlockerModal"); modal.style.display = "block"; } function handleAdBlockerClick(type){ if(type == 'disabled'){ window.location.reload(); } else if(type == 'info'){ document.getElementById("ad-blocker-div").style.display = "none"; document.getElementById("ad-blocker-info-div").style.display = "flex"; handleAdBlockerIconClick(0); } } var lastSelected= null; //Mapping of name and video URL with the index. const adBlockerVideoMap = [ ['Ad Block Plus','https://media.geeksforgeeks.org/auth-dashboard-uploads/abp-blocker-min.mp4'], ['Ad Block','https://media.geeksforgeeks.org/auth-dashboard-uploads/Ad-block-min.mp4'], ['uBlock Origin','https://media.geeksforgeeks.org/auth-dashboard-uploads/ub-blocke-min.mp4'], ['uBlock','https://media.geeksforgeeks.org/auth-dashboard-uploads/U-blocker-min.mp4'], ] function handleAdBlockerIconClick(currSelected){ const videocontainer = document.getElementById('ad-blocker-info-div-gif'); const videosource = document.getElementById('ad-blocker-info-div-gif-src'); if(lastSelected != null){ document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.backgroundColor = "white"; document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.borderColor = "#D6D6D6"; } document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.backgroundColor = "#D9D9D9"; document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.borderColor = "#848484"; document.getElementById('ad-blocker-info-div-name-span').innerHTML = adBlockerVideoMap[currSelected][0] videocontainer.pause(); videosource.setAttribute('src', adBlockerVideoMap[currSelected][1]); videocontainer.load(); videocontainer.play(); lastSelected = currSelected; }

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences