<?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 Archana K C on Medium]]></title>
        <description><![CDATA[Stories by Archana K C on Medium]]></description>
        <link>https://medium.com/@archanakc?source=rss-6b524d8a565------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xvv2oJJVavz-35mU</url>
            <title>Stories by Archana K C on Medium</title>
            <link>https://medium.com/@archanakc?source=rss-6b524d8a565------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 10:11:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@archanakc/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[Understanding the Trade-offs: Apache Kafka vs Amazon SQS]]></title>
            <link>https://medium.com/@archanakc/understanding-the-trade-offs-apache-kafka-vs-amazon-sqs-9c6db9a34471?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c6db9a34471</guid>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Wed, 25 Dec 2024 07:21:50 GMT</pubDate>
            <atom:updated>2024-12-25T07:21:50.166Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I was discussing Apache Kafka with junior engineers on my team. Their enthusiasm for Kafka as a universal solution for messaging and streaming needs reminded me of an important lesson I learned during a previous transition between messaging systems. While both Kafka and Amazon SQS are excellent tools, understanding their distinct strengths and use cases is crucial for making the right architectural decisions.</p><h3>Our Initial Kafka Implementation</h3><p>When we first adopted Kafka, its capabilities aligned well with our theoretical needs. The platform offers high-throughput data streaming, message persistence, replay capabilities, and horizontal scalability. However, as our system grew, we gained valuable insights into both its strengths and challenges.</p><h3>Understanding Kafka’s Characteristics</h3><h3>Operational Considerations</h3><p>Managing a Kafka cluster requires dedicated expertise and resources. As our traffic grew, we invested significant engineering time in cluster management, monitoring, and optimization. This operational overhead was justified for our critical event streaming use cases but proved excessive for simpler messaging needs.</p><h3>Performance and Reliability</h3><p>When properly configured, Kafka provides excellent durability guarantees through replication and can handle massive throughput with low latency. Key configuration parameters include:</p><ul><li><strong>Replication Factor</strong>: Typically set to 3 for production environments to ensure data durability.</li><li><strong>Producer Acknowledgment Settings</strong>: acks=all for the strongest durability guarantees.</li><li><strong>Minimum In-Sync Replicas</strong>: To prevent data loss during broker failures.</li><li><strong>Partition Management</strong>: Ensuring proper distribution and scalability.</li></ul><h3>Resource Utilization</h3><p>Running Kafka clusters requires careful capacity planning and can be resource-intensive. While the infrastructure costs can be significant, Kafka’s efficiency at high scale can actually make it cost-effective for large-volume use cases.</p><h3>The Move to Amazon SQS</h3><p>After analysis, we identified that many of our services needed simple, reliable message queuing rather than full event streaming capabilities. For these cases, we transitioned to Amazon SQS.</p><h3>SQS Advantages</h3><ul><li><strong>Managed Service Benefits</strong>: AWS handles infrastructure management, significantly reducing operational overhead.</li><li><strong>Simple Integration</strong>: Native AWS service integration with Lambda, EC2, and other AWS offerings.</li><li><strong>Cost Model</strong>: Pay-per-use pricing works well for variable or lower-volume workloads.</li><li><strong>Reliability</strong>: Multi-AZ redundancy ensures at-least-once delivery.</li><li><strong>Queue Types</strong>: Standard queues for high throughput and FIFO queues for ordering guarantees.</li></ul><h3>SQS Limitations</h3><ul><li><strong>Throughput Caps</strong>: FIFO queues are limited to 3,000 messages per second (with batching).</li><li><strong>Message Retention</strong>: Limited to a maximum of 14 days.</li><li><strong>Message Size</strong>: Restricted to 256KB per message.</li><li><strong>No Native Message Replay</strong>: While Dead Letter Queues (DLQs) can help, replaying messages isn’t as straightforward as in Kafka.</li></ul><h3>Making the Right Choice</h3><p>The decision between Kafka and SQS should be based on specific requirements:</p><h3>Consider Kafka When You Need:</h3><ol><li>Event streaming and real-time data pipelines.</li><li>Long-term event storage and replay capabilities.</li><li>Strict ordering guarantees high throughput.</li><li>Sub-millisecond latency.</li><li>Event sourcing patterns.</li><li>Processing massive data streams with extended retention requirements.</li></ol><h3>Consider SQS When You Need:</h3><ol><li>Simple message queuing between services.</li><li>Minimal operational overhead.</li><li>Cost-effectiveness for variable or lower volumes.</li><li>Quick setup and AWS service integration.</li><li>Basic asynchronous task processing.</li><li>Guaranteed message delivery without streaming requirements.</li></ol><h3>The Hybrid Approach</h3><p>In many organizations, the best solution is to use both technologies where they make the most sense:</p><ul><li><strong>Kafka</strong>: For critical event streaming, real-time analytics, and high-throughput ordered events.</li><li><strong>SQS</strong>: For service-to-service messaging, task queues, and simpler asynchronous processing.</li></ul><h3>Lessons Learned</h3><p>The key insight isn’t that one system is superior to the other but rather that choosing the right tool requires careful analysis of:</p><ul><li>Actual use cases and requirements.</li><li>Operational capabilities and team expertise.</li><li>Cost considerations at your scale</li><li>Integration requirements.</li><li>Performance needs.</li><li>Development team familiarity.</li></ul><p>Before implementing either system, ensure you understand your specific requirements and constraints. Both Kafka and SQS are excellent tools when used appropriately, but their success depends on proper alignment with your use case, team capabilities, and system requirements.</p><h3>Final Thoughts</h3><p>The goal isn’t to choose the most powerful tool but the one that best serves your specific needs while minimizing unnecessary complexity. By doing so, you can build a robust, scalable, and maintainable system without overengineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c6db9a34471" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kochi to Munnar: A 4-day itinerary]]></title>
            <link>https://medium.com/@archanakc/kochi-to-munnar-a-4-day-itinerary-33a0c312173?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/33a0c312173</guid>
            <category><![CDATA[trip]]></category>
            <category><![CDATA[itinerary]]></category>
            <category><![CDATA[munnar]]></category>
            <category><![CDATA[friends]]></category>
            <category><![CDATA[budget]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 13:24:55 GMT</pubDate>
            <atom:updated>2023-09-18T13:24:55.066Z</atom:updated>
            <content:encoded><![CDATA[<p>The nearest airport to Munnar is Kochi Airport. In my case, I am from Thrissur, a district in Kerala. There was a long weekend coming up and we planned a girl&#39;s trip of 4 and thought that we would unwind somewhere in Munnar. Being a planner went ahead and created a trip that stayed under a budget of 8k(in Rs).</p><blockquote><strong>Thrissur — Kochi</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DC7DZom3qWvPyKgfqr6KSA.png" /></figure><p>I took Janashtabdi from Thrissur to Kochi north railway station which cost me 85 Rs.</p><blockquote><strong>Kochi — Munnar</strong></blockquote><p>From Kochi to Munnar, we booked a swift dzire car for 4 people using <a href="http://www.munnarcabs.com/">http://www.munnarcabs.com/</a>. They provided us the following quote for 8k Rs if we stayed under 400km which was more than sufficient for our 4-day trip:</p><p><em>30/04 pick up from Ernakulam railway station to Munnar on the way sightseeing and drop hotel</em></p><p><em>01/05 Munnar local sightseeing</em></p><p><em>02/05 Munnar local sightseeing</em></p><p><em>03/05 Munnar to Ernakulam railway station drop</em></p><p><em>Vehicle swift dzire A/C</em></p><p><em>Amount: 8000/- up to 400 km from Ernakulam to Ernakulam</em></p><p><em>Extra km 15/-</em></p><p>To our added benefit, the driver provided to us was really interested in photography. :)</p><blockquote><strong>Stay</strong></blockquote><p>For 3 nights and 4 days, we stayed at this amazing place in Kallar, Munnar called <a href="https://g.page/willmountmunnar?share">Willmount Cabins</a> with unbeatable views at a minimal cost. One needs to ping them via Instagram/WhatsApp to get in touch with them for booking requirements. The stay cost us 3987 Rs per person including breakfast and dinner with complimentary tea at any time of the day.</p><p>On the first day, we stayed in the Square cabin which was amazing, but on the second day, we stayed in the A-frame cabin which was just… WOW!</p><p>I must mention the <em>sunset trek</em> that we did around 5 p.m. If you have decent stamina, you can definitely try this one out and you will be witnessing one of the most amazing sunset views in the Pettimudi hills!</p><p><em>TARIFF(as of May 2022):</em></p><p><em>_____</em></p><p><em>1. Couple cabin 1 (1 Bedroom with balcony, Bathroom)</em></p><p><em>Tariff: ₹1980* for 2 Members</em></p><p><em>[ Max — 2 Members]</em></p><p><em>2. Couple Cabin 2(1 Bedroom with balcony, bathroom)</em></p><p><em>Tariff: ₹2200* for 2 members</em></p><p><em>3. Square Cabin (1 Bedroom with balcony &amp; bathroom)</em></p><p><em>Tariff: ₹2750* for 2 Members</em></p><p><em>[ Max — 3* Members ]</em></p><p><em>4. A-frame Cabin (Double deck cabins with 2 King size beds, Bathroom &amp; Balcony)</em></p><p><em>Tariff: ₹3299* for 2 Members</em></p><p><em>[ Max — 5 Members]</em></p><p><em>*Additional members can be accompanied by ₹700/- per head.</em></p><p><em>Excluding:</em></p><p><em>• Food (Dinner and Breakfast)</em></p><p><em>You will be served homely food at a normal price according to your menu</em></p><p><em>_____</em></p><p><em>Resort amenities</em></p><p><strong><em>Includes</em></strong></p><p><em>• Sunset Hiking</em></p><p><em>• Car parking</em></p><p><em>• 24-hour reception</em></p><p><em>• Room service</em></p><p><em>• Campfire</em></p><p><strong><em>Not available</em></strong></p><p><em>• Pool</em></p><p><em>• Wifi</em></p><p><em>• Hot water facility</em></p><p><em>_____</em></p><p><strong><em>TIME</em></strong></p><p><em>Check-in time 2:00 pm</em></p><p><em>Checkout time 11:00 am</em></p><p><em>_____</em></p><p><em>☎️ +91 755–8800222‬</em></p><blockquote><strong>Food</strong></blockquote><p>We had our breakfast and dinner from Willmount itself. I must say that everything provided was lip-smacking!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*r3XqD_qBQfMfSJ9JBlvPpA.png" /><figcaption>The food menu at Willmount Cabins as of May 2022</figcaption></figure><blockquote><strong>Places visited</strong></blockquote><p>We did not have plans to visit any “touristy” places. The places we went to were off-beat yet beautiful.</p><ol><li><em>Tea Gardens</em></li></ol><p>What do I say about this place? The road trip to the Tea gardens itself was an amazing peaceful journey. On the way, we stopped at this place that was full of eucalyptus trees with a river flowing nearby. Picture that! We sat there with our snacks and tea surrounded by the smell of eucalyptus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*qy8toIWCGckh4aeGJDi9Vg.png" /><figcaption>Tea gardens</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*SJucVKNpNUHJ3gqyVD-riQ.png" /><figcaption>Surrounded by Eucalyptus trees</figcaption></figure><p>Tea gardens are a vast area surrounded by tea leaves and mountains. It is just greenery till your eyes may reach. We sat there in one place for hours with peace and sunshine.</p><p>2. Muthirappuzhayar</p><p>On the second day we went to Anachal where we booked a jeep ride to the remote places which was completely an off-road ride and if you are someone with back pain, then don&#39;t! The jeep ride cost us 700Rs per person and I think you can bargain a little more to bring it down to 500Rs per person.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*FD8zzRHNuW9pHk4EvQJOPA.jpeg" /><figcaption>Muthirapuzhayar places visited</figcaption></figure><p>We visited Ripple waterfall, Ponmudi dam, an echo point right beside the dam, the Moolakadai hanging bridge made by the British, and a cliff on the way.</p><blockquote><strong>Budget</strong></blockquote><p>Train to kochi from Thrissur(85 Rs) + Cab(2000 Rs per person)+Breakfast and dinner with stay(3987Rs per person) + Muthirappuzhayar jeep ride(700Rs per person) + Snacks(200Rs per person) + Lunch(910 Rs per person) + Train from Kochi to Thrissur(85 Rs) = 7767Rs</p><p>Hope you get a chance to visit Munnar in God&#39;s Own Country soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33a0c312173" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[39. Combination Sum | Java | LeetCode | Medium]]></title>
            <link>https://medium.com/@archanakc/39-combination-sum-java-leetcode-medium-79639eba1d2e?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/79639eba1d2e</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[backtracking]]></category>
            <category><![CDATA[leetcode-medium]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Mon, 27 Jun 2022 16:55:33 GMT</pubDate>
            <atom:updated>2022-06-27T16:55:33.989Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Question</strong></blockquote><p>Given an array of <strong>distinct</strong> integers candidates and a target integer target, return <em>a list of all </em><strong><em>unique combinations</em></strong><em> of </em>candidates<em> where the chosen numbers sum to </em>target<em>.</em> You may return the combinations in <strong>any order</strong>.</p><p>The <strong>same</strong> number may be chosen from candidates an <strong>unlimited number of times</strong>. Two combinations are unique if the frequency of at least one of the chosen numbers is different.</p><p>It is <strong>guaranteed</strong> that the number of unique combinations that sum up to target is less than 150 combinations for the given input.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> candidates = [2,3,6,7], target = 7<br><strong>Output:</strong> [[2,2,3],[7]]<br><strong>Explanation:</strong><br>2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times.<br>7 is a candidate, and 7 = 7.<br>These are the only two combinations.</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> candidates = [2,3,5], target = 8<br><strong>Output:</strong> [[2,2,2,2],[2,3,3],[3,5]]</pre><p><strong>Example 3:</strong></p><pre><strong>Input:</strong> candidates = [2], target = 1<br><strong>Output:</strong> []</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= candidates.length &lt;= 30</li><li>1 &lt;= candidates[i] &lt;= 200</li><li>All elements of candidates are <strong>distinct</strong>.</li><li>1 &lt;= target &lt;= 500</li></ul><blockquote><strong>Solution</strong></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8508d82010c5e43732aff6a073ad5287/href">https://medium.com/media/8508d82010c5e43732aff6a073ad5287/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*pU7Xaq_85tuuZ7lAPsZ2Gw.png" /><figcaption>39. Combination Sum | Java | LeetCode | Medium | Solution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*_KXfNg2u6i-CsbaYDOxbrA.png" /><figcaption>39. Combination Sum | Java | LeetCode | Medium | Solution</figcaption></figure><p><a href="https://leetcode.com/problems/combination-sum/">Combination Sum - LeetCode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79639eba1d2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[198. House Robber | LeetCode | Medium | Java]]></title>
            <link>https://medium.com/@archanakc/198-house-robber-leetcode-medium-java-547ec7538457?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/547ec7538457</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[leetcode-medium]]></category>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Sat, 04 Jun 2022 14:50:40 GMT</pubDate>
            <atom:updated>2022-06-04T14:50:40.208Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Question</strong></blockquote><p>You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and <strong>it will automatically contact the police if two adjacent houses were broken into on the same night</strong>.</p><p>Given an integer array nums representing the amount of money of each house, return <em>the maximum amount of money you can rob tonight </em><strong><em>without alerting the police</em></strong>.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> nums = [1,2,3,1]<br><strong>Output:</strong> 4<br><strong>Explanation:</strong> Rob house 1 (money = 1) and then rob house 3 (money = 3).<br>Total amount you can rob = 1 + 3 = 4.</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> nums = [2,7,9,3,1]<br><strong>Output:</strong> 12<br><strong>Explanation:</strong> Rob house 1 (money = 2), rob house 3 (money = 9) and rob house 5 (money = 1).<br>Total amount you can rob = 2 + 9 + 1 = 12.</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= nums.length &lt;= 100</li><li>0 &lt;= nums[i] &lt;= 400</li></ul><blockquote><strong>Solution</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*jf3DmHl5hodsr3H8lTlQAw.png" /><figcaption>198. House Robber | LeetCode | Medium | Java | Solution</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c298592ff661777fd4b994d27442c24/href">https://medium.com/media/3c298592ff661777fd4b994d27442c24/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*37cRuzPn-Yw5G3dnX7B-Hg.png" /><figcaption>198. House Robber | LeetCode | Medium | Java | Solution</figcaption></figure><p><a href="https://leetcode.com/problems/house-robber/">House Robber - LeetCode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=547ec7538457" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[876. Middle of the Linked List | Leetcode | Easy | Java]]></title>
            <link>https://medium.com/@archanakc/876-middle-of-the-linked-list-leetcode-easy-java-b52b93b429be?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/b52b93b429be</guid>
            <category><![CDATA[leetcode-easy]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Sat, 04 Jun 2022 14:04:42 GMT</pubDate>
            <atom:updated>2022-06-04T14:04:42.322Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Question</strong></blockquote><p>Given the head of a singly linked list, return <em>the middle node of the linked list</em>.</p><p>If there are two middle nodes, return <strong>the second middle</strong> node.</p><p><strong>Example 1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/0*hal3PG_PdDehfpa9.jpg" /><figcaption>876. Middle of the Linked List | Leetcode | Easy | Java</figcaption></figure><pre><strong>Input:</strong> head = [1,2,3,4,5]<br><strong>Output:</strong> [3,4,5]<br><strong>Explanation:</strong> The middle node of the list is node 3.</pre><p><strong>Example 2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/0*xk5nEbAmRP6Nly_y.jpg" /><figcaption>876. Middle of the Linked List | Leetcode | Easy | Java</figcaption></figure><pre><strong>Input:</strong> head = [1,2,3,4,5,6]<br><strong>Output:</strong> [4,5,6]<br><strong>Explanation:</strong> Since the list has two middle nodes with values 3 and 4, we return the second one.</pre><p><strong>Constraints:</strong></p><ul><li>The number of nodes in the list is in the range [1, 100].</li><li>1 &lt;= Node.val &lt;= 100</li></ul><blockquote><strong>Solution</strong></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89dfe27cd40b7f34976ac0eed7b9c6f9/href">https://medium.com/media/89dfe27cd40b7f34976ac0eed7b9c6f9/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*EbiRwUSHyuxWZZ8tQOZrFw.png" /><figcaption>876. Middle of the Linked List | Leetcode | Easy | Java | Solution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*a7dNHUyp7ut2nW1w7IY9Xg.png" /><figcaption>876. Middle of the Linked List | Leetcode | Easy | Java | Solution</figcaption></figure><p><a href="https://leetcode.com/problems/middle-of-the-linked-list/">Middle of the Linked List - LeetCode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b52b93b429be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can main() be overloaded or overridden? | Java]]></title>
            <link>https://medium.com/@archanakc/can-main-be-overloaded-or-overridden-java-de2eddbaffad?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/de2eddbaffad</guid>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Wed, 25 May 2022 16:46:02 GMT</pubDate>
            <atom:updated>2022-05-25T16:46:02.853Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Can main() method be overloaded?</strong></blockquote><p>Yes!</p><ul><li>Java allows you to overload <em>main()</em> method.</li><li>It won’t throw any errors while compiling/running the program</li><li>BUT… JVM will only pick up the original main() method signature every time.</li></ul><blockquote><strong>Can main() method be overriden?</strong></blockquote><p>NO!</p><p>The <em>main()</em> method signature is static and static methods can’t be overridden.</p><p>Static methods are associated with their own class during compile time.</p><p>If you are creating an object of the child class using the parent class, it would call the static method inside the parent class and not the child class. The static method inside the child class would only be called when you create the object of the child class without using the parent class. Thus, <em>method hiding</em> is possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de2eddbaffad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[12. Integer to Roman | LeetCode | Medium | Java]]></title>
            <link>https://medium.com/@archanakc/12-integer-to-roman-leetcode-medium-java-fbfa4249e89f?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbfa4249e89f</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[leetcode-medium]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Sun, 22 May 2022 06:30:35 GMT</pubDate>
            <atom:updated>2022-05-22T06:30:35.193Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Question</strong></blockquote><p>Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.</p><pre><strong>Symbol</strong>       <strong>Value</strong><br>I             1<br>V             5<br>X             10<br>L             50<br>C             100<br>D             500<br>M             1000</pre><p>For example, 2 is written as II in Roman numeral, just two one&#39;s added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.</p><p>Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:</p><ul><li>I can be placed before V (5) and X (10) to make 4 and 9.</li><li>X can be placed before L (50) and C (100) to make 40 and 90.</li><li>C can be placed before D (500) and M (1000) to make 400 and 900.</li></ul><p>Given an integer, convert it to a roman numeral.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> num = 3<br><strong>Output:</strong> &quot;III&quot;<br><strong>Explanation:</strong> 3 is represented as 3 ones.</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> num = 58<br><strong>Output:</strong> &quot;LVIII&quot;<br><strong>Explanation:</strong> L = 50, V = 5, III = 3.</pre><p><strong>Example 3:</strong></p><pre><strong>Input:</strong> num = 1994<br><strong>Output:</strong> &quot;MCMXCIV&quot;<br><strong>Explanation:</strong> M = 1000, CM = 900, XC = 90 and IV = 4.</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= num &lt;= 3999</li></ul><blockquote><strong>Solution</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*cZ9YpO2-7-80F09OCfKJwQ.png" /><figcaption>12. Integer to Roman | LeetCode | Medium | Java</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af3f34661e6459a20cc16fd3633f9409/href">https://medium.com/media/af3f34661e6459a20cc16fd3633f9409/href</a></iframe><ul><li>Time complexity: O(symbol)</li><li>Space Complexity: O(1)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*rS41qo00DZA38AyNBWV_6A.png" /><figcaption>12. Integer to Roman | LeetCode | Medium | Java</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbfa4249e89f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[101. Symmetric Tree | LeetCode | Easy | Java]]></title>
            <link>https://medium.com/@archanakc/101-symmetric-tree-leetcode-easy-java-97e08f62270f?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/97e08f62270f</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[leetcode-easy]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Sun, 22 May 2022 06:07:17 GMT</pubDate>
            <atom:updated>2022-05-22T06:07:17.982Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Question</strong></blockquote><p>Given the root of a binary tree, <em>check whether it is a mirror of itself</em> (i.e., symmetric around its center).</p><p><strong>Example 1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/0*Fc8ySKXCT_JI-D44.jpg" /></figure><pre><strong>Input:</strong> root = [1,2,2,3,4,4,3]<br><strong>Output:</strong> true</pre><p><strong>Example 2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/0*8mcxqCeOveyuQXQ9.jpg" /></figure><pre><strong>Input:</strong> root = [1,2,2,null,3,null,3]<br><strong>Output:</strong> false</pre><p><strong>Constraints:</strong></p><ul><li>The number of nodes in the tree is in the range [1, 1000].</li><li>-100 &lt;= Node.val &lt;= 100</li></ul><blockquote><strong>Solution</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*kUEwKzd5R4NQB8oPo8xDwQ.png" /><figcaption>101. Symmetric Tree | LeetCode | Easy | Java</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a631a2d37611d3532f50f6df83446005/href">https://medium.com/media/a631a2d37611d3532f50f6df83446005/href</a></iframe><ul><li>Time Complexity: O(n)</li><li>Space Complexity: O(n), if it is a skew tree in the worst case</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*FpiZOJ0r5p8ujNVeUAkIdg.png" /><figcaption>101. Symmetric Tree | LeetCode | Easy | Java | Submission</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97e08f62270f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[50. Pow(x, n) | LeetCode | Medium | Java]]></title>
            <link>https://medium.com/@archanakc/50-pow-x-n-leetcode-medium-java-d96acb672562?source=rss-6b524d8a565------2</link>
            <guid isPermaLink="false">https://medium.com/p/d96acb672562</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[faang]]></category>
            <category><![CDATA[leetcode-medium]]></category>
            <dc:creator><![CDATA[Archana K C]]></dc:creator>
            <pubDate>Sat, 21 May 2022 19:35:39 GMT</pubDate>
            <atom:updated>2022-05-21T19:35:39.611Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Question</strong></blockquote><p>Implement <a href="http://www.cplusplus.com/reference/valarray/pow/">pow(x, n)</a>, which calculates x raised to the power n (i.e., xn).</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> x = 2.00000, n = 10<br><strong>Output:</strong> 1024.00000</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> x = 2.10000, n = 3<br><strong>Output:</strong> 9.26100</pre><p><strong>Example 3:</strong></p><pre><strong>Input:</strong> x = 2.00000, n = -2<br><strong>Output:</strong> 0.25000<br><strong>Explanation:</strong> 2-2 = 1/22 = 1/4 = 0.25</pre><p><strong>Constraints:</strong></p><ul><li>-100.0 &lt; x &lt; 100.0</li><li>-231 &lt;= n &lt;= 231-1</li><li>-104 &lt;= xn &lt;= 104</li></ul><blockquote><strong>Solution</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*mmSdx5H2oQciGuvbCFszXw.png" /><figcaption>50. Pow(x, n) | LeetCode | Medium | Java</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f66d36c2201df42c467bc7485f984e29/href">https://medium.com/media/f66d36c2201df42c467bc7485f984e29/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*Dvx2nTPsQ78X9ELg73xuHg.png" /><figcaption>50. Pow(x, n) | LeetCode | Medium | Java | Submission</figcaption></figure><p>Time Complexity: (log2)n</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d96acb672562" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>