<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jaydeep Dave</title>
    <description>The latest articles on DEV Community by Jaydeep Dave (@dave3130).</description>
    <link>https://dev.to/dave3130</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F686044%2F68046237-6731-42dd-92a3-5c316381d2e5.jpeg</url>
      <title>DEV Community: Jaydeep Dave</title>
      <link>https://dev.to/dave3130</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dave3130"/>
    <language>en</language>
    <item>
      <title>Optimize Website Load Performance Using Preload, Prefetch &amp; Preconnect</title>
      <dc:creator>Jaydeep Dave</dc:creator>
      <pubDate>Sun, 04 Sep 2022 13:05:19 +0000</pubDate>
      <link>https://dev.to/dave3130/optimize-website-load-performance-using-preload-prefetch-preconnect-3h7g</link>
      <guid>https://dev.to/dave3130/optimize-website-load-performance-using-preload-prefetch-preconnect-3h7g</guid>
      <description>&lt;p&gt;To optimize web performance and user experience, critical assets must be loaded as quickly as possible.&lt;/p&gt;

&lt;p&gt;Modern web browsers use a variety of strategies and techniques to improve overall page performance, such as prioritizing the most important resources to be fetched and loaded.&lt;/p&gt;

&lt;p&gt;Here are some of the ways to achieve this:&lt;/p&gt;




&lt;h2&gt;
  
  
  DNS Prefetch
&lt;/h2&gt;

&lt;p&gt;DNS Prefetching enables the browser to carry out &lt;strong&gt;DNS Resolution&lt;/strong&gt; (determining the IP to contact) in the background without interrupting the user's experience of the current web page. It is typically used to reduce the time it takes to establish a connection because the browser will take care of the DNS lookup process beforehand. As a result, the user won't have to wait for the DNS lookup to complete when they click on external links or other resources that the page will later need, hence it reduces latency.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DNS Resolution is the process of converting hostname/domain name to its corresponding ip address which the computer understands to communicate.&lt;br&gt;
For eg: &lt;strong&gt;google.com&lt;/strong&gt; to &lt;strong&gt;216.58.215.78&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The browser is accountable for carrying out the DNS lookup procedure and discovers all resources on a web page that need a DNS lookup and must wait for the lookup to be finished before downloading/accessing anything. DNS lookups typically take between &lt;strong&gt;20&lt;/strong&gt; and &lt;strong&gt;120&lt;/strong&gt; milliseconds to complete.&lt;/p&gt;

&lt;p&gt;It is required to resolve domain lookup only once for a domain name and then the rest of the request for that domain can be carried out via that connection, but still, we can try to save this for the first time. Additionally, after &lt;strong&gt;3–4&lt;/strong&gt; attempts, the DNS may be cached (depending on the browser/system). However, for mobile users, the duration of the initial DNS lookup is crucial.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When we depend on numerous domains for different types of resources.&lt;/li&gt;
&lt;li&gt;When we know we will need a domain's resources but don't yet know the specific URL.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;Amazon resolves DNS-Lookup for its many resources domain on its home page using DNS-Prefetch, which it may load.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2A21EyRur8VmRke3sWB_3dSw.png" alt="Amazon Home Page-DNS Prefetch usage"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Amazon Home Page-DNS Prefetch usage&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;For loading external CSS, fonts, js, etc from some third-party domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For instance, while using Google Fonts on a website, must be loaded before the page is rendered. We can prefetch its domain in this way.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;meta http-equiv="x-dns-prefetch-control" content="on"&amp;gt;
&amp;lt;link rel="dns-prefetch" href="https://fonts.gstatic.com"&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;where,&lt;br&gt;
&lt;strong&gt;X-DNS-Prefetch-Control: on/off :&lt;/strong&gt; directs the browser whether or not to perform DNS Prefetch. Even when enabled, it will only work in browsers that support it.&lt;br&gt;
&lt;strong&gt;href :&lt;/strong&gt; refers to the domain name to be resolved, and it will work without a scheme as well, so &lt;a href="https://fonts.gstatic.com" rel="noopener noreferrer"&gt;https://fonts.gstatic.com&lt;/a&gt; and &lt;a href="https://fonts.gstatic.com" rel="noopener noreferrer"&gt;https://fonts.gstatic.com&lt;/a&gt; both would work.&lt;/p&gt;

&lt;p&gt;To check where DNS-prefetch is supported: &lt;a href="https://caniuse.com/link-rel-dns-prefetch" rel="noopener noreferrer"&gt;https://caniuse.com/link-rel-dns-prefetch&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Preconnect
&lt;/h2&gt;

&lt;p&gt;To establish a connection with a domain name, the browser follows these three important time-consuming steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;DNS lookup&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP handshake&lt;/strong&gt; (Initial Connection)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS negotiation&lt;/strong&gt; (on secure websites i.e. &lt;strong&gt;HTTPS&lt;/strong&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AOmGw9MmllcjPqq4UeQmDzA.png" alt="Time taken by Domain Name Resolution steps"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Time taken by Domain Name Resolution steps&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;While, we saw during DNS-prefetch that it only takes care of DNS-lookup, on the other hand, Preconnect resolves all &lt;strong&gt;three steps&lt;/strong&gt; in advance and reduces round-trip latency.&lt;/p&gt;

&lt;p&gt;Setting up a Preconnect connection and having it open for too long increases network competition and costs for both the client and the server side. So it's recommended to connect no more than &lt;strong&gt;4–6&lt;/strong&gt; connections.&lt;/p&gt;

&lt;p&gt;You can preconnect a webpage, using the following code&lt;br&gt;
&lt;code&gt;&amp;lt;link rel="preconnect" href="//example.com"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;Google uses preconnect to resolve domains beforehand from where it has to load scripts, CSS, js &amp;amp; fonts&lt;br&gt;
&lt;code&gt;&amp;lt;link rel="preconnect" href="https://www.gstatic.com"&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;link rel="preconnect" href="https://ssl.gstatic.com"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Where DNS-Prefetch can be used over Preconnect ?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To support some old browsers where only DNS-Prefetch is supported there it can be used as a fallback to Preconnect&lt;/li&gt;
&lt;li&gt;Since it is advised to connect only 4–6 domains via Preconnect but still if we want to connect more resources then we can use DNS-Prefetch to speed up third-party domains.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Preload
&lt;/h2&gt;

&lt;p&gt;Preload fetches the resources required for the current navigation without blocking the window's on-load event. Basically, using this resource hint, we can tell the browser to request the content before the browser has determined it needs to make the request. As a result, the resource is already available when the browser eventually realizes it needs to access one of the preloaded resources and thereby, improving the performance.&lt;/p&gt;

&lt;p&gt;Preload is useful to load resources that are referenced by other resources like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fonts that are referenced within a CSS file&lt;/li&gt;
&lt;li&gt;Critical resources that JavaScript dynamically loads&lt;/li&gt;
&lt;li&gt;Images or content that appear only after an API call has been made&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;Meesho, an e-commerce website uses preload to proactively fetch fonts and images that the browser would have known about only after downloading and parsing style.css and HTML content.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;link rel="preload" as="style" href="https://static-assets.meesho.com/css/mier-fonts.css?display=swap"&amp;gt;
&amp;lt;link rel="preload" as="image" fetchpriority="high" href="https://images.meesho.com/images/products/157167814/u2gkw_400.jpg"&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h3&gt;
  
  
  References:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.dareboost.com/en/2020/05/preload-prefetch-preconnect-resource-hints/" rel="noopener noreferrer"&gt;https://blog.dareboost.com/en/2020/05/preload-prefetch-preconnect-resource-hints/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.keycdn.com/blog/resource-hints" rel="noopener noreferrer"&gt;https://www.keycdn.com/blog/resource-hints&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.splunk.com/en_us/blog/learn/preload-resource-hints.html#:~:text=A%20preload%20is%20a%20resource,preloaded%2C%20it%20is%20already%20there." rel="noopener noreferrer"&gt;https://www.splunk.com/en_us/blog/learn/preload-resource-hints.html#:~:text=A%20preload%20is%20a%20resource,preloaded%2C%20it%20is%20already%20there.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>browseroptimizations</category>
      <category>prefetch</category>
      <category>preconnect</category>
      <category>preload</category>
    </item>
    <item>
      <title>Golang Html tokenizer</title>
      <dc:creator>Jaydeep Dave</dc:creator>
      <pubDate>Sat, 18 Jun 2022 16:26:18 +0000</pubDate>
      <link>https://dev.to/dave3130/golang-html-tokenizer-5fh7</link>
      <guid>https://dev.to/dave3130/golang-html-tokenizer-5fh7</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbo08w1gf2s7e4syw4c6u.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbo08w1gf2s7e4syw4c6u.jpg" alt="Photo by &amp;lt;a href=" width="640" height="427"&gt;&lt;/a&gt;Mohammad Rahmani on &lt;a href="https://unsplash.com/s/photos/html?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;"/&amp;gt;&lt;/p&gt;

&lt;p&gt;Looking for parsing &amp;amp; extracting HTML content in golang as we can simply do in PHP or Js by creating a new dom document. In golang, there are multiple ways to do it by using different packages based on your requirements. Some of the ways I found out are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/r/?url=https%3A%2F%2Fpkg.go.dev%2Fgolang.org%2Fx%2Fnet%2Fhtml" rel="noopener noreferrer"&gt;gohtml&lt;/a&gt;:&lt;/strong&gt; gohtml is an HTML5 tokenizer and parser implementation. It returns nodes after parsing, and then the elements can be extracted by various attributes such as tag type, tag name, attr, and text data using a tokenizer concept.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/r/?url=https%3A%2F%2Fpkg.go.dev%2Fgithub.com%2FPuerkitoBio%2Fgoquery" rel="noopener noreferrer"&gt;goquery&lt;/a&gt;:&lt;/strong&gt; goquery is built on the &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fpkg.go.dev%2Fgolang.org%2Fx%2Fnet%2Fhtml" rel="noopener noreferrer"&gt;gohtml&lt;/a&gt; package and the CSS Selector library &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fpkg.go.dev%2Fgithub.com%2Fandybalholm%2Fcascadia" rel="noopener noreferrer"&gt;Cascadia&lt;/a&gt;, giving it more power over content selection and extraction. It has a similar syntax as jquery. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/r/?url=https%3A%2F%2Fpkg.go.dev%2Fgithub.com%2Fsiongui%2Fgodom" rel="noopener noreferrer"&gt;godom&lt;/a&gt;:&lt;/strong&gt; godom is a library that allows you to manipulate the DOM in Golang similar to javascript. It compiles Go code to JavaScript using &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fpkg.go.dev%2Fgithub.com%2Fgopherjs%2Fgopherjs%2Fjs" rel="noopener noreferrer"&gt;GopherJS&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For now, I will use &lt;strong&gt;gohtml&lt;/strong&gt; for the demonstration purpose, to use tokenization.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tokenization is the lexical analysis, parsing the input into tokens. Among HTML tokens are start tags, end tags, attribute names and attribute values.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tokenizing the document is the first step in parsing it into a tree of element and text nodes, similar to the DOM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of HTML Tokens Supported:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;html.StartTagToken&lt;/code&gt;: a start tag such as &lt;a&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;html.EndTagToken&lt;/code&gt;: an end tag such as &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;html.SelfClosingTagToken&lt;/code&gt;: a self-closing tag such as &lt;code&gt;&amp;lt;img .../&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;html.TextToken&lt;/code&gt;: text content within a tag&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;html.CommentToken&lt;/code&gt;: an HTML comment such as &amp;lt;!-- comment --&amp;gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;html.DoctypeToken&lt;/code&gt;: a document type declaration such as &amp;lt;!DOCTYPE html&amp;gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main
import (
 "fmt"
 "strings"
 "io"
 "golang.org/x/net/html"
)
func main() {
 tokenizer := html.NewTokenizer(strings.NewReader(sampleHtml))
 for {
  tokenType := tokenizer.Next()
  token := tokenizer.Token()
  if tokenType == html.ErrorToken {
   if tokenizer.Err() == io.EOF {
    return
   }
   fmt.Printf("Error: %v", tokenizer.Err())
   return
  }
  fmt.Printf("Token: %v\n", html.UnescapeString(token.String()))
 }
}
const sampleHtml = `&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt; body {background-color: powderblue;} h1 {color: red;} p {color: orange;}&amp;lt;/style&amp;gt;&amp;lt;title&amp;gt;Sample HTML Code&amp;lt;/title&amp;gt;&amp;lt;script src="my-script.js"&amp;gt;abc&amp;lt;/script&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Main title&amp;lt;/h1&amp;gt;&amp;lt;p id="demo"&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;a href="https://dev.to/"&amp;gt;Dev Community&amp;lt;/a&amp;gt;&amp;lt;script&amp;gt;document.getElementById("demo").innerHTML = "Hello JavaScript!";&amp;lt;/script&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;`

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Token: &amp;lt;!DOCTYPE html&amp;gt;
Token: &amp;lt;html&amp;gt;
Token: &amp;lt;head&amp;gt;
Token: &amp;lt;style&amp;gt;
Token:  body {background-color: powderblue;} h1 {color: red;} p {color: orange;}
Token: &amp;lt;/style&amp;gt;
Token: &amp;lt;title&amp;gt;
Token: Sample HTML Code
Token: &amp;lt;/title&amp;gt;
Token: &amp;lt;script src="my-script.js"&amp;gt;
Token: abc
Token: &amp;lt;/script&amp;gt;
Token: &amp;lt;/head&amp;gt;
Token: &amp;lt;body&amp;gt;
Token: &amp;lt;h1&amp;gt;
Token: Main title
Token: &amp;lt;/h1&amp;gt;
Token: &amp;lt;p id="demo"&amp;gt;
Token: &amp;lt;/p&amp;gt;
Token: &amp;lt;a href="https://dev.to/"&amp;gt;
Token: Dev Community
Token: &amp;lt;/a&amp;gt;
Token: &amp;lt;script&amp;gt;
Token: document.getElementById("demo").innerHTML = "Hello JavaScript!";
Token: &amp;lt;/script&amp;gt;
Token: &amp;lt;/body&amp;gt;
Token: &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, I had just simply checked for Error Token or EOF and printed all the token types as it is.&lt;/p&gt;

&lt;p&gt;We can also parse HTML based on the Token such as &lt;code&gt;html.StartTagToken&lt;/code&gt;, &lt;code&gt;html.EndTagToken&lt;/code&gt;, etc as mentioned above.&lt;/p&gt;

&lt;p&gt;Also, on the element type such as html, h1, script, style, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tokenizer := html.NewTokenizer(strings.NewReader(sampleHtml))
 for {
  tokenType := tokenizer.Next()
  token := tokenizer.Token()
  if tokenType == html.ErrorToken {
   if tokenizer.Err() == io.EOF {
    return
   }
   fmt.Printf("Error: %v", tokenizer.Err())
   return
  }
  switch token.Data {
  case "script":
   fmt.Printf("Script Token: %v\n", html.UnescapeString(token.String()))
  case "style":
   fmt.Printf("Style Token: %v\n", html.UnescapeString(token.String()))
  default: //This will also include contents of &amp;lt;script&amp;gt;, &amp;lt;style&amp;gt; tags content
   fmt.Printf("Others: %v\n", html.UnescapeString(token.String()))
  }
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Reference
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pkg.go.dev/golang.org/x/net/html" rel="noopener noreferrer"&gt;https://pkg.go.dev/golang.org/x/net/html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://drstearns.github.io/tutorials/tokenizing/" rel="noopener noreferrer"&gt;https://drstearns.github.io/tutorials/tokenizing/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>tokenizer</category>
      <category>html</category>
      <category>parser</category>
    </item>
    <item>
      <title>My Interview Experience at Media.net</title>
      <dc:creator>Jaydeep Dave</dc:creator>
      <pubDate>Sat, 14 Aug 2021 11:08:49 +0000</pubDate>
      <link>https://dev.to/dave3130/my-interview-experience-at-media-net-emh</link>
      <guid>https://dev.to/dave3130/my-interview-experience-at-media-net-emh</guid>
      <description>&lt;p&gt;Media.net came to our campus in late June 2021 to interview for the position of Associate Web Application Developer. There were three rounds in total. Approximately 60 students filled the form, and only two of them got the offer letter.&lt;/p&gt;

&lt;p&gt;The entire process was online and took approximately 2-3 weeks. I’m going to share my interview experience here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3a68ecpyqf3y62l4z6v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3a68ecpyqf3y62l4z6v.jpg" alt="alt-text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round 1(Online MCQ Round):&lt;/strong&gt; This round was an online Assessment on the Interviewbit Platform for 1 hr and there were a total of 50 MCQ questions. So we have to solve 50 questions in 60 mins.&lt;/p&gt;

&lt;h5&gt;
  
  
  It was basically a mixture of various topics.
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;There were questions from Quants, Logical Reasoning, DSA, Time complexity, Guessing the o/p, Memory, OS, CN, DBMS.&lt;/li&gt;
&lt;li&gt;I was able to answer 40-42 questions in the given timeframe, and the questions were mostly Easy-Medium Level.&lt;/li&gt;
&lt;li&gt;On the next day, we got the result, and out of 60 students, 8 of them cleared this round.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Round 2(Technical Interview 1)&lt;/strong&gt;: This round lasted about an hour and was held on Google Meet. In this round, we were given three DSA questions (generally easy, medium, and hard) and we had to explain the entire solution approach and write the pseudocode in google docs shared with us.&lt;/p&gt;

&lt;p&gt;We first started with a basic introduction.&lt;/p&gt;

&lt;p&gt;Arrange given numbers to form the biggest number.&lt;br&gt;
Eg: Input: { 66, 56, 9, 7, 10, 660 }&lt;br&gt;
    Output: 97666605610&lt;br&gt;
Link: &lt;a href="https://www.geeksforgeeks.org/given-an-array-of-numbers-arrange-the-numbers-to-form-the-biggest-number/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/given-an-array-of-numbers-arrange-the-numbers-to-form-the-biggest-number/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Given an array of n elements return the count of elements which has a count of set bits to be 1.&lt;br&gt;
Eg: Input: {2, 6, 8, 10, 12}&lt;br&gt;
    Output: 2 &lt;br&gt;
Create a deep copy of LinkedList with random pointers.&lt;br&gt;
Link: &lt;a href="https://www.geeksforgeeks.org/clone-linked-list-next-arbit-pointer-set-2/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/clone-linked-list-next-arbit-pointer-set-2/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Later we had some discussion about work culture and Tech Stack that I will get to work on. &lt;/p&gt;

&lt;p&gt;After a week, I got the call from HR that I had cleared this round. (Only 2 out of 8 cleared this round)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round 3 (Technical Interview 2)&lt;/strong&gt;: This round was also conducted on google meet and lasted for an hour. The interviewer gave his intro and we started with the coding problem.&lt;/p&gt;

&lt;p&gt;Given the seating arrangement of a compartment, complete the below functions:&lt;/p&gt;

&lt;p&gt;//static boolean isWindowSeat( int seatNo){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// return whether the given seat no. is window seat or not
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
static int seatRowNo( int seatNo){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// return the row no. (starting from 1,2,3,…..) to which seat belongs 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;static int nearestWindowSeat( int seatNo){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// return the nearest window seat of the given seat no.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Design a Database System for URL Shortener, with the following constraints:&lt;br&gt;
Only authorized users can use the service.&lt;br&gt;
URL link should be expired after 48 hours.&lt;br&gt;
Users can edit the URL link.&lt;br&gt;
After that, I was asked: &lt;/p&gt;

&lt;p&gt;Write an SQL query for searching the existing URL in the table.&lt;br&gt;
How can we search faster in the table ? (Ans: Indexing)&lt;br&gt;
What is Indexing in DBMS and its working?&lt;br&gt;
Since, I mentioned Javascript and Reactjs in my resume. So, the next question was:&lt;br&gt;
Using Javascript, write a filter function that will filter the odd no.&lt;/p&gt;

&lt;p&gt;Eg: Input: {1, 2, 3, 4, 5}&lt;/p&gt;

&lt;p&gt;Output: {2, 4} &lt;/p&gt;

&lt;p&gt;Later we had a discussion about the job role and the difference between SDE and the current job profile and so on. The next day, I was informed by HR that I was selected and discussed further process. &lt;/p&gt;

&lt;p&gt;All the interviewers were very polite and supportive. They will guide you but you should be very attentive during the interview and ask out if you have any queries or you are stuck in between.  Also, clarify the problem statement and constraints well. &lt;/p&gt;

</description>
      <category>career</category>
      <category>interview</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
