<?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 Kanav Arora on Medium]]></title>
        <description><![CDATA[Stories by Kanav Arora on Medium]]></description>
        <link>https://medium.com/@kanavarora1515?source=rss-87ace3ff4516------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X6EVxQjQzW66d1Z5-O6jlg.jpeg</url>
            <title>Stories by Kanav Arora on Medium</title>
            <link>https://medium.com/@kanavarora1515?source=rss-87ace3ff4516------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:26:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kanavarora1515/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[Uber & Netflix’s shift to Event Driven Architecture (EDA)]]></title>
            <link>https://kanavarora1515.medium.com/uber-netflixs-shift-to-event-driven-architecture-eda-091b5c9f3e51?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/091b5c9f3e51</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[real-time-streaming-data]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 15:40:34 GMT</pubDate>
            <atom:updated>2026-01-20T15:40:34.800Z</atom:updated>
            <content:encoded><![CDATA[<p>Traditional system uses synchronous calls among tightly couples services which works at initial levels but can’t keep up with massive scaling and realtime responsiveness. Series of request/response calls awaiting for the next response slows down whole system. As the business scales companies needed a better solution which is isolated for each service and produce real-time effectiveness. Event driven architecture is the one stop solution for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEhFAxapEZ-OkXOTlRDHFw.png" /></figure><h3>What is Event Driven Architecture (EDA)?</h3><p>Event driven architecture is a software paradigm which allows loosely coupled microservices to asynchronously communicate with each other using messages called events. Events are passed through an event broker which is generally a messaging queue service like Apache Kafka.</p><p>Microservice which emits events is called a producer like event of placing an order by the backend. Microservice which reads the events to further process the same is called a consumer like a backend service which validates the placed order from the database. This way producers are not aware of and hence not dependent on consumers. Therefore, while scaling different services can evolve without wrecking the other services.</p><h3>Why Tech Giants like Uber &amp; Netflix shifted to EDA?</h3><p>As their system scaled so as the microservices interacting with each other to keep the business operations running. When a customer books a ride there are number of synchronous &amp; asynchronous services such as <em>Driver Request, Fare Calculation, Fraud Detection, Push Notification, Analytics.</em> Collectively these services form sub-events which is called <strong><em>lifecycle of an event</em></strong>. If you’ll observe most of the services are independent of each other therefore performing Request/Response calls for each service is inefficient.</p><p>In EDA, customer booking a cab emits initial event. Now all the services can receive this event and act on it. This creates a <strong><em>loosely coupled</em></strong> architecture therefore if a service is down it won’t affect other services.</p><h3>Advantages of Event Driven Architecture</h3><p>The main advantage of EDA is reliability, scalability and independence. The ability of architecture to recover from state of failure makes it more resilient and reliable. With EDA:</p><ul><li>Subscribed consumers gets the event almost immediately, which makes it efficient for realtime use cases.</li><li>In case of a failure of consumer, no events are lost and once service is up it can start from where it left off.</li><li>Adding a service on requires subscribing to an event and producing one after processing.</li><li>Topic routing and consumer grouping makes it easy to manage the read offsets of an event.</li></ul><h3>EDA at Netflix’s Core</h3><p>Netflix operates a platform serving more than 300 million subscribers globally with hundreds of billions of playback session hours. It generates billions of events daily to run the operations smoothly and give a great streaming experience. Each user interaction generates an event like pause/play log, content search, likes/dislikes, streaming quality metrics, latency metrics, analytics. Netflix official blogs suggests the following architecture:</p><ul><li>It uses Kafka as messaging queue</li><li><em>Apache Flink</em> jobs are created for stream processing like realtime content suggestions.</li><li><em>Apache Spark</em> jobs are created for large batch processing.</li><li><em>Apache Iceberg</em> for data warehousing</li><li>Apache Mesos for job scheduling and execution</li><li>Uses internal <em>Keystone Platform for data governance and management</em></li></ul><h3>Downsides of EDA</h3><p>Shifted to EDA without planning be ready for an outage which would be very difficult to trace. EDA is great, but every rose has its thorn, and downsides of EDA as:</p><ul><li>Tracing tools: EDA requires managing tracing tools as in situation of outage its difficult to track the source since events are not chronological.</li><li>Schema Evolution: Since EDA is loosely coupled so as different services evolve their schema tends to change and schema governance is required to track the changes.</li><li>Cross-Team Coordination: EDA is loosely coupled so if any changes are made to the producer output like event schema, consumers should be able to accept those changes.</li></ul><h3>Conclusion</h3><p>EDA is not a shortcut for scalability but a slow &amp; steady adoption of a more robust and fault tolerant system. As said,</p><blockquote>Every line of code is a potential bug</blockquote><p>Therefore, EDA is great if bugs can be traced and system starts working smoothly without poisoning the services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=091b5c9f3e51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hadoop Explained: From Big Data Problem to Modern Data Engineering Backbone]]></title>
            <link>https://kanavarora1515.medium.com/hadoop-explained-from-big-data-problem-to-modern-data-engineering-backbone-630af7560985?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/630af7560985</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Thu, 21 Aug 2025 16:00:19 GMT</pubDate>
            <atom:updated>2025-08-21T16:00:19.727Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Back in 2003, Google published a research paper that quietly planted the seeds for a revolution in how we store and process data. That paper eventually inspired an open-source project called Hadoop — a framework that became the backbone of the Big Data era.</blockquote><h4>The Big Data Problem</h4><p>The phrase <em>“data is the new oil”</em> has become cliché — yet it reflects a truth: raw data is messy, difficult to process, and nearly impossible to manage at scale without proper tools.</p><p>In the early 2000s, tech giants like Google, Yahoo, and Facebook encountered an unprecedented challenge with three dimensions:</p><ul><li><strong>Massive volume</strong> — petabytes of web pages, images, and logs.</li><li><strong>Velocity</strong> — constant streams of real-time user activity.</li><li><strong>Variety</strong> — structured tables, semi-structured JSON/XML, and unstructured media.</li></ul><p>Traditional RDBMS systems reached their breaking points — expensive hardware upgrades often proved inadequate. The solution emerged: <strong>scale out</strong> rather than <strong>scale up</strong> — distribute data processing across numerous affordable machines working in parallel.</p><h4>A Brief History of Hadoop</h4><p>The roots of Hadoop trace back to Google’s <strong>GFS (Google File System)</strong> and <strong>MapReduce</strong> papers.</p><ul><li>In <strong>2003</strong>, Google published the GFS paper, describing a way to store massive files across distributed servers.</li><li>In <strong>2004</strong>, they followed up with the MapReduce paper, explaining how to process that distributed data efficiently.</li></ul><p>Doug Cutting and Mike Cafarella, inspired by these ideas, were working on an open-source search engine project called <strong>Nutch</strong>. They realized they needed a similar storage and processing system.</p><ul><li><strong>2005</strong> — Hadoop was born as part of the Nutch project.</li><li><strong>2006</strong> — Yahoo hired Doug Cutting to develop Hadoop as an independent project.</li><li><strong>2008</strong> — Hadoop became a top-level Apache project.</li><li>Over the years, it evolved into a whole ecosystem — HDFS, YARN, Hive, HBase, Pig, and more.</li></ul><p>Fun fact: The name “Hadoop” came from Doug Cutting’s son’s toy elephant.</p><h4>What is Hadoop?</h4><p>At its core, Hadoop is:</p><ul><li><strong>Open-source</strong> — under the Apache Software Foundation.</li><li><strong>Distributed</strong> — spreads data across many machines.</li><li><strong>Fault-tolerant</strong> — survives machine failures without data loss.</li><li><strong>Scalable</strong> — can grow from one node to thousands.</li></ul><p>It’s not one tool, but an <strong>ecosystem</strong> of components for storage, resource management, and computation.</p><h4>Core Components</h4><p><strong>→ HDFS — Hadoop Distributed File System</strong></p><ul><li>Breaks files into blocks (default: 128 MB or 256 MB) and stores them across nodes.</li><li>Replicates each block (default: 3 copies) for fault tolerance.</li><li>Handles hardware failures automatically.</li></ul><p><strong>→ YARN — Yet Another Resource Negotiator</strong></p><ul><li>Manages cluster resources.</li><li>Schedules jobs and allocates containers to run tasks.</li></ul><p><strong>→ MapReduce</strong></p><ul><li>Original processing engine for Hadoop.</li><li>Works in two main steps:</li><li><strong>Map</strong> — processes data into key-value pairs.</li><li><strong>Reduce</strong> — aggregates or summarizes results.</li></ul><h4>High Level Architecture</h4><figure><img alt="Hadoop High Level Architecture" src="https://cdn-images-1.medium.com/max/1024/1*Meo6f6Hfp4BsVoMJIqrTQA.png" /><figcaption>Hadoop High Level Architecture</figcaption></figure><h4>Real-World Use Cases</h4><ul><li><strong>E-commerce</strong> — clickstream analysis, recommendation systems.</li><li><strong>Finance</strong> — fraud detection, risk modeling.</li><li><strong>Healthcare</strong> — processing large-scale patient records.</li><li><strong>Telecom</strong> — analyzing call data records, network optimization.</li><li><strong>Social Media</strong> — log analysis, trend detection.</li></ul><h4>Why Hadoop Still Matters</h4><p>Even though newer frameworks like Spark have gained popularity, Hadoop remains relevant because:</p><ul><li>HDFS is still widely used as a storage layer.</li><li>Many enterprises have legacy Hadoop clusters.</li><li>Its ecosystem (Hive, HBase, etc.) integrates with modern tools.</li></ul><p><strong>Key Takeaways:</strong></p><ul><li>Hadoop was inspired by Google’s innovations and became the foundation of modern Big Data processing.</li><li>It’s built on three pillars: <strong>HDFS</strong>, <strong>YARN</strong>, and <strong>MapReduce</strong>.</li><li>The ecosystem extends far beyond storage and computation, enabling a full data pipeline.</li></ul><h4>What’s Next</h4><p>In the next post, we’ll explore <strong>HDFS in depth</strong> — how it stores files, ensures fault tolerance, and manages replication, along with practical commands you can try yourself.</p><p>👉 <em>Stay tuned by following me here (on Medium/LinkedIn) so you don’t miss the next part of the Hadoop Explained series.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=630af7560985" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React State Management with Recoil: A Beginner’s Guide]]></title>
            <link>https://kanavarora1515.medium.com/react-state-management-with-recoil-a-beginners-guide-150e50a4f27c?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/150e50a4f27c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[recoil]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 11:33:59 GMT</pubDate>
            <atom:updated>2024-02-04T11:33:59.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you a React developer looking to elevate your state management game? You’ve probably heard of popular solutions like Redux or Context API, but there’s a new player in town that’s making waves — Recoil. In this blog post, we’ll embark on a journey to explore the world of Recoil and discover how it can simplify state management for your React applications.</p><p><strong>What is Recoil?</strong></p><p>Imagine you’re building a React app with multiple components that need to share and update state. Recoil steps in as a lightweight, yet powerful, state management library. Developed by Facebook, Recoil introduces a simple and intuitive way to manage state without the boilerplate that often comes with other solutions.</p><p><strong>Getting Started with Recoil:</strong></p><p><strong>Installation:</strong></p><p>Getting Recoil up and running in your project is a breeze. Start by installing Recoil using npm or yarn:</p><pre>npm install recoil</pre><pre>yarn add recoil</pre><p>Once installed, import RecoilRoot and wrap your app with it in your main component:</p><pre>import { RecoilRoot } from &#39;recoil&#39;;<br><br>function App() {<br>  return (<br>    &lt;RecoilRoot&gt;<br>      {/* Your app components go here */}<br>    &lt;/RecoilRoot&gt;<br>  );<br>}</pre><p>Congratulations, you’ve just set the stage for Recoil to work its magic!</p><p><strong>Atoms and Selectors:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ba4u77yHtSqbLFE8UzXpcQ.jpeg" /><figcaption>Source: skyrockets.space</figcaption></figure><p>Recoil revolves around two main concepts: atoms and selectors.</p><p>Atoms represent the smallest units of state in Recoil. They act as containers for a piece of state that can be read or modified by various components.</p><pre>import { atom } from &#39;recoil&#39;;<br><br>export const myAtom = atom({<br>  key: &#39;myAtom&#39;,<br>  default: &#39;Hello Recoil!&#39;,<br>});</pre><p><strong>Selectors</strong>, on the other hand, allow you to derive new state from your atoms or other selectors. They’re like computed values based on the current state.</p><pre>import { selector } from &#39;recoil&#39;;<br>import { myAtom } from &#39;./atoms&#39;;<br><br>export const uppercasedText = selector({<br>  key: &#39;uppercasedText&#39;,<br>  get: ({ get }) =&gt; {<br>    const text = get(myAtom);<br>    return text.toUpperCase();<br>  },<br>});</pre><p><strong>Using Recoil in Components:</strong></p><p>Now that we have our state defined, let’s see how easy it is to use it in our components.</p><pre>import { useRecoilState, useRecoilValue } from &#39;recoil&#39;;<br>import { myAtom, uppercasedText } from &#39;./atoms&#39;;<br><br>function MyComponent() {<br>  const [myText, setMyText] = useRecoilState(myAtom);<br>  const uppercased = useRecoilValue(uppercasedText);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;{myText}&lt;/p&gt;<br>      &lt;input<br>        type=&quot;text&quot;<br>        value={myText}<br>        onChange={(e) =&gt; setMyText(e.target.value)}<br>      /&gt;<br>      &lt;p&gt;Uppercased Text: {uppercased}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p><strong>Why Recoil?</strong></p><p>Recoil brings simplicity and flexibility to state management in React. Its ease of use makes it an excellent choice for both beginners and experienced developers. With Recoil, you can kiss goodbye to complex setups and focus on building amazing user interfaces.</p><p><strong>Conclusion:</strong></p><p>Recoil is an exciting addition to the React ecosystem, offering a fresh perspective on state management. Whether you’re a beginner or a seasoned developer, Recoil’s simplicity and efficiency make it a compelling choice for your next project. Give it a try, and let Recoil transform the way you handle state in your React applications!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=150e50a4f27c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CORS Unraveled: Taming Cross-Origin Requests]]></title>
            <link>https://kanavarora1515.medium.com/cors-unraveled-taming-cross-origin-requests-e533246a703c?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/e533246a703c</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Wed, 11 Oct 2023 10:32:18 GMT</pubDate>
            <atom:updated>2023-10-11T10:32:18.675Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FPTyLoBQYJmL8FWM8sDglA.png" /></figure><p>Are you a web developer? If yes, then you’ve likely encountered the confounding CORS error. Picture this: you’re diligently building a web application, and suddenly, your browser spits out a cryptic message about cross-origin restrictions. This is where CORS, or Cross-Origin Resource Sharing, comes into play. Let’s embark on a journey to decipher this enigma.</p><h3>Understanding Origins: The Bedrock of Web Interaction</h3><p>Before we dive into CORS intricacies, it’s crucial to grasp the significance of origins in the realm of web development.</p><p>Origin is a web address that we use to access any resource. Now this resource can be a webpage (like HTML, CSS, Javascript) or it can be some data from the backend. Origin can be divided into three fundamental components</p><ul><li>Scheme: It is the first part of origin and can be HTTP or HTTPS</li><li>Host: It is the domain name to access the resource. It can be something.com.</li><li>Port: It is an endpoint through which the server communicates</li><li>Path (optional): Path is an endpoint to access a specific resource. Like to fetch only the Login page from the backend to load in the browser. This reduces the loading time.</li></ul><p>Now, the pivotal question arises: Why do CORS errors occur?</p><p>Browsers, in the interest of safeguarding data privacy, impose restrictions on sharing resources across disparate origins. This is a vital measure taken to prevent unauthorised access and maintain the integrity of sensitive information.</p><h3>Demystifying CORS Mechanics</h3><p>CORS operates through a series of HTTP headers exchanged between the client’s browser and the server. Here’s a step-by-step breakdown:</p><ul><li><strong>Origin Request Header:</strong></li></ul><p>When a web page makes a request for a resource from a different origin (i.e., a different Scheme, Host, or Port), the browser includes an <strong>Origin</strong> header in the HTTP request.</p><ul><li><strong>Preflight Request (Optional)</strong>:</li></ul><p>For certain types of requests (such as those with custom headers or non-standard HTTP methods), the browser may send a preflight request with an HTTP method of <strong>OPTIONS</strong> to the target server before sending the actual request. This preflight request seeks permission from the server to make the actual request.</p><ul><li><strong>Server-Side Handling</strong>:</li></ul><p>The server receives the request and checks for the presence of the <strong>Origin</strong> header. It then determines whether to allow or deny the request based on its CORS policy.</p><ul><li><strong>CORS Headers</strong>:</li></ul><p>If the server grants permission, it includes specific CORS headers in the response to inform the browser that the resource can be accessed. These headers include:</p><ul><li><strong>Access-Control-Allow-Origin</strong>: Specifies which origins are permitted to access the resource.</li><li><strong>Access-Control-Allow-Methods</strong>: Lists the HTTP methods allowed for this resource.</li><li><strong>Access-Control-Allow-Headers</strong>: Specifies which headers can be used in the actual request.</li><li><strong>Access-Control-Allow-Credentials</strong> (optional): Indicates whether credentials (e.g., cookies, HTTP authentication) can be sent with the request.</li><li><strong>Browser Enforcement</strong>:</li></ul><p>The browser analyses the CORS headers in the server’s response. If the response indicates that the request is permitted, the browser allows the web page to access the resource. Otherwise, it blocks the request, and a CORS error is triggered.</p><ul><li><strong>Client-Side Handling of Errors</strong>:</li></ul><p>When a CORS error occurs, JavaScript code on the web page may receive an error event. This event can be caught and handled by the developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*nqj9ZDQp7kpqyP_dYyHVlg.png" /><figcaption>Source: MDN Web Docs</figcaption></figure><h3>Understanding CORS Error Triggers</h3><p>When it comes to encountering CORS (Cross-Origin Resource Sharing) errors, it’s essential to be aware of the various scenarios that can lead to these frustrating roadblocks. Let’s explore the common situations where CORS errors tend to rear their heads and how to navigate around them.</p><p>In web development, CORS errors typically arise under specific circumstances where a web page requests resources from a different origin (Scheme, Host, or Port) than the one it originated from. The most common scenarios include:</p><ol><li><strong>Cross-Domain API Requests</strong>: When a web page hosted on one domain attempts to make an API request to a different domain.</li><li><strong>Subdomain Discrepancies</strong>: Issues may arise when trying to fetch resources from subdomains, especially when they differ from the main domain.</li><li><strong>Protocol Mismatch</strong>: A page using HTTP might face issues when trying to access resources on a server using HTTPS or vice versa.</li><li><strong>Non-Standard Ports</strong>: Attempts to access resources on a non-standard port (anything other than 80 for HTTP or 443 for HTTPS) may trigger a CORS error.</li><li><strong>Authorisation Headers</strong>: Requests that include custom headers (such as authentication tokens) can be flagged by the browser’s preflight requests, causing a CORS error.</li><li><strong>Cookies and Credentials</strong>: When a request includes credentials like cookies or HTTP authentication information, the server’s response must have the appropriate CORS headers.</li><li><strong>CORS Configuration on the Server</strong>: Incorrect or missing CORS headers on the server can lead to CORS errors.</li></ol><h3>Use of CORS</h3><pre>const app = express();<br>const corsOptions = {<br>  origin: config.FrontendOrigin,<br>  methods: &#39;GET,HEAD,PUT,PATCH,POST,DELETE&#39;,<br>  credentials: true,<br>};<br>app.use(cors(corsOptions));</pre><p>Server will allow access to requests from config.FrontendOrigin origin. Use of credentials and cookies is also allowed.</p><p>Show some ❤️ by following me and if you like the article please give it a clap. To connect with me on other platforms visit my linktree: <a href="https://linktr.ee/kanavarora">https://linktr.ee/kanavarora</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e533246a703c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Master Leetcode Contests — 3 Tips]]></title>
            <link>https://medium.com/competitive/master-leetcode-contests-3-tips-66e236283b56?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/66e236283b56</guid>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Wed, 03 May 2023 12:31:29 GMT</pubDate>
            <atom:updated>2023-05-03T12:31:29.297Z</atom:updated>
            <content:encoded><![CDATA[<h3>Master Leetcode Contests — 3 Tips</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GBB93zieA0rnwDGX" /><figcaption>Photo by <a href="https://unsplash.com/@fotospk?utm_source=medium&amp;utm_medium=referral">Fotos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently I have been taking some sessions on road to mastering Data Structures and Algorithms, and Competitive Programming. Leetcode contests are perfect for those who want grip on their DSA concepts and want to experience competitive pressure. Now you might be thinking “Do we really need to read this article and who’s this person?”. So if I tell you I have been coding properly for like past 6–7 months only. I started Leetcode contests probably in like september last year. Since then I have given almost all the contests and It took me just 15 contests to get into top 3% Leetcoders. You can do the same with a little bit dedication and motivation. Just keep these points in the mind:</p><p><strong>Don’t Miss Contests</strong></p><p>No matter you are busy with your exams or day to day work. You must take out some time to give the contest. Leetcode Biweekly contests are held alternating Saturdays at 8pm IST and Weekly contests are held every Sunday 8am IST. If by any chance you missed any contest, attempt virtual contest. Virtual contests gives you an idea of what your ranking would be but It will not change your rating.</p><p><strong>Upsolve problems</strong></p><p>Generally people participate and then post contest they don’t try to solve unsolved problems or try to find a more optimized approach for the problem they have solved. Note this if you’ll not upsolve you can’t learn anything from the contest.</p><blockquote>Those who don’t learn from their mistakes are bound to repeat them.</blockquote><p>Like if you have solved A and B question. Then give one day to review the solutions you have solved and one day to solve C and D question.</p><p><strong>Topics to Cover</strong></p><p>Contests on platforms like Leetcode, GeeksForGeeks(GFG) and CodeStudio are more based on DSA and not on competitive concepts. So for these contests you should have a good grip on below mentioned topics:</p><ul><li>Arrays</li><li>Linked Lists</li><li>Stack/Queue/Priority Queue</li><li>Trees : Traversal questions and DFS approach are important</li><li>Graphs : Graph algorithms like Dijkstra, Floyd Warshall are important.</li><li>Greedy Algorithm</li><li>Dynamic Programming</li><li>Union Find</li><li>Two Pointer Approach</li><li>Sliding Window</li></ul><p>Hold on Trees, Graphs and Dynamic Programming takes time. These are a bit lengthy topics and need more practice. Refer <a href="https://github.com/Kanav-Arora/DSA-Cpp">https://github.com/Kanav-Arora/DSA-Cpp</a> repository for topic-wise codes to various problems and concepts.</p><p>P.S: First try to solve the problem on your own.</p><p><strong>Don’t Directly Jump to Solution</strong></p><p>This is one the most important point. Directly jumping to the solution makes you handicap and will not improve your problem approachability. First give it a thought and try to dry run your solutions on given testcases. Solve it on a paper and then submit it. Then only you should consider looking the solution. Now most common mistake people make is they prefer text solutions over video solutions but text solutions can’t have that much of understanding. You need to get the intuition of the problem so that you can solve it again on your own.</p><p>Believe me or not, Leetcode problems are same or somewhat similar to the interview problems. So you must solve these if you are appearing for a tech interview.</p><p>Thanks for reading! If you like the article please give it a clap👏 and follow the publication for more such stories. Follow me on <a href="https://www.linkedin.com/in/kanavarora1505/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66e236283b56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/competitive/master-leetcode-contests-3-tips-66e236283b56">Master Leetcode Contests — 3 Tips</a> was originally published in <a href="https://medium.com/competitive">Competitive Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing YouTube Connections using Support Vector Machines]]></title>
            <link>https://kanavarora1515.medium.com/analyzing-youtube-connections-using-support-vector-machines-f2c2a2540bc?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2c2a2540bc</guid>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 13:45:12 GMT</pubDate>
            <atom:updated>2023-04-21T13:49:43.407Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction:</p><p>YouTube has become one of the most popular social media platforms in recent years, with millions of users and videos being uploaded every day. As a result, it has become increasingly important for content creators, marketers, and YouTube analytics professionals to gain insights into the network structure of the platform and identify potential opportunities for collaborations and marketing strategies. The connections between videos and users on YouTube can be represented as a graph, where nodes represent videos or users and edges represent the connections between them. This project aims to use a Support Vector Classification (SVC) model to analyze this graph and predict the number of connections for YouTube channels.</p><p>Dataset Description and Analysis:</p><p>The dataset used in this project was collected from snap.stanford.edu, and it includes information about the relationships between different channels and users on YouTube. The graph consists of 1,134,890 nodes and 2,987,624 edges. Nodes represent either videos or users, and edges represent the connections between them. The graph has been analyzed using various network statistics, including average clustering coefficient, number of triangles, fraction of closed triangles, diameter, and effective diameter. It has also been divided into eight communities, each with an average size of 13.5 nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CVxOnQ6bCKgtzvNAPb1PDQ.png" /></figure><p>Description of Platform/Technologies:</p><p>The graph database management system, Neo4j, was used to work with the data. Neo4j has processed the graph data and produced some sub-graphs, along with filtering out nodes and edges according to different criteria. The machine learning algorithm, Support Vector Classifier, was used to train a model on the graph data to predict the connections of nodes.</p><p>Experimentation, Discussion, and Results:</p><p>The project aimed to perform four tasks, which are as follows:</p><ol><li>Extracting 10 most important nodes in the graph and a subgraph of 1000 nodes with some node probability p.</li></ol><p>The degree of nodes was used to determine the ten most important nodes in the graph. The nodes with the highest degree are more connected to other nodes in the graph, making them more important. The ten most important nodes and their degrees were as follows:</p><ul><li>“363” — 14,507</li><li>“106” — 10,430</li><li>“480” — 4,157</li><li>“384” — 2,971</li><li>“517” — 2,775</li><li>“4” — 2,751</li><li>“104” — 2,710</li><li>“311” — 2,609</li><li>“210” — 2,599</li><li>“341” — 2,391</li></ul><p>A subgraph was also created with 1,000 nodes, where each node had a probability of 0.5 of being included in the subgraph.</p><ol><li>Using Hadoop to implement any recent clustering algorithm and finding labels and render grouping of communities in the graph.</li></ol><p>Hadoop was used to implement a clustering algorithm on the graph to find the labels and render the grouping of communities. The algorithm used was the K-means clustering algorithm. The clustering algorithm was applied to the graph, and each node was assigned a label based on its cluster. The graph was then rendered with the nodes colored according to their labels, highlighting the communities within the graph.</p><ol><li>Performing online analytical processing using any appropriate distributed clustering package for Neo4J.</li></ol><p>Online analytical processing (OLAP) was performed using the distributed clustering package for Neo4J. The aim was to analyze the data in real-time and provide insights into the network structure of the YouTube platform. The distributed clustering package was used to analyze the graph and identify the most connected nodes and communities.</p><ol><li>Applying Support Vector Machine on a distributed environment for link prediction on the stored graph.</li></ol><p>Finally, an SVC model was applied to the graph to predict the number of connections for YouTube channels. The dataset was split into training and testing categories, and the SVC model was applied to the training data. The accuracy of the model was evaluated using various metrics, including accuracy, precision, recall, and F1-score. The model achieved an accuracy of 93.4%, indicating that it was successful in predicting the number of connections for YouTube</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3M1JmiHeQkN-kykh9VdTA.png" /></figure><p>Conclusion:</p><p>This project has demonstrated the usefulness of machine learning in analyzing complex social networks and providing insights into the structure and dynamics of the YouTube community. The analysis of the YouTube graph has identified the most important nodes in the network and provided a deeper understanding of the network structure. The results of this project can be beneficial for content creators, marketers, and YouTube analytics professionals as they can use the insights to identify potential opportunities for collaborations and marketing strategies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2c2a2540bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Statistical Inference With Python — Stock Visuals]]></title>
            <link>https://kanavarora1515.medium.com/statistical-inference-with-python-stock-visuals-9d1e51b82447?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d1e51b82447</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Fri, 10 Dec 2021 12:15:36 GMT</pubDate>
            <atom:updated>2021-12-10T12:15:36.119Z</atom:updated>
            <content:encoded><![CDATA[<h3>Statistical Inference With Python — Stock Visuals</h3><p>I am attending online classes, while I know most of you are chilling with your friends, living your college life. So I was working on a python project with my friend Shivam Bhatt. Ok, enough of casual talking let’s dive deep into the project.</p><p>Stock Visuals is python based GUI application that retrieves data from various sources using rest APIs. Retrieved data can be plotted to visualise stock movements. Stock visualiser provides some technical indicators which help in stock price prediction. Indicators are plotted on a graph using Matplotlib (python graphical library). Data is manipulated to get useful information using NumPy and pandas. It predicts the future price of a stock from statistical inferences of data. These inferences are done using technical analysis. Stock Visual analyse data with two indicators.</p><p><strong>Support Resistance Indicator</strong></p><p>Past data of stock consists of various critical points. These critical points can be categorised as maxima, minima or points of inflexion. These maxims/minimal can act as support or resistance.</p><p>Support is a price level where a downward trend will pause and bounce back to change its direction.</p><p>Resistance is a price level where an upward trend will pause and bounce back to change its direction.</p><p>Below snapshot from the project explains this concept:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Ir20NfJ3jJPbD6RzxVYtA.png" /></figure><p><strong>Williams %r</strong></p><p>It is a momentum indicator that moves between 0 and -100 and measures <a href="https://www.investopedia.com/terms/o/overbought.asp">overbought</a> and <a href="https://www.investopedia.com/terms/o/oversold.asp">oversold</a> levels. A reading above -20 depicts overbought and a reading below -80 depicts oversold.</p><p>The formula for Williams %r:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*P4IHBPE396v2RpPUDltjCg.png" /></figure><p>Below snapshot from the project explains this concept:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFfS-f1IMxj0qtb9KswjMg.png" /></figure><p><strong>Modules used:</strong></p><ul><li>Tkinter</li><li>PIL</li><li>pandas</li><li>NumPy</li><li>yfinance</li><li>matplotlib</li><li>webbrowser</li><li>pandas_ta</li><li>datetime</li><li>mplfinance.original_flavor</li><li>plotly.graph_objects</li></ul><p>We are open to contributions. We want to contribute more to this open-source community. You can check out our <a href="https://github.com/Kanav-Arora/Stock-Visuals">GitHub repo</a> for the contribution guide. Don’t forget to star and fork the repo ❤️</p><p><strong>Contribution:</strong></p><ul><li>Kanav Arora — <a href="https://linktr.ee/kanavarora">https://linktr.ee/kanavarora</a></li><li>Shivam Bhatt — <a href="https://linktr.ee/_Shivam_">https://linktr.ee/_Shivam_</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d1e51b82447" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database Structuring and Project Planning]]></title>
            <link>https://kanavarora1515.medium.com/database-structuring-and-project-planning-7da47713e1fa?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/7da47713e1fa</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[dbms]]></category>
            <category><![CDATA[gist]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Tue, 05 Oct 2021 14:30:42 GMT</pubDate>
            <atom:updated>2021-10-05T14:30:42.720Z</atom:updated>
            <content:encoded><![CDATA[<p>A project is divided into different timelines and this timeline structure is same for companies as well as for individual developers. The first stage of the timeline is <strong>Project Structuring</strong>. Project Structuring consists of frame planning, task division, data categorization, database structure mapping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dn5EkeXlZ40Ihd4TkqZeKQ.png" /></figure><h4>Project Structure</h4><p>Firstly you need to decide the different frames in which your project will be divided. The data will be taken as input from each frame. You need to decide the elements in each frame. The best way is to use wireframing. In wireframing, you can link different frames and make a reference UI for the app/website.</p><p>Wireframing article: <a href="https://www.geeksforgeeks.org/wireframe-in-ux-design-a-beginners-guide/">https://www.geeksforgeeks.org/wireframe-in-ux-design-a-beginners-guide/</a></p><p>Credits: <a href="https://github.com/mydraft-cc/ui">https://github.com/mydraft-cc/ui</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NXD05aVj_zfjjcU5J3H8A.png" /></figure><h4>Data Categorization</h4><p>Now you need to figure out the data type of the input and output data in each frame. During development, you need to typecast the data based on what you are taking as input and storing in the database or what you are retrieving from the database and displaying on the screen.</p><h4>Database Structure</h4><p>In the next step, you need to structure your database, decide the entities and their data types. Structuring of databases can be done on <a href="https://dbdiagram.io/home">https://dbdiagram.io/home</a>. The structured mapping of databases is called a DB Diagram. You can link different tables, set columns as not null, unique, primary key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L9kFfihPrksu5C434yy4Xw.png" /></figure><p>Above is the DB Diagram of my project <a href="https://github.com/Kanav-Arora/Financify">Financify</a>.</p><p>It consists of 6 tables and each table consists of multiple entities. Different entities can be linked with each other.</p><p>This diagram can be created by simply writing column names in curly braces.</p><p><strong>Here’s the code for this diagram.</strong></p><p><a href="https://gist.github.com/Kanav-Arora/9e47dea90760802e432552ee40e8bf46">Financify.dbml (Gist)</a></p><p>You can use <a href="https://dbdocs.io/docs">dbdocs.io</a> to create database documentation, for instance, refer:</p><p><a href="https://dbdocs.io/kanavarora1515/Financify?view=table_structure">https://dbdocs.io/kanavarora1515/Financify?view=table_structure</a></p><h4>Development</h4><p>Now the development phase begins… Db Diagram will help you to give a broader picture of your project. This will give you an idea of the data type you are working with and the data type required for the database.</p><p>This DB Diagram can be added to the documentation of your project. So that people who are unaware of your project can get an overview of your backend workflow.</p><p>You can refer to this GitHub repository for project documentation:</p><p><a href="https://github.com/Kanav-Arora/Financify">https://github.com/Kanav-Arora/Financify</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7da47713e1fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Structural Pattern Matching in Python]]></title>
            <link>https://kanavarora1515.medium.com/structural-pattern-matching-in-python-519216bb14f4?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/519216bb14f4</guid>
            <category><![CDATA[switch]]></category>
            <category><![CDATA[patterns]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 18:05:21 GMT</pubDate>
            <atom:updated>2021-06-13T18:05:21.046Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHFgDiIDrxvmKMz7x8eeFg.png" /></figure><p>Python is a very efficient language but some of the features are not in python. Python 3.10 is feature-packed. Unlike other languages such as Java, Python doesn’t have a switch/case statement.</p><p>In v3.10, python developers have introduced “Structural Pattern Matching”, we know it as switch/case statements. In the official 3.10 release notes the feature is named “Structural Pattern Matching”, it can be found in <a href="https://www.python.org/dev/peps/pep-0634/">PEP 634</a> (latest).</p><p>Value can be provided in a pattern matching statement and it will be matched with several cases. Output statements are executed based on the case match.</p><p><strong>Syntax:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*88xqYQ8iTAHv-I8ZG5SxAQ.png" /></figure><p>Here input value will be matched with each case pattern, in case no case matches, a wildcard case will be executed.</p><p><strong>Note:</strong> Wildcard case is optional.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*8HkOuBRycTtxJGHPYNSt6Q.png" /></figure><p>Output:</p><pre>GeeksForGeeks</pre><p><strong>Note:</strong> To run the code you require latest python setup.</p><p><strong>Same logic with if-else:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*7zDXsAHTsVLXhj_BnzdoWA.png" /></figure><p>Output:</p><pre>GeeksForGeeks</pre><p>You can combine several cases in one by using <strong>|</strong> (“or”)</p><pre>case &quot;read&quot; | &quot;write&quot; | &quot;learn&quot;:<br>    print(&quot;GeeksForGeeks&quot;)</pre><p><strong>Patterns with literal or variable:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8toyZQKdQtUlhkli9nKGHg.png" /></figure><p>Output:</p><pre>Sum = 11</pre><h4>Importance of Structural Pattern Matching:</h4><p>- It makes the code more readable and clean</p><p>- With the use of pattern matching, checking a large number of test cases become very easy.</p><p>- Pattern matching is faster than multiple if-else blocks.</p><p>For more deep knowledge such as pattern grouping, pattern sequence and values, you can refer to the official documentation: <a href="https://www.python.org/dev/peps/pep-0634/">PEP 634</a>.</p><p>Show some ❤️ by following me and if you like the article please give it a clap. To connect with me on other platforms visit my linktree: <a href="https://linktr.ee/kanavarora">https://linktr.ee/kanavarora</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=519216bb14f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ambiguities in Java]]></title>
            <link>https://kanavarora1515.medium.com/ambiguities-in-java-e3e35f4ff38f?source=rss-87ace3ff4516------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3e35f4ff38f</guid>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ambiguity]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Kanav Arora]]></dc:creator>
            <pubDate>Fri, 11 Jun 2021 13:52:31 GMT</pubDate>
            <atom:updated>2021-06-11T13:52:31.272Z</atom:updated>
            <content:encoded><![CDATA[<p>Java was founded in 1991, it has evolved a lot but still, Java has some ambiguities. Ambiguities are the vagueness in some concepts. Some concepts are not well defined and they have multiple interpretations. Java is mainly derived from C++ and C. Unlike C++, Java is exclusively object-oriented. These ambiguities give different results when run on different compilers. This shows that while writing the compiler all of them have different thinking and approaches for the same issues. Some of the ambiguities are mentioned below:</p><h4>VarArgs in java</h4><p>When using Varargs, method overloading is possible but invoking an empty function compiler will give an ambiguity error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*AZnJJfShrr1_GIw3VNUwng.png" /></figure><p>Output:</p><pre>prog.java:27: error: reference to testFun is ambiguous<br>        testFun();<br>        ^<br>  both method testFun(int...) in Test and method testFun(boolean...) in Test match<br>1 error</pre><h4>Varargs with other parameters</h4><p>When using parameters with varargs while invoking a method may give error in some cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*3Hsv90WSoMGmrIIn7XIcAQ.png" /></figure><p>Output:</p><pre>prog.java:30: error: reference to testFun is ambiguous<br>                           + testFun(1, 4, 6, 8));<br>                             ^<br>  both method testFun(int...) in Test and method testFun(int,int...) in Test match<br>1 error</pre><p>In the above code there are two methods with int as return type.</p><p>- In first method varargs is the only parameter passed</p><p>- In the second method int and varargs are the parameters.</p><p>Now while invoking the method for e.g testFun(4, 6, 8, 10), the compiler is unable to identify whether the first parameter is from varargs or int. There is an ambiguity whereas if the first parameter is of different data type the code will work perfectly fine.</p><h4><a href="https://www.geeksforgeeks.org/java-and-multiple-inheritance/">Multiple Inheritance</a></h4><p>Unlike C++ and python, java doesn’t support multiple inheritance because it leads to the <a href="https://www.geeksforgeeks.org/java-and-multiple-inheritance/">Diamond problem</a>. But java does support multiple inheritance but only with interfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*8sqM8qDYkJwUQVTeWwe1MA.png" /></figure><p>Output:</p><pre>prog.java:26: error: &#39;{&#39; expected<br>public class D extends B, C {</pre><h4>Method Invocation</h4><p>Method invocation may give an error of ambiguous reference of methods. Method invocation errors arise when there is both an inherited instance and a local instance at the time of invocation. Furthermore, the methods must be invoked with the widening conversion of parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*u_dMHrHepUzUKbCD2frFnA.png" /></figure><p>Output:</p><pre>N.m(short x)<br>N.p(C x)</pre><p>Outputs of these ambiguities may differ with different compilers. Java consists of some other ambiguities in core concepts such as security, multithreading, concurrency but they are advanced topics and are not covered in this article.</p><p>Show some ❤️ by following me and if you like the article please give it a clap. To connect with me on other platforms visit my linktree: <a href="https://linktr.ee/kanavarora">https://linktr.ee/kanavarora</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3e35f4ff38f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>