<?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: kevinrawal</title>
    <description>The latest articles on DEV Community by kevinrawal (@kevinrawal).</description>
    <link>https://dev.to/kevinrawal</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%2F1199786%2Fcb9e7b28-3373-4786-867e-464931f3ac4d.jpg</url>
      <title>DEV Community: kevinrawal</title>
      <link>https://dev.to/kevinrawal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kevinrawal"/>
    <language>en</language>
    <item>
      <title>Daily Dev Challenges - Day 01 🚀</title>
      <dc:creator>kevinrawal</dc:creator>
      <pubDate>Sat, 01 Nov 2025 12:36:02 +0000</pubDate>
      <link>https://dev.to/kevinrawal/daily-dev-challenges-day-01-5fl6</link>
      <guid>https://dev.to/kevinrawal/daily-dev-challenges-day-01-5fl6</guid>
      <description>&lt;h2&gt;
  
  
  Day 1 — In-Memory Cache with TTL
&lt;/h2&gt;

&lt;p&gt;I’ve started a &lt;strong&gt;daily challenge&lt;/strong&gt; to improve my skills as a developer.&lt;br&gt;&lt;br&gt;
Today marks &lt;strong&gt;Day 1&lt;/strong&gt; of the challenge, where I worked on implementing an &lt;strong&gt;In-Memory Cache with TTL&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;You can check out my solution here:&lt;br&gt;&lt;br&gt;
🔗 &lt;a href="https://github.com/kevinrawal/daily-dev-challenges/tree/099eff8a8d84037e8e6471331ea37e13757476e6/challenges/001-in-memory-cache-ttl" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  🧠 What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Singleton classes
&lt;/li&gt;
&lt;li&gt;Thread-safe execution
&lt;/li&gt;
&lt;li&gt;LRU cache design
&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;OrderedDict&lt;/code&gt; in Python
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A solid start to this learning journey — excited for what’s next! 💪  &lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>algorithms</category>
      <category>showdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Master Git with Interactive Learning Platforms! 🚀</title>
      <dc:creator>kevinrawal</dc:creator>
      <pubDate>Sat, 06 Jan 2024 04:29:58 +0000</pubDate>
      <link>https://dev.to/kevinrawal/master-git-with-interactive-learning-platforms-4ohk</link>
      <guid>https://dev.to/kevinrawal/master-git-with-interactive-learning-platforms-4ohk</guid>
      <description>&lt;p&gt;Hey folks,&lt;/p&gt;

&lt;p&gt;Are you looking to level up your Git version control skills? We've got you covered! Here are two awesome online platforms that offer interactive and engaging ways to enhance your Git proficiency:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LearnGitBranching:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://learngitbranching.js.org/"&gt;LearnGitBranching&lt;/a&gt; is an interactive and visually appealing tool that allows you to practice Git branching, merging, rebasing, and more. Whether you're a beginner or looking to refine your skills, this platform provides an intuitive way to understand and experiment with Git commands. It's a great resource to solidify your understanding of Git workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git Exercises:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://gitexercises.fracz.com/"&gt;Git Exercises&lt;/a&gt; is another excellent platform to enhance your Git proficiency. With various exercises and challenges, it covers a wide range of Git concepts and scenarios. The hands-on nature of these exercises makes it a valuable resource for individual learners and teams aiming to improve their version control practices.&lt;/p&gt;

&lt;p&gt;By actively engaging with these platforms, you can gain practical experience and boost your confidence in using Git effectively. Whether you're a developer, student, or simply curious about version control, these resources cater to various skill levels.&lt;/p&gt;

&lt;p&gt;do share other helpful resources in the comments.&lt;br&gt;
Happy coding! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>TLE Tales: When Unordered_map Bites You</title>
      <dc:creator>kevinrawal</dc:creator>
      <pubDate>Fri, 29 Dec 2023 14:58:05 +0000</pubDate>
      <link>https://dev.to/kevinrawal/tle-tales-when-unorderedmap-bites-you-5h7c</link>
      <guid>https://dev.to/kevinrawal/tle-tales-when-unorderedmap-bites-you-5h7c</guid>
      <description>&lt;p&gt;Hey, fellow devs👋!&lt;/p&gt;

&lt;p&gt;I just tackled a &lt;a href="https://codeforces.com/contest/1915/problem/E"&gt;problem&lt;/a&gt; that taught me a valuable lesson about time complexity: always consider the worst-case scenario, even when average-case performance seems good ⚠️.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Here's the gist:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem: Find a subarray with a sum of zero.&lt;/li&gt;
&lt;li&gt;Constraints

&lt;ul&gt;
&lt;li&gt;Array size: 1 to 2*10^5&lt;/li&gt;
&lt;li&gt;Element range: 1 to 10^9&lt;/li&gt;
&lt;li&gt;Total sum of elements: ≤ 2*10^5&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;My initial approach:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used unordered_map to store sums for efficient lookup.&lt;/li&gt;
&lt;li&gt;Average-case time complexity: O(1) ✨&lt;/li&gt;
&lt;li&gt;Worst-case time complexity of entire code: O(n) (this led to the TLE)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The TLE surprise:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Got a Time Limit Exceeded (TLE) verdict, specifically during lookup operations in the unordered_map.&lt;/li&gt;
&lt;li&gt;Why? The worst-case lookup time in unordered_map can be linear O(n), so with the given constraint worst-case complexity of the program becomes O(n^2).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The solution:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switched to map (ordered_map with worst-case complexity O(log n)):

&lt;ul&gt;
&lt;li&gt;Now Worst-case time complexity of my code become: O(nlogn), O(n) to traverse the array and O(long) for lookup.&lt;/li&gt;
&lt;li&gt;Accepted solution!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Key takeaways:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;just look at the complexity of ordered and unordered_map &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pc6WfLvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xlrswj4j1wrpvhz6axdy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pc6WfLvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xlrswj4j1wrpvhz6axdy.png" alt="Image description" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This complexity tells you a lot about when to use which data structure, map stores the data in a sorted manner while unordered will not, here we do not need sorted data which's why in the first attempt I went with unordered_map but later I realized my mistake and correct it.&lt;/p&gt;

&lt;p&gt;instead of 10^5 if the number of elements is 10^9 then our ordered_map will not work so, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always analyze worst-case time complexity, especially when dealing with large inputs.&lt;/li&gt;
&lt;li&gt;Don't rely solely on average-case performance.&lt;/li&gt;
&lt;li&gt;Choose data structures wisely based on problem constraints and potential worst-case scenarios.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy coding!!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>competativeprogramming</category>
      <category>datastructures</category>
      <category>learning</category>
    </item>
    <item>
      <title>Quick Sort vs. Merge Sort: A Developer's Dilemma 🤔</title>
      <dc:creator>kevinrawal</dc:creator>
      <pubDate>Sat, 23 Dec 2023 09:51:11 +0000</pubDate>
      <link>https://dev.to/kevinrawal/quick-sort-vs-merge-sort-a-developers-dilemma-5ble</link>
      <guid>https://dev.to/kevinrawal/quick-sort-vs-merge-sort-a-developers-dilemma-5ble</guid>
      <description>&lt;p&gt;Let's delve into the intriguing realm of sorting algorithms and zoom in on the dynamic duo—&lt;a href="https://www.geeksforgeeks.org/quick-sort/"&gt;Quick Sort&lt;/a&gt; and &lt;a href="https://www.geeksforgeeks.org/merge-sort/"&gt;Merge Sort&lt;/a&gt;. 🚀✨&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Quick Sort: The Swift Pathfinder 🏎️&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Quick Sort is the speed demon of sorting algorithms. Its divide-and-conquer strategy, coupled with clever pivot selection, makes it incredibly efficient.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use Cases:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-Time Processing&lt;/strong&gt;: In scenarios like financial trading, where split-second decisions matter, Quick Sort's speed is a game-changer.&lt;br&gt;
&lt;strong&gt;Large Datasets&lt;/strong&gt;: When dealing with massive datasets, Quick Sort's average time complexity of O(n log n) shines, ensuring rapid data organization.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Worst Case Consideration:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caveat Emptor:&lt;/strong&gt; However, it's important to note the worst-case scenario. If the pivot selection consistently results in unbalanced partitions, Quick Sort can degrade to a quadratic time complexity (O(n^2)), making it less favorable for certain cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Merge Sort: The Consistent Performer 🔄&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Merge Sort, on the other hand, takes a more laid-back approach. It's stable, reliable, and maintains a consistent performance.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use Cases:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stability Matters&lt;/strong&gt;: When stability is crucial, as in applications where the relative order of equal elements must be preserved, Merge Sort comes to the forefront.&lt;br&gt;
Predictable Performance: In scenarios where a consistent and predictable time complexity of O(n log n) is preferred over the fastest possible speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choosing Wisely&lt;/strong&gt;: Balancing Speed and Consistency ⚖️&lt;/p&gt;

&lt;p&gt;As developers, the choice between Quick Sort and Merge Sort often boils down to the specific needs of the task at hand. Need blazing speed and can handle a bit of unpredictability? Quick Sort is your ally. Craving stability and a consistent performance profile? Merge Sort has your back. 🤝&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your Experiences?💬&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you encountered situations where the choice between Quick Sort and Merge Sort made a significant impact on your project? Share your thoughts, experiences, and let's keep the conversation alive! 🚀✨&lt;/p&gt;

</description>
      <category>programming</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>2023 Leetcode Rewind</title>
      <dc:creator>kevinrawal</dc:creator>
      <pubDate>Thu, 21 Dec 2023 04:46:13 +0000</pubDate>
      <link>https://dev.to/kevinrawal/2023-leetcode-rewind-3101</link>
      <guid>https://dev.to/kevinrawal/2023-leetcode-rewind-3101</guid>
      <description>&lt;p&gt;"2023 was a great year for my coding skills! Thanks to &lt;a href="https://leetcode.com/win-son/"&gt;LeetCode&lt;/a&gt;&lt;br&gt;
 for helping me level up 🚀.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8KfIHl9R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ks4ks8ym93ks9c67ws6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8KfIHl9R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ks4ks8ym93ks9c67ws6y.png" alt="Image description" width="800" height="1334"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pNLmHo7q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/st9l0jrqk1fdbekz7tuh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pNLmHo7q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/st9l0jrqk1fdbekz7tuh.png" alt="Image description" width="800" height="1424"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
