<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pranav sharma on Medium]]></title>
        <description><![CDATA[Stories by Pranav sharma on Medium]]></description>
        <link>https://medium.com/@pranav_71?source=rss-75a9b47ac946------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fVr2BcFOX_M9xvcb</url>
            <title>Stories by Pranav sharma on Medium</title>
            <link>https://medium.com/@pranav_71?source=rss-75a9b47ac946------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 13:41:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pranav_71/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SSL Certificates and How Do They Work?]]></title>
            <link>https://medium.com/@pranav_71/ssl-certificates-and-how-do-they-work-f052b651b54d?source=rss-75a9b47ac946------2</link>
            <guid isPermaLink="false">https://medium.com/p/f052b651b54d</guid>
            <category><![CDATA[for-begineers]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[client-server]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[http-request]]></category>
            <dc:creator><![CDATA[Pranav sharma]]></dc:creator>
            <pubDate>Sun, 25 Jan 2026 15:41:41 GMT</pubDate>
            <atom:updated>2026-01-25T15:41:41.267Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wondered what makes HTTPS more secure than HTTP?</p><p>HTTPS and HTTP are both transfer protocols used to communicate in a client–server architecture. In HTTPS, we use SSL certificates, which make it more secure than HTTP. Let’s understand how.</p><h4>Client–Server Basics</h4><p>Consider the client–server architecture.<br>The client sends a request to the server, and in return, the server sends back a response. That’s client–server architecture in layman’s terms.</p><p>Now, if I put a <strong>MITM (Man in the Middle) </strong>attacker in between, it can sniff both the request and the response, which makes the system very insecure.</p><p>Engineers started brainstorming how to solve this issue.</p><p><strong>Bob’s Encryption Idea </strong>(and Its Problem)</p><p>One engineer, let’s say Bob, came up with an idea:</p><p>“What if we encrypt the data sent to the server?”</p><p>Sounds good, right?<br>But then a question arises: How will the server decrypt the data?</p><p><strong>Bob suggested:</strong></p><p>“We’ll send the key to the server as well.”</p><p>But the problem remains the same.<br>If we send both the encrypted data and the key, the MITM attacker can sniff both. So the encryption becomes useless.</p><p><strong>Alice’s Public–Private Key Solution</strong></p><p>Now another engineer, Alice, came up with a better solution.</p><p>She suggested an architecture where both the client and server have two keys:</p><p>a public key</p><p>a private key</p><p>Public keys are used for encryption, and decryption is only possible using private keys.</p><p>Her idea was this:</p><p>The client requests the public key of the server</p><p>The client encrypts the data using that public key</p><p>The server decrypts the data using its private key</p><p>This sounds convincing — but it still has loopholes.</p><p>The <strong><em>MITM</em></strong> Problem Again</p><p>When the server sends its public key to the client, the MITM can act as a proxy and send its own public key instead.</p><p>What happens then?</p><p>The client encrypts the data using the hacker’s public key</p><p>The MITM intercepts the data</p><p>The MITM decrypts it using its private key</p><p>So this architecture can still be compromised.</p><p><em>So now what?</em></p><p>Everyone is confused, and then a young and smart man, <strong><em>Monkey D. Luffy</em></strong>, comes up with an idea:<br><strong><em>SSL Certificates</em></strong></p><p>In this architecture, we introduce a trusted third party that authorizes and creates certificates.</p><p>Let’s say the third party is GoDaddy.</p><p>GoDaddy also has:</p><p>its own<strong> public key</strong></p><p>its own <strong>private key</strong></p><p>Here’s what it does:</p><p>It creates a certificate</p><p>Inside the certificate:</p><p>it puts the domain name</p><p>it puts the server’s public key</p><p>Then it signs the certificate</p><p>The signature is created using:</p><p><strong><em>Server Public Key + GoDaddy’s Public Key</em></strong></p><p>This certificate is then given to the server.</p><p>How the SSL Process Works</p><p>Now let’s understand the full flow:</p><p>The client requests the server’s public key</p><p>The server sends:</p><p>its public key</p><p>its SSL certificate</p><p>The client sees that the certificate is authorized by GoDaddy</p><p>The client asks GoDaddy for its public key</p><p>The client verifies the certificate signature by combining:</p><p>the server’s public key</p><p>the authority’s public key</p><p>If the signature matches, the client knows:</p><p>the connection is secure</p><p>the server is authentic</p><p>And now secure communication can begin.</p><p>That’s what SSL certificates are in layman&#39;s term and how their architecture works.</p><p>Oh, and one more thing — <br>SSL stands for Secure Sockets Layer.</p><p>Thanks for reading.</p><p>References</p><p><a href="https://youtu.be/0yw-z6f7Mb4?si=p2c1SfZ7Y5O78-bE">https://youtu.be/0yw-z6f7Mb4?si=p2c1SfZ7Y5O78-bE</a></p><p><a href="https://www.cloudflare.com/en-in/learning/ssl/what-is-an-ssl-certificate/">https://www.cloudflare.com/en-in/learning/ssl/what-is-an-ssl-certificate/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f052b651b54d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Matrix Exponentiation Made Simple with Fibonacci]]></title>
            <link>https://medium.com/@pranav_71/matrix-exponentiation-made-simple-with-fibonacci-a766fc2aba63?source=rss-75a9b47ac946------2</link>
            <guid isPermaLink="false">https://medium.com/p/a766fc2aba63</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[fibonacci-sequence]]></category>
            <category><![CDATA[matrix-exponentiation]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[dynamic-programming]]></category>
            <dc:creator><![CDATA[Pranav sharma]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 14:52:50 GMT</pubDate>
            <atom:updated>2026-01-04T14:52:50.580Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*dknMjYBAJ85vrD_PCpvr9g.png" /></figure><p>When dealing with recurrence relations, especially in competitive programming, performance matters. Problems that seem simple at first — like computing the nth Fibonacci number — can quickly become inefficient when constraints grow large. This is where <strong>Matrix Exponentiation</strong> becomes a powerful tool.</p><p>Matrix exponentiation allows us to transform linear recurrences into matrix operations and compute results in logarithmic time. In this article, we explore how the Fibonacci recurrence can be optimized using matrix exponentiation, reducing the time complexity from linear to logarithmic.</p><h3>Matrix Exponentiation</h3><p>Matrix Exponentiation is a powerful optimization technique used to efficiently compute values of recurrence relations. One of the most common and important applications of this technique is the <strong>Fibonacci sequence</strong>.</p><h3>Fibonacci Recurrence Relation</h3><p>The Fibonacci sequence is defined by the recurrence:</p><p>F(n)=F(n−1)+F(n−2)</p><p>with the base cases:</p><p>F(0)=0,F(1)=1</p><p>Using a simple recursive or iterative approach, the time complexity to compute F(n) is <strong>O(n)</strong>, which becomes inefficient for large values of n.</p><p>Matrix exponentiation allows us to reduce this complexity to <strong>O(log n)</strong>.</p><h3>Converting the Recurrence into Matrix Form</h3><p>Now what we will do is we convert the linear recurrence relation into a matrix form</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*CBKyWLO1Clukb0IXDXC1vQ.png" /></figure><p>Now we need to find the M matrix and it will be 2x2 which will be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*LcZ0LEG0Zf0TdfJpRlUxKQ.png" /></figure><p>Now lets see how we come up with this matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*17XwAhe7_sjcnxGPpFGSDw.png" /></figure><p>Now in the other matrix we will put the base condition 1,0 and the overall equation will become:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*yKs0_qxkNQc8u0btNF_rvw.png" /></figure><p>Here to find M^n-1 we will use matrix exponentiation which is similar to binary exponentiation :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*SDBrGhYmt1wKiN-KWvtzzA.png" /></figure><p>Here is the pseudo code for finding the fibonacci of nth term:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*bjTqSUIbQDpxotUKiISpXA.png" /></figure><p>Matrix exponentiation is a highly effective technique for optimizing linear recurrence relations. By representing the recurrence in matrix form and applying fast exponentiation, we can compute results efficiently even for very large values of nnn.</p><p>The Fibonacci sequence serves as a classic example of how mathematical insight combined with algorithmic optimization can drastically improve performance. Understanding this approach not only helps in solving advanced problems but also builds a strong foundation for topics such as dynamic programming, linear recurrences, and algorithmic optimization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a766fc2aba63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coordinate Compression]]></title>
            <link>https://medium.com/@pranav_71/coordinate-compression-3427bc956336?source=rss-75a9b47ac946------2</link>
            <guid isPermaLink="false">https://medium.com/p/3427bc956336</guid>
            <category><![CDATA[coordinate-compression]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[fenwick-tree]]></category>
            <category><![CDATA[segment-tree]]></category>
            <category><![CDATA[sad]]></category>
            <dc:creator><![CDATA[Pranav sharma]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 16:06:33 GMT</pubDate>
            <atom:updated>2025-12-30T16:06:33.413Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s understand coordinate compression with a simple example.</p><p>Suppose we want to do <strong>array hashing</strong> of an array.<br>The typical algorithm looks something like this: we allocate a hash array of size equal to the maximum element in the array.</p><p>For example, if we have an array:</p><pre>[1, 2, 3, 4, 10]</pre><p>We would allocate a hash array of size 10 + 1 (i.e., arr[11]). This is usually fine.</p><p>But what if a[i] ≥ 1e9?<br>We <strong>cannot</strong> create an array of size 1e9 + 1.</p><p>Now, most of you might think: <em>we have </em><em>long long or </em><em>long long int, so why not use that?</em><br>Let’s understand why that doesn’t work.</p><p>If we create an array of size 1e9, it would require roughly <strong>4 GB of memory</strong>. In most competitive programming problems or online judges, the memory limit is around <strong>256 MB</strong>, so this approach is not feasible.</p><p>This is where <strong>Coordinate Compression</strong> comes in.</p><h3>How Coordinate Compression Works</h3><p>Let’s say:</p><ul><li>n &lt; 1e6</li><li>a[i] ≤ 1e9</li></ul><p>First, we <strong>sort the array</strong>, and then we <strong>map each element to its index</strong>.<br> In total, we would need at most 1e6 memory.</p><h3>Example</h3><p>Original array:</p><pre>[1, 6, 4, 4, 8, 9]</pre><p>Sorted array:</p><pre>[1, 4, 4, 6, 8, 9]</pre><p>Now, we map each unique element to an index:</p><pre>1 -&gt; 0  <br>4 -&gt; 1  <br>6 -&gt; 2  <br>8 -&gt; 3  <br>9 -&gt; 4</pre><p>After compression, the array becomes:</p><pre>[0, 1, 1, 2, 3, 4]</pre><h3>Why Do We Sort?</h3><p>We sort the array mainly to <strong>maintain relative order</strong>.</p><ul><li>If 10 &lt; 20, then the compressed value (rank) of 10 should be less than the compressed value of 20.</li><li>If we don’t sort and map elements randomly, this property would not hold.</li><li>Also, <strong>duplicate elements should have the same rank</strong>, not different ones. Sorting places all duplicates together, making this easy to handle.</li></ul><h3>Where Is Coordinate Compression Used?</h3><ol><li><strong>Range sum queries</strong> (Segment Tree / Fenwick Tree) when values are used as tree indices.</li><li><strong>Rectangle union problems</strong>, where continuous space is converted into discrete intervals.</li><li>Any scenario where <strong>relative order matters</strong> and <strong>memory limits are tight</strong>.</li></ol><p><strong>Reference:</strong> USACO Guide</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3427bc956336" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Really Happens When You Turn On Your Computer?]]></title>
            <link>https://medium.com/@pranav_71/what-really-happens-when-you-turn-on-your-computer-1deddbadfd28?source=rss-75a9b47ac946------2</link>
            <guid isPermaLink="false">https://medium.com/p/1deddbadfd28</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[bootloader]]></category>
            <dc:creator><![CDATA[Pranav sharma]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 18:59:46 GMT</pubDate>
            <atom:updated>2025-07-24T18:59:46.813Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s stop for a while and appreciate how beautiful technology is — from AI, LLMs, to your simple PCs and mobile phones.<br>You simply turn on your PC or mobile phone and see your login screen — looks simple, right?<br>Naah, it’s not that simple, but it’s not too complicated to understand either. Let’s break down what happens in those split seconds.</p><p>When you turn on your PC, electrical signals go to the hardware like the motherboard, hard drive, etc., and a firmware is initialized — the <em>BIOS (Basic Input/Output System).</em><br>Now, the first thing it does is <strong>POST (Power-On Self-Test)</strong>. It checks if all the hardware is working properly. If something’s wrong, it either displays an error message or makes beep sounds. These beeps are known as <em>POST beep codes.</em></p><p>After performing all the checks, the BIOS looks for the <strong>MBR (Master Boot Record).</strong> It’s a special boot sector located at the beginning of the disk.<br>This MBR contains a program that loads the operating system into the main memory — and that program is known as the<em> bootloader.</em></p><p>After all of this, the BIOS looks for a file — <em>/etc/inittab</em>. This file is used to determine the initial state of the operating system. It’s also known as the <em>runlevel</em>. Some of the common runlevels are:</p><p>Level 0: System Halt</p><p>Level 1: Single-user mode</p><p>Level 2: Full multi-user mode without networking</p><p>Level 3: Full multi-user mode with networking</p><p>Level 4: User-definable</p><p>Level 5: Full multi-user mode with networking and graphical display (X display manager)</p><p>Level 6: Reboot</p><p>This init system design is known as <strong>SysV (System V).</strong><br>Now, the init process will start various <em>daemons (programs that run in the background)</em>, and the most important daemon it starts is the <strong>X server daemon</strong>, which manages your display, keyboard, and mouse.<br>It’s because of this daemon that you see your login screen.</p><p>And all of this happens in a matter of split seconds — isn’t that beautiful?</p><p>Reference : <a href="https://www.geeksforgeeks.org/operating-systems/what-happens-when-we-turn-on-computer/">https://www.geeksforgeeks.org/operating-systems/what-happens-when-we-turn-on-computer/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1deddbadfd28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet Willow, quantum chip]]></title>
            <link>https://medium.com/@pranav_71/meet-willow-quantum-chip-a27797c82965?source=rss-75a9b47ac946------2</link>
            <guid isPermaLink="false">https://medium.com/p/a27797c82965</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[quantum-computer]]></category>
            <category><![CDATA[quantum-chip]]></category>
            <category><![CDATA[meet-willow]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pranav sharma]]></dc:creator>
            <pubDate>Fri, 13 Dec 2024 20:09:10 GMT</pubDate>
            <atom:updated>2024-12-13T20:09:10.726Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*Z7KcpxbCyXTKv7KZ2BswXg.jpeg" /></figure><p>Google had announced Willow, their latest quantum chip. Let’s understand why this is a big deal in quantum computing.<br>We know that in classical computing, we use bits to store information. Classical computers are fairly fast in solving a lot of problems, but they miserably fail to compute highly complex problems. Let’s say we need to simulate the behaviour of oxygen with carbon monoxide. To do this, modern computers would take months and years to solve, and to solve these kinds of complex problems, we are trying to shift from classical computing to quantum computing.<br>In quantum computing, we use qubits, i.e., quantum bits. What’s so special about this is that a qubit can hold 1 and 0 at the same time, which is called the superposition state in the quantum world.<br>Why is Willow such a big deal?<br>Willow is a big deal because it overcomes and outperforms across a number of metrics, but the two main challenges that it overcomes are:<br><strong>1.) Exponential Quantum Error Correction</strong>:<br>One of the greatest challenges in quantum computing is errors because qubits have the tendency to rapidly exchange information, which makes it difficult to protect the information that is needed. This means the more qubits you use, the more errors will occur.<br>Now, what Willow did is that it reduced the number of errors by half, which means the more qubits used in Willow, the more it reduces errors. This is an exponential reduction in the error rate. They called this ‘<strong>below threshold</strong>.’<br>2.) To measure Willow’s performance, Google’s team used the <strong>RCS (random circuit sampling) benchmark</strong>, and it’s the hardest benchmark that can be done on a quantum computer. The results were surprising: it performed a computation in under five minutes that would take <strong>10 septillion years</strong> for one of the fastest supercomputers.<br>You can imagine that the time taken by one of the fastest supercomputers exceeds the age of the universe, and on the other hand, a quantum chip is performing it in <strong>5 minutes</strong>. It’s freaking amazing!</p><p>I would recommend you to read their official blog post :<br><a href="https://lnkd.in/gynTh3sK"><em>Willow</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a27797c82965" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Master Sliding Window]]></title>
            <link>https://medium.com/@pranav_71/master-sliding-window-b0d561d642bf?source=rss-75a9b47ac946------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0d561d642bf</guid>
            <category><![CDATA[datastrucutre]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sliding-windows]]></category>
            <dc:creator><![CDATA[Pranav sharma]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 17:23:53 GMT</pubDate>
            <atom:updated>2024-07-04T17:23:53.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*pxLmZw7-nZ6AU3p2Q9WfMg.png" /></figure><p>Lets talk about one of the most useful and important techniques: the Sliding Window technique. Without wasting much time, let’s get straight to the point. First, let’s analyze where we can apply this technique. Whenever you see that you need to <strong>return the longest/shortest/maximum/minimum of a subarray or substring</strong>, remember that there is a difference between a subarray/substring and a subsequence. So, first, read the problem statement carefully.</p><p>There are two patterns of this technique:<br>1. <strong>Fixed-Sized Sliding Window</strong><br>2. <strong>Variable-Sized Sliding Window</strong></p><p>In the Fixed-Sized Sliding Window, you will have the exact size of the subarray/substring, and in the Variable-Sized Sliding Window, you will have to match a certain condition. Now, I am giving you a generalised template of both patterns, but remember, this is a constructive type of algorithm, so you need to mold it according to the question, and for that, you need to practice.</p><p>//<strong> Fixed-Sized Sliding Window</strong><br>l = 0, r = 0;<br>while (r &lt; size of the array) {<br> if (window size &gt; given size) {<br> // Do the calculation on the left pointer if needed<br> l++;<br> }<br> if (window size == given size) {<br> // Do your stuff as asked in the question<br> }<br> r++;<br>}</p><p>//<strong> Variable-Sized Sliding Window</strong><br>l = 0, r = 0;<br>while (r &lt; size of the array) {<br> while (condition not matched) {<br> // Shrink the window by moving the left pointer<br> }<br> if (condition matched) {<br> // Do your stuff as asked in the question<br> }<br> r++;<br>}<br><strong>Pro tip</strong>: Practice as much as you can.<br><strong>Disclaimer</strong>: I am not a pro, so if any pro reads this and finds I missed any point or wrote something wrong, feel free to comment down.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d561d642bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>