Prepin
Log in

How would you approach the design and architecture of a web browser if the internet was intermittently unavailable 50% of the time?

Approach / Explanation

This question requires you to apply your expertise in web application design and your comprehension of network reliability to devise a solution for a scenario with an unreliable network. It highlights that the internet is unavailable 50% of the time. Consequently, you must think about how to sustain functionality during prolonged outages and manage the recovery process once the connection is restored. Important aspects to consider include offline capabilities, data storage, synchronization, and user alerts regarding the connectivity status.

Suggested Answer

Creating a design for an internet connection that is occasionally available necessitates a well-planned strategy to ensure a positive user experience. To begin with, the browser should incorporate an offline mode . This mode involves saving essential application data, such as website information and user status, locally whenever internet access is available. This can be implemented using contemporary web technologies like localStorage, IndexedDB, and Service Workers to cache content from the internet. Next, it’s important to develop a data synchronization plan that guarantees offline activities are synced without data loss or conflicts once internet access is restored. This may involve implementing a conflict resolution algorithm in the browser to handle asynchronous updates. Additionally, the application should include User Notifiers . The browser ought to effectively inform users when they are offline and when it is attempting to sync data. It should also alert them when certain pages might not load completely due to being in offline mode. Finally, establish a resilient request system that attempts to retry requests that fail due to network unavailability once a connection is detected. Requests can be queued for a designated period until network connectivity is reestablished.

Alternative Answer

As the internet will experience periodic outages, we must create a browser that offers a satisfactory offline browsing experience. To start, the browser should utilize a service worker . This script operates in the background, independent of the web page, enabling features that do not require direct user interaction or a web page. A prime example is offline-first web applications, which allow the service worker to cache responses from server requests, enabling access to these responses from the cache while offline. Next, we can implement IndexedDB for storing structured data, including files and blobs. It functions as a transactional database system, meaning that a sequence of operations can be executed under an 'all or nothing' principle. Thus, if an error occurs during any operation, none of the changes will be applied. In addition, the Background Sync API can be utilized for tasks that need to be completed later, ensuring they finish even if the user goes offline or leaves the page. It is essential to inform users when they are offline or when the browser is using offline data. This communication with users enhances their experience in these challenging situations. Lastly, not every website can be made available offline. Therefore, it is important to find a balance between the data stored locally and updates from the internet. One approach could be to let users choose which websites they want to access during offline periods.

Question Details

Difficulty & Category

Medium
technical

Companies

Better.com

Product

For CandidatesFor RecruitersCompaniesBrowse JobsInterview QuestionsDeep ProfileSkill AssessmentOpportunity Matching
Prepin.ai

© 2026 Prepin LLC · Philadelphia, PA · All rights reserved.