<?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 SANGEET MANGHNANI on Medium]]></title>
        <description><![CDATA[Stories by SANGEET MANGHNANI on Medium]]></description>
        <link>https://medium.com/@sangeet-manghnani?source=rss-a5224ae7353e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qgKREahOyQ7gDlQd.</url>
            <title>Stories by SANGEET MANGHNANI on Medium</title>
            <link>https://medium.com/@sangeet-manghnani?source=rss-a5224ae7353e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:54:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sangeet-manghnani/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[Time Travel with IBM COS Backup Vaults]]></title>
            <link>https://sangeet-manghnani.medium.com/time-travel-with-ibm-cos-backup-vaults-87395e595d66?source=rss-a5224ae7353e------2</link>
            <guid isPermaLink="false">https://medium.com/p/87395e595d66</guid>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[cloud-backup]]></category>
            <category><![CDATA[object-storage]]></category>
            <category><![CDATA[backup]]></category>
            <dc:creator><![CDATA[SANGEET MANGHNANI]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 12:45:33 GMT</pubDate>
            <atom:updated>2025-08-03T14:41:09.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-8BFkGJMYZJZkDpmfZVnSw.png" /><figcaption>Backup Vaults acted as saviour for <em>QuickDLVR</em></figcaption></figure><blockquote>A large logistics company, “<em>QuickDLVR</em>” prides itself on delivering millions of packages across continents — on time, every day. One Friday afternoon, a hacker slips ransomware into their operations, corrupting the very data that tells every truck, ship, and drone where to go. Suddenly, shipments are halted. Customer calls light up! No meeting Friday turns into a spree of 911 calls.</blockquote><blockquote>And just then, their operations manager remembers he had enabled Backup vaults for their IBM COS buckets where all the logistics data was stored. With just a few clicks, the IT team uses the backup vault’s <strong>point-in-time</strong> restore feature and is able to retrieve the data from the morning, just before the incident!</blockquote><p>More than the data, what was “lost” (not technically, because of the backups 🙂) was the <strong>Peace of Mind, </strong>and <em>peace is one of the costliest things you can buy. </em>One cyberattack, one accidental deletion, and that expensive ‘<strong>peace</strong>’ can vanish in seconds.</p><p>Today, we’ll talk about how IBM Cloud Object Storage offers a solution with their Backup Vaults to keep you calm, maintain your peace and yes — back your data up so that you can just sit back and relax.</p><h3>What is IBM COS and Backup Vaults… ?</h3><p><a href="https://www.ibm.com/products/cloud-object-storage">IBM Cloud Object Storage (COS)</a> is a highly durable and scalable object storage service used to safely hold vast amounts of data in the cloud. It’s designed to keep your data accessible, secure, and cost-effective — whether it’s hot, cool, or cold data. Backup vaults is an IBM COS feature that automatically &amp; continuously create secure, immutable backups of your buckets (Place where your data is stored). Vaults protect your data from accidental deletion, corruption or cyber attacks by providing point-in-time recovery, ensuring you always have <em>peace of mind</em>.</p><h3>How does the Backup Vault work ?</h3><p>Backup vaults store continuous snapshots of your data (from COS Buckets). Consider a storeroom, where you find it difficult to keep track of the last item you added/removed, so you click a picture and save it somewhere very secured. Whenever you feel there’s something missing from your store or someone just messed up your store, you just go and check the last snapshot (until right before that moment).</p><p>The only (<strong>KEY</strong>) difference with Backup vaults, is that these snapshots are automatic &amp; continuous, making sure no data slips no matter what!</p><h3>Excited enough to try it Quickly ?</h3><p>Just a few quick steps, and we’ll be ready with our first backup and recover it as well!</p><h4>1. Create a IBM Cloud Object Storage Instance.</h4><ul><li>Sign in to the <a href="https://cloud.ibm.com/catalog?category=storage#all_products">IBM Cloud console</a> and find “Object Storage” in the catalog.</li><li>Select a Standard plan and Click create ( You get 5 GB of free storage upto 12 months 😏)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*cE0-8vlK4ittWO1iYSXdhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q69QF-q1jKYW4QJOfCE6oQ.png" /><figcaption><strong>Creating a new instance of IBM Cloud Object Storage</strong></figcaption></figure><h4>2. Create a New Bucket &amp; Upload some data</h4><ul><li>Under your new instance, in the Buckets tab, Click Create Bucket, give it a unique name, choose your storage class (Smart), <strong>Enable versioning (<em>must have for backups</em>) </strong>and confirm.</li><li>That’s your digital storeroom — ready to hold all of your store data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*y6phYXHOzFK-bMauDY0CLw.gif" /><figcaption><strong>Create a bucket — Your storeroom!</strong></figcaption></figure><h4>3. Create a Vault for our storeroom’s snapshots</h4><ul><li>Navigate to the Backup Vaults tab in your instance, Click on create button.</li><li>Make sure to give a fancy name to your vault and toggle that <strong>authorise</strong> to ON (it gives the vault access to your buckets!)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*YajtsvERWQhEn4DOW_UBZA.gif" /><figcaption><strong>Create a fresh new Vault — Saviour for your tough times!</strong></figcaption></figure><h4>4. Add a policy — The wiring, Preparing your camera for snapshots!</h4><ul><li>Navigate to the Backup policies tab in your store (bucket) and Create a new Policy.</li><li>Select the Backup Vault we just created.</li><li>Set how long you want to keep each backup (the “retention” period).</li><li>Once you save, IBM COS starts continuously backing up every change from your bucket to the vault.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PBERDLJFEu2rhdfO2rAMTA.gif" /><figcaption><strong>Create a policy — Wire up your bucket to the safe vault.</strong></figcaption></figure><h4>5. Check out your recovery ranges — Your snapshot library!</h4><ul><li>Navigate to your Vault and check out the freshly created recovery range. IBM COS starts clicking pictures of your store (bucket) and storing in the vault (snapshot library) after your policy creation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcGJPbYCqW_samw2NxlteQ.png" /><figcaption><strong>Recovery ranges (List of Pictures of your storeroom)</strong></figcaption></figure><h4>6. The Great Time-Travel Unpacking: Restoring Your Storeroom’s Lost Treasures</h4><ul><li>Let’s click on Restore and set up the restore time.</li><li>Create a restore bucket — make sure to keep versioning enabled.</li><li>Voila! Head over to your target bucket and behold your storeroom’s latest snapshot — just like nothing ever went missing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDg_MwJwYtTULoULp3x0_A.png" /><figcaption><strong>Restoring recovery range — Turning the Magic Wand</strong></figcaption></figure><p>You just created yourself a rescue system! No more worrying about your data. <strong>Peace of mind is all yours</strong>! <br>If you have any questions or want to dive deeper, feel free to share them in the comments below. After all, a peaceful mind is always curious!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87395e595d66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two Sum Problem — Conquering it gradually!]]></title>
            <link>https://sangeet-manghnani.medium.com/two-sum-problem-conquering-it-gradually-225dc6d6a5f1?source=rss-a5224ae7353e------2</link>
            <guid isPermaLink="false">https://medium.com/p/225dc6d6a5f1</guid>
            <category><![CDATA[two-sum]]></category>
            <category><![CDATA[leetcode-easy]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[SANGEET MANGHNANI]]></dc:creator>
            <pubDate>Sun, 23 May 2021 12:01:47 GMT</pubDate>
            <atom:updated>2021-05-23T12:01:47.551Z</atom:updated>
            <content:encoded><![CDATA[<h3>Two Sum Problem — Conquering it gradually!</h3><p>Hello, Whether you’re a beginner to competitive coding or have freshly started giving interviews, you must have heard of/tried hands on this conventional programming problem called ‘Two Sum’ which simply says:</p><p><em>Given an array of integers, return indices of the two numbers such that they add up to the given target.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FRbDKaczqWovIugyJmW%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FRbDKaczqWovIugyJmW%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FRbDKaczqWovIugyJmW%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/abc43d31593bc939013de545eb5dd1e7/href">https://medium.com/media/abc43d31593bc939013de545eb5dd1e7/href</a></iframe><p><strong>Brute Force — First thought of your mind!</strong></p><p>Let us take the given example as</p><pre><strong>Input:</strong> nums = [2,7,11,15], target = 9<br><strong>Output:</strong> [0,1]</pre><p>The very first algorithm would be:</p><ol><li>Loop through the array.</li><li>Pick one item, store it in a variable.</li><li>Loop through the entire array and check if the sum equates to <em>target.</em></li></ol><p>Converting this to a simple javascript program will give us this:</p><pre>var twoSumBrute = function(nums, target) {<br>     for(let i=0; i&lt;nums.length; i++) {<br>         for(j=i+1;j&lt;nums.length; j++) {<br>             if(target - nums[i] === nums[j]) {<br>                 return [i,j];<br>             }<br>         }<br>     }<br>};</pre><p>Now, this is the very first thing that comes to your mind with just a little strain on your brain nerves! So, this can definitely be polished and made to shine 💠. Before that, let’s analyse this solution:</p><p>This solution simply loops over the array for each element of array(making it a loop inside a loop) and <strong>breaks as soon as it finds a solution</strong><em>(Making it bit optimised for a brute force)</em><strong>. </strong>For our sample input, this problem would work efficiently, and will have the solution in the second pass of the inner loop over <strong>j.</strong></p><p>However, had the input been something like this :</p><pre><strong>Input:</strong> nums = [11,15,7,2], target = 9</pre><p>which is simply the same array but shuffled a bit. It would take our solution to go through each element for each single pass(every <strong>j </strong>for every <strong><em>i</em></strong>). Hence, making the worst case (the example input right above) complexity <strong>O(n2)</strong>.</p><p>Thus, this definitely calls for an alternative solution, yet this brute force gives us a very important lesson!</p><p><strong><em>Try and avoid nested loops</em></strong>➿<strong><em> as much as possible!</em></strong></p><p>This solutions seems to please the memory and hence giving a good space complexity. However, not the best time complexity.</p><p><strong>NOTE : </strong>Avoid using Array.map / Array.forEach. You might end up struggling to break out of the loop!!➿</p><p><strong>Polished Solution — (one of) The best shot of your mind!</strong></p><p>Wait! Before you go further reading this, have a look at this hint if you haven’t seen it somewhere already. Spend some time on it. You may not then require to read the next parts to learn rather verify your solution 🔥!</p><pre>Hint: Taking up some extra space won&#39;t mind. Consider using a Map/Object and see if it can help you do wonders!</pre><p>Considering we can use up some more space and making the time complexity a little better (or far better than earlier 😎). Since we are considering Javascript as our language, Let’s see how we can use a simple object for a real powerful solution.</p><p>We’re going to loop through the array and check if the object has the entry (target-current element) and if not we just make an entry of the current array element into the object and every time looping over the elements, we repeat the same procedure, the moment we find an entry, we are at the solution.</p><p>Let’s algorithimise this:</p><ol><li>Create an empty object.</li><li>Loop over the array.</li><li>Check if object has the difference (target-current element), if not, then simply add current element.</li><li>If yes, you already have the solution!</li></ol><p>A javascript function for the same should go something like this:</p><pre>var twoSum = function(nums, target) {<br>    var trackOb = {};<br>    <br>    for(let i=0; i&lt;nums.length; i++) {<br>        let findNum = target-nums[i];<br>        if(trackOb[findNum] !== undefined) {<br>            return [trackOb[findNum], i];<br>        }<br>        <br>        trackOb[nums[i]] = i;<br>    }<br>}</pre><p>You must be wondering why do we store the index in the object rather simply use <strong>indexOf. </strong>Let me say this,</p><p>❎ <strong>AVOID USING indexOf !!!</strong></p><p>Let’s consider the input to be</p><pre><strong>Input:</strong> nums = [3,3], target = 6</pre><p>for this input if you use indexOf, it will always return the value as 0, hence making your solution [0,0]. However, the solution should be [0,1].</p><p><strong>IndexOf <em>always returns the very first index of the element, which in case of duplicated elements tend to result in bugs!</em></strong></p><p>Some of the gists of this enhanced solution are:</p><ol><li>This solution has the worst case ( <strong>Input:</strong> nums = [11,15,7,2], target = 9 ) complexity <strong>O(n)</strong>. Since, even in the worst case, it will loop till the last element just once. No nested loops!!🙅</li><li>Storing the index in the object is a very important step, as explained above. We will need to store the previously visited element indices in the object since we will have the current index when the solution is found. (Try the solution without storing the index and using indexOf to actually see the confusion it can create) 🤔.</li><li>You can alternatively use Javascript Maps too, by utilising Map.get() and Map.set() functions.</li></ol><p>So, what happened above is not less than a magic! Just a simple object ( yet powerful 💪) improved the time complexity to a great extent. BTW, here’s the performance of the above code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*osa7i0D4-VVPVMzmrLFm2g.png" /><figcaption>Better than 98.40%</figcaption></figure><p>Kudos, if you got it at the hint itself and made it. If not, thanks for reading till here, hope it helped clear a lot of things. This simple problem taught me some crucial things, hope it did to you too !</p><p>Do hit me up in comments, if something bugs you in this post!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=225dc6d6a5f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>