Skip to main content

Posts

Showing posts with the label Web development

Go error: go : go.mod file not found in current directory or any parent directory; (working on GOPATH/src)

As of Go 1.16, the   GO111MODULE   environment variable is treated as "on" by default, meaning Go expects to find a   go.mod   file, and no longer falls back to pre-module   GOPATH   behavior. If you want to go back to the pre-1.16 behavior, you now have to explicitly specify  GO111MODULE=auto , but you're far better off creating a  go.mod  file. See  https://golang.org/doc/go1.16#go-command  and  https://golang.org/ref/mod Source - https://stackoverflow.com/questions/67929883/go-error-go-go-mod-file-not-found-in-current-directory-or-any-parent-director 

𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 𝐆𝐨𝐥𝐝𝐦𝐢𝐧𝐞 ❤️️

 System Design rounds are an important part of the Software Engineering interview process because they test a candidate's ability to design and implement large-scale systems. Here is the list of some amazing resource on System Design - ✅ Things you must know in System Design 👉System design basics: https://bit.ly/3SuUR0Y 👉Horizontal and vertical scaling: https://bit.ly/3slq5xh 👉 Load balancing and Message queues: https://bit.ly/3sp0FP4 👉High-level design and low-level design, Consistent Hashing, Monolithic and Microservices architecture: https://bit.ly/3DnEfEm 👉 Caching, Indexing, Proxies: https://bit.ly/3SvyVDc 👉 Networking, How Browsers work, Content Network Delivery ( CDN): https://bit.ly/3TOHQRb 👉 Database Sharding, CAP Theorem, Database schema Design: https://bit.ly/3CZtfLN 👉 Concurrency, API, Components + OOP + Abstraction : https://bit.ly/3sqQrhj 👉 Estimation and Planning, Performance: https://bit.ly/3z9dSPN 👉 Map Reduce, Patterns, and Microservices: https://bit.ly/...

API architectural styles

The following image displays the most common architectural styles for APIs. 🔹 1. REST REST, which was proposed in 2000, is the most widely used style for APIs. It is often utilized between front-end clients and back-end services, and it adheres to six architectural constraints. The payload format may be JSON, XML, HTML, or plain text. 🔹 2. GraphQL Meta proposed GraphQL in 2015. It provides a schema and type system that is ideal for complicated systems where entities' relationships are graph-like. In the diagram below, GraphQL can retrieve user and order information in one call, while REST necessitates multiple calls. GraphQL does not replace REST but can be built upon existing REST services. 🔹 3. Web socket Web socket is a protocol that enables full-duplex communications over TCP. Clients create web sockets to receive real-time updates from back-end services. Unlike REST, which always "pulls" data, web socket allows data to be "pushed". 🔹 4. Webhook Webhook...

From UX perspective is it good to show all prerequisite checks in a single screen or split them into multiple screens?

From a UX perspective, it's generally best to split prerequisite checks into multiple screens if they are numerous or complex, especially if they require user input or interaction. When multiple prerequisite checks are displayed on a single screen, it can be overwhelming for the user, and it may be difficult to understand which checks have been completed and which ones are outstanding. This can lead to confusion, frustration, and errors. Splitting the prerequisite checks into multiple screens can make the process more manageable for the user. Each screen can focus on a specific task or set of tasks, with clear instructions and feedback on completion. This can help the user feel more in control of the process and less overwhelmed by the overall number of prerequisite checks. However, if the prerequisite checks are simple and can be completed quickly, it may be appropriate to display them all on a single screen, provided they are clearly organized and easy to understand. In this case...

Type or Category or Classification of Design Patterns

 Type or Category or Classification of Design Patterns Creational   Based on the concept of creating an object.     Class       Factory Method This makes an instance of several derived classes based on interfaced data or events.     Object       Abstract Factory Creates an instance of several families of classes without detailing concrete classes.       Builder Separates object construction from its representation, always creates the same type of object.       Prototype A fully initialized instance used for copying or cloning.       Singleton A class with only a single instance with global access points.                    Structural   Based on the idea of building blocks of objects.     Class   ...

Difference between webstorage, cookie, local storage & session storage

WebStorage The Window object implements the WindowLocalStorage and WindowSessionStorage objects which has localStorage(window.localStorage) and sessionStorage(window.sessionStorage) properties respectively. These properties create an instance of the Storage object, through which data items can be set, retrieved and removed for a specific domain and storage type (session or local). For example, you can read and write on local storage objects as below localStorage.setItem('logo', document.getElementById('logo').value); localStorage.getItem('logo'); What are the differences between cookie, local storage and session storage Below are some of the differences between cookie, local storage and session storage, Feature Cookie Local storage Session storage Accessed on client or server side Both server-side & client-side client-side only client-side only Lifetime As configured using Expires option until deleted until tab is closed SSL support Supported Not supported N...

Cannot call a javascript function from HTML file in codesandbox.io. ??!!!

I was a bit surprised to see that you cannot reference a javascript function using a Vanilla sandbox using codesandbox.io site. Upon googling a bit here is what I found:   https://github.com/codesandbox/codesandbox-client/issues/1502   Here is the working sandbox where we can call a javascript function from an HTML file. https://codesandbox.io/s/sleepy-sunset-w0wds?file=/src/index.js Here is the explanation provided by the codesandbox.io folks on it: k, so the explanation is that in the vanilla template / parcel environment we're doing module bundling, handling src/index.js as a module. Because modules are evaluated in their own (private) scope, if you want to access from html something inside the module, you can put it on the browser's global scope, which is window. Alternatively, you can use the static template / environment, where we don't do any bundling, like https://codesandbox.io/s/quirky-flower-rm20y (but then you lose the ability to require / import).

Some useful terminologies related to rendering on the web

  Rendering SSR:  Server-Side Rendering - rendering a client-side or universal app to HTML on the server. CSR:  Client-Side Rendering - rendering an app in a browser, generally using the DOM. Rehydration:  “booting up” JavaScript views on the client such that they reuse the server-rendered HTML’s DOM tree and data. Prerendering:  running a client-side application at build time to capture its initial state as static HTML. Performance TTFB:  Time to First Byte - seen as the time between clicking a link and the first bit of content coming in. FP:  First Paint - the first time any pixel gets becomes visible to the user. FCP:  First Contentful Paint - the time when requested content (article body, etc) becomes visible. TTI:  Time To Interactive - the time at which a page becomes interactive (events wired up, etc). Reference: developers.google.com