<?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 Vidhi Goyal on Medium]]></title>
        <description><![CDATA[Stories by Vidhi Goyal on Medium]]></description>
        <link>https://medium.com/@vidhi.goyal1812?source=rss-bbd44cf4d5fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GVeMkEfkZuu1CTpm</url>
            <title>Stories by Vidhi Goyal on Medium</title>
            <link>https://medium.com/@vidhi.goyal1812?source=rss-bbd44cf4d5fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 06:17:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vidhi.goyal1812/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[Is AI Making Us Dumber?]]></title>
            <link>https://medium.com/@vidhi.goyal1812/is-ai-making-us-dumber-0d35fb90658c?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d35fb90658c</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 12:17:54 GMT</pubDate>
            <atom:updated>2026-02-23T12:17:54.289Z</atom:updated>
            <content:encoded><![CDATA[<h3>Is AI Making Us Dumber? How Artificial Intelligence Is Slowly Destroying Human Thinking, Creativity, and Education</h3><h4>The uncomfortable truth about what happens to your brain when you let a machine do your thinking for you</h4><p>You are sitting at your desk. A question pops into your head — not a hard one. Maybe a word you’re looking for. Maybe a simple math calculation. Maybe an idea you want to develop. And before your brain even has the chance to <em>try</em>, your fingers are already typing it into ChatGPT.</p><p>It takes three seconds to get an answer. You move on.</p><p>You don’t think much of it. It’s just a tool, you tell yourself. Everyone uses it. It saves time.</p><p>But here’s what you didn’t notice: your brain just missed an opportunity to work. To stretch. To build a connection it might never build again. And if that moment repeated itself ten times a day — which, for many people, it already does — something quietly begins to erode.</p><p>This article is about that erosion. It’s about what is actually happening to human minds, human creativity, human education, and human intelligence in the age of artificial intelligence — backed by real research, real facts, and a reality most people aren’t comfortable looking at directly.</p><h3>The Numbers First: How Deep Is Our AI Dependency?</h3><p>Before we talk about what AI is doing to our brains, let’s understand the scale of what we’re dealing with.</p><p>ChatGPT reached 100 million monthly active users within just two months of launching in late 2022 — faster than any technology in modern history, including the internet and the personal computer. By 2025, more than 4 billion prompts are being issued every single day across major AI platforms. The global AI market is valued at approximately $244 billion in 2025 and is projected to exceed $800 billion by 2030.</p><p>More than 73% of organizations worldwide are now using or piloting AI in core functions. And in schools — the place where human minds are supposed to be trained and developed — the numbers are staggering: 85% of teachers and 86% of students used AI tools during the 2024–25 school year, according to a report by the Center for Democracy and Technology. Just a year earlier, only about 40% of K-12 teachers were using AI at all.</p><p>The adoption is not gradual. It is a flood.</p><p>And when something this powerful becomes this widespread this fast, the question we have to ask — the question most tech enthusiasts don’t want to answer — is: <em>what are we losing?</em></p><h3>What Happens to Your Brain When You Stop Using It</h3><p>Let’s start with the science, because it’s more alarming than most people realize.</p><p>The human brain operates on a fundamental principle: <em>use it or lose it.</em> Every time you work through a problem, recall a memory, wrestle with a difficult idea, or push through creative frustration, your neurons form and strengthen connections. The technical term is neuroplasticity — the brain’s ability to reorganize itself by forming new neural connections based on what you do and experience. It is one of the most remarkable features of the human mind.</p><p>The flip side is equally real. When neural pathways are not used, they weaken. When cognitive tasks are repeatedly offloaded to external tools — whether that’s a GPS instead of a mental map, a calculator instead of mental arithmetic, or an AI chatbot instead of independent reasoning — the brain’s capacity for those tasks physically degrades. Researchers call this <em>cognitive atrophy</em>, and it’s not a future concern. It is happening right now.</p><p>A 2025 study published in the journal <em>Societies</em> found that heavy AI usage leads to significant cognitive offloading — a state in which individuals transfer decision-making and memory tasks to machines, resulting in measurable weakening of those cognitive abilities over time. Another study from the same year, presented at the CHI Conference on Human Factors in Computing Systems — one of the most prestigious technology and human-computer interaction conferences in the world — found that knowledge workers using generative AI tools reported consistent self-perceived reductions in cognitive effort and critical thinking engagement across a wide range of professional tasks.</p><p>Think about what that means in plain language: the people using AI every day are aware, on some level, that they are thinking less hard. They just keep doing it anyway.</p><p>This is not new territory. Research has already documented how GPS navigation degraded our spatial memory and our ability to mentally map environments. Studies have shown that our reliance on search engines has fundamentally changed how we store and recall information — a phenomenon dubbed the “Google Effect,” in which people are more likely to remember <em>where</em> to find information than the information itself. Social media’s pivot to short-form content has been linked to measurably shortened attention spans.</p><p>AI is all of those things simultaneously — applied not just to memory or navigation or attention, but to reasoning, writing, creativity, problem-solving, analysis, and judgment. It is the broadest, deepest cognitive outsourcing in human history. And we have barely begun to measure the consequences.</p><h3>The Creative Mind Is Being Quietly Switched Off</h3><p>Creativity is perhaps the most sacred of human cognitive abilities. It is what separates us from every other species on earth. It is the source of every great painting, every scientific breakthrough, every piece of literature, every architectural wonder, every innovation that has ever improved human life. And it is precisely what AI threatens most.</p><p>A 2024 study published in the journal <em>Science Advances</em> found something deeply unsettling: while generative AI enhances individual creative output in the short term, it simultaneously reduces the <em>collective diversity</em> of novel content. In other words, when everyone uses AI to generate ideas, the ideas start to look the same. The rich, chaotic, unpredictable ecosystem of human creativity begins to converge toward a single point — the average of everything that has already been created.</p><p>This makes intuitive sense when you understand how AI works. Large language models like ChatGPT are trained on vast archives of existing human output. They are extraordinarily sophisticated at synthesizing, remixing, and recombining what already exists. But they cannot imagine what has <em>never</em> existed. They can only generate variations on what came before. They are, in the truest sense, engines of the average.</p><p>Human creativity — real, original, disruptive creativity — doesn’t come from the average. It comes from an individual mind that has lived experiences, felt specific emotions, encountered specific failures, developed a specific voice over time, and struggled through enough problems that it begins connecting things in ways that no one has connected before. It comes, critically, from <em>the struggle itself.</em></p><p>Research published in 2025 in <em>Communications Biology</em> confirms that creative ability is strongly linked to dynamic switching between multiple brain networks — particularly the default mode network, associated with imagination and daydreaming, and the executive control network, associated with focused attention. Creativity is not a talent. It is a trained behavior. It emerges from brains that have been repeatedly challenged, frustrated, and forced to find their own solutions.</p><p>When you outsource the early stages of creative work to AI — when you skip the blank page, the difficult brainstorm, the frustrating draft that doesn’t work — you are not just skipping inconvenient steps. You are skipping the neural exercise that builds the capacity for genuine creativity. You get an output. You lose the growth.</p><p>Worse, creative thinking ability has dropped by roughly 30% over the past five years — a decline that researchers are increasingly linking to the rise of AI and screen-based cognitive delegation. That is not a trivial number. That is nearly a third of the creative capacity of the average person, gone, in half a decade.</p><h3>The Thinking That Only Happens When You’re Stuck</h3><p>There is a particular kind of cognitive experience that has no name in everyday language, but that every great thinker has described in some form. It happens when you are bored. When you are waiting. When you have a problem you can’t immediately solve and you have no choice but to sit with the discomfort of not knowing.</p><p>In that space — that quiet, restless, sometimes frustrating space — your brain does something remarkable. It wanders. It makes connections between unrelated things. It surfaces old memories and applies them to new problems. It dreams up solutions that arrive seemingly from nowhere, the way answers come to you in the shower or on a long walk or right before you fall asleep.</p><p>Neuroscientists call this the default mode network — a cluster of brain regions that activates specifically when you are <em>not</em> focused on an external task. Far from being idle, the brain in this state is performing some of its most sophisticated cognitive work: integrating experiences, consolidating learning, generating creative insights, developing empathy and self-awareness.</p><p>We are systematically destroying this space.</p><p>Every moment of uncertainty, every moment of “I don’t know the answer,” every moment of uncomfortable cognitive friction — is now a moment where AI is one tap away. And people are taking that tap. The default mode network is being starved of the conditions it needs to do its most important work. The silence that used to produce ideas is being filled with instant answers.</p><p>The consequences go even deeper than creativity. When you have never struggled to do something yourself, you lose the ability to evaluate whether someone else — or some AI — is doing it well. If you have never wrestled with writing, how do you know if an AI-generated paragraph is excellent or merely plausible? If you have never worked through a complex analysis, how do you identify when an AI’s conclusion is flawed?</p><p>We are producing something genuinely dangerous: a population that is highly confident in AI-generated outputs and increasingly incapable of critically evaluating them. A 2024 study found that when people used AI assistance on LSAT-style logic problems, they scored higher — but they <em>significantly overestimated their own performance</em> and their own understanding. The AI made them feel smarter while making them worse at actually thinking. That gap — between perceived competence and real competence — is one of the most concerning findings in AI cognition research today.</p><h3>What Is Happening in Classrooms Right Now</h3><p>The most urgent case study for AI’s cognitive impact is happening in schools, where the stakes are highest and the evidence is most visible.</p><p>In the 2024–25 school year, 85% of teachers and 86% of students in the United States used AI tools for academic purposes, according to the Center for Democracy and Technology. That adoption rate would be exciting if the outcomes were purely positive. But the same report found that 70% of teachers worry that AI is weakening students’ critical thinking and research skills. Half of students themselves agreed that using AI in class makes them feel less connected to their teachers. Forty-seven percent of teachers and 50% of parents reported concerns about declining peer-to-peer connection as a result of AI use.</p><p>Research published in <em>Frontiers in Psychology</em> in 2025 introduced a clinical concept to describe what is happening: “cognitive offloading” among students — a condition in which students who rely heavily on AI demonstrate measurable declines in analytical reasoning and decreased study motivation. Younger students, the research found, are particularly vulnerable to these cognitive outsourcing effects due to developmental factors. Their brains are still being formed. The neural habits they build now will define their intellectual capacity for the rest of their lives.</p><p>A 2025 survey of Gen Z found that about half of young people aged 13–28 believe AI will harm their ability to think critically about information. They sense it. They are watching it happen to themselves — and they keep using it anyway, because the short-term convenience is too compelling, and because no one has yet built the structures or habits to help them resist.</p><p>The deeper issue is what education is actually <em>for.</em> An essay assignment is not about the essay. The essay is evidence that a process happened — a process in which a student identified a position, organized evidence, constructed an argument, encountered weaknesses in their own reasoning, revised, and produced something that did not exist before. That process is where learning lives. The essay is just the receipt.</p><p>When a student uses AI to write their essay, they skip every step of that process. They have the receipt without the transaction. The grade may be the same. The education is not.</p><p>Making this worse: only 14% of public K-12 schools in the US had taught students about ethical or appropriate AI use as of late 2024. Only 12% of students had received guidance on what AI even is and how it works. The technology has flooded in while the frameworks to use it wisely have barely existed. The result is a generation navigating one of the most powerful cognitive tools ever created with almost no training and almost no guardrails.</p><h3>The Lazy Mind: How AI Enables the Path of Least Resistance</h3><p>Human beings are, by design, cognitive misers. We are wired to conserve mental energy, to take shortcuts, to choose the path of least resistance whenever we can. This is not a character flaw — it was an adaptive survival strategy for most of human history, when cognitive resources were genuinely scarce and needed to be preserved for real challenges.</p><p>The problem is that this tendency now operates in an environment where effortless cognitive shortcuts are available for everything, all the time, instantly. And AI has made the path of least resistance in intellectual life almost irresistibly smooth.</p><p>Why spend twenty minutes brainstorming when you can get fifty ideas in ten seconds? Why write a difficult email when AI can draft it in one? Why work through a complex problem when you can describe it to a chatbot and get a solution in moments? Why develop a skill over years when a tool can approximate that skill immediately?</p><p>Each individual shortcut seems rational. The cumulative effect is a mind that has forgotten how to extend itself. Research confirms this: a 2025 systematic review published in <em>Smart Learning Environments</em> found that over-reliance on AI dialogue systems leads to measurable declines in students’ cognitive abilities — specifically in the areas that require sustained effort: deep analysis, original reasoning, and creative problem construction.</p><p>There is also a psychological dimension that researchers are beginning to document. Some students report experiencing what is being called “AI guilt” — a sense of inauthenticity, a gnawing feeling that they haven’t truly done the work, a quiet erosion of self-efficacy that comes from repeatedly watching a machine do what they were supposed to do themselves. This isn’t just about academic honesty. It’s about identity. It’s about the belief — or the growing disbelief — that your own mind is capable, valuable, and worth using.</p><p>When a person stops believing their own thinking has value, they stop investing in it. And when they stop investing in it, they confirm the belief. It becomes a self-fulfilling cycle of intellectual withdrawal.</p><h3>The Memory We Are No Longer Building</h3><p>Memory is not simply a filing cabinet where you store facts. It is the substrate of intelligence itself. Every insight you have ever had, every creative connection you have ever made, every piece of judgment you have ever exercised — these were all built on a foundation of accumulated, personally processed memory. Memory is the soil in which understanding grows.</p><p>We have been eroding our relationship with memory for decades — first with phone books, then with GPS, then with Google. Research has already established what is known as the “Google Effect”: the tendency to not encode information into memory because we know it can be retrieved externally at any time. Why remember the answer when you can remember where to find it?</p><p>AI accelerates this to an extreme degree. It is not merely a repository for information. It reasons with that information, synthesizes it, applies it, and delivers conclusions. There is almost no cognitive task for which AI cannot serve as a substitute. Which means there is almost no incentive — from a pure efficiency standpoint — to develop any of these capacities yourself.</p><p>And yet the person who <em>knows</em> things — who has genuinely internalized knowledge, who carries facts, frameworks, and patterns in their own mind — thinks differently from the person who merely knows how to look things up. They make connections faster. They recognize patterns in new situations. They generate hypotheses unprompted. They catch errors immediately. They are, in the truest sense, smarter — not because of any innate advantage, but because of what they have built through years of genuine cognitive engagement.</p><p>The mind that has been outsourcing its thinking to AI for five years will not have that foundation. It will have something else: speed of retrieval and shallow confidence in outputs it cannot truly evaluate. That is a deeply impoverished substitute for actual intelligence.</p><h3>What We Are Actually at Risk of Losing as a Society</h3><p>Step back from the individual and look at the civilization-level picture for a moment.</p><p>Every major human advance — in science, medicine, philosophy, art, governance, engineering — was the product of minds that had been trained, through genuine intellectual labor, to think in ways that were powerful, original, and rigorous. The people who made those advances were not simply born smart. They had built their intelligence over years of hard cognitive work. They had read deeply, argued intensely, failed repeatedly, and developed a genuine relationship with the difficulty of ideas.</p><p>That is what produces paradigm shifts. That is what produces the discoveries that change everything. Not the incremental optimization of what already exists — which is what AI excels at — but the radical reimagination of what is possible, which requires a kind of mind that has been forged in genuine struggle.</p><p>If we raise a generation that outsources its thinking from childhood, we will produce people who are very efficient consumers of AI-generated outputs. We will not produce the next generation of thinkers who see what no one else has seen because they have trained themselves to see it.</p><p>The most dangerous thing about this trajectory is that we will not see the loss clearly until it has already happened. The signs are subtle. The student’s essay still gets submitted. The professional’s report still gets filed. The creative project still gets completed. Everything looks fine — until the moment when we need genuine human insight, unprecedented and rigorously reasoned, and we discover that the minds capable of producing it have grown uncomfortably rare.</p><h3>This Is Not Anti-AI — It’s Pro-Human</h3><p>It is important to be absolutely clear: this article is not arguing that AI is bad. It would be dishonest to pretend otherwise. AI is genuinely extraordinary. In medicine, it is helping detect cancers earlier than human doctors can. In climate modeling, it is processing systems of staggering complexity. In accessibility, it is giving voice to people who could not speak and sight to systems that could not see. The people who learn to use it thoughtfully will be enormously capable.</p><p>The argument here is about <em>relationship</em>. The relationship between human minds and AI tools matters enormously, and the current default relationship — reflexive, indiscriminate, effortless delegation — is harmful to human cognitive development in ways we can now measure and must take seriously.</p><p>The discipline that matters is this: bring your own mind to the problem <em>first.</em> Write the messy first draft yourself. Struggle with the calculation. Sit with the question that doesn’t have an obvious answer. Exhaust your own thinking before you ask the machine to think for you. Then — <em>then</em> — use AI to refine, expand, check, and accelerate. Not to replace the cognitive work that was supposed to happen in your head.</p><p>This is not inefficiency. This is investment. You are investing in the neural capacity that will allow you to be genuinely intelligent, not just to appear intelligent because you have a good tool. You are building the foundation that allows you to use AI well rather than being used by it.</p><p>Protect your cognitive friction. The discomfort of not knowing is not a problem to be eliminated. It is the condition under which your mind actually grows.</p><p>The most valuable skill in an AI-saturated world will not be the ability to write the best prompt. It will be the ability to think deeply, independently, creatively, and critically — without one. That is what no tool can give you. It is what only you can build, through the irreplaceable work of actually using your own mind.</p><p>The time to build it is not when AI has already replaced everything. The time is now, while you still have the choice.</p><h3>The Bottom Line — Real Facts You Should Know</h3><p>Here is everything, plainly stated, so you can’t say you didn’t know:</p><p><strong>Creative thinking ability has dropped approximately 30% over the past five years.</strong> Researchers link this decline directly to the outsourcing of cognitive effort to AI and digital tools.</p><p><strong>70% of teachers believe AI is already weakening students’ critical thinking and research skills.</strong> This is the majority view of the professionals who observe young minds developing every single day.</p><p><strong>Students who relied on AI for problem-solving scored higher on tests but significantly overestimated their own understanding.</strong> The tool made them perform better while making them understand less — a gap that grows more dangerous over time.</p><p><strong>Cognitive offloading — the transfer of reasoning to external machines — measurably weakens the cognitive abilities being offloaded.</strong> This is established neuroscience, not speculation.</p><p><strong>Only 14% of US public schools taught students about appropriate AI use as of 2024.</strong> The technology is everywhere. The wisdom to use it well is almost nowhere.</p><p><strong>AI is extraordinarily good at the average.</strong> It synthesizes what has already been created. Everything truly new — every breakthrough, every original insight, every genuinely creative act — still has to come from a human mind willing to struggle toward something that doesn’t yet exist.</p><p>You are that mind. The only question is whether you are still keeping it sharp.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d35fb90658c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transformer Architecture: The AI Revolution You Didn’t Know Was Running Your Life]]></title>
            <link>https://medium.com/@vidhi.goyal1812/transformer-architecture-the-ai-revolution-you-didnt-know-was-running-your-life-b941f5d9843d?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b941f5d9843d</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[transformer-architecture]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 04:54:38 GMT</pubDate>
            <atom:updated>2026-02-19T04:54:38.775Z</atom:updated>
            <content:encoded><![CDATA[<p>From Google Search to ChatGPT — Here’s Everything You Need to Know About the Technology Reshaping the World</p><p>If you’ve typed a search query into Google today, asked ChatGPT a question, or used Google Translate — you’ve already interacted with a Transformer. Yet most people have no idea what a Transformer actually is, how it works, or why it’s arguably the most important invention in artificial intelligence since the neural network itself.</p><p>Today, we’re going to change that.</p><p>Whether you’re a developer, a curious learner, or someone who just wants to understand what the AI hype is really about — this guide is for you.</p><h3>What Is the Transformer Architecture?</h3><p>The Transformer is a <strong>deep learning model architecture</strong> introduced in 2017 by researchers at Google Brain in a now-legendary paper titled <em>“Attention Is All You Need.”</em></p><p>Before Transformers, the dominant models for processing language were Recurrent Neural Networks (RNNs) and Long Short-Term Memory networks (LSTMs). These models processed words one at a time — sequentially — like reading a sentence word by word without being able to look ahead or look back efficiently.</p><h4><strong>The Transformer broke this limitation entirely.</strong></h4><p>Instead of processing words in order, Transformers process the <em>entire input at once</em>, using a mechanism called <strong>Self-Attention</strong> to understand the relationship between every word and every other word simultaneously.</p><p>Think of it this way: when you read the sentence <em>“The bank by the river was steep”</em>, your brain instantly understands “bank” refers to a riverbank — not a financial institution — because it considers the full context all at once. Transformers do the same thing.</p><h3>The Core Concept: How Does a Transformer Actually Work?</h3><p>Let’s break it down simply without sacrificing accuracy.</p><h3>1. Input Embeddings</h3><p>Raw words are converted into numerical vectors — a language the model understands. Each word becomes a point in high-dimensional space.</p><h3>2. Positional Encoding</h3><p>Since Transformers process all tokens simultaneously, they need to know <em>where</em> each word sits in a sentence. Positional encoding injects order information into each embedding.</p><h3>3. The Encoder</h3><p>The encoder reads and understands the input. It consists of:</p><ul><li><strong>Multi-Head Self-Attention</strong>: Allows the model to focus on different parts of the input for different reasons simultaneously. “Multi-head” means it runs this attention process multiple times in parallel, each head learning different relationships.</li><li><strong>Feed-Forward Neural Network</strong>: Processes the attention output through a standard neural network layer.</li><li><strong>Layer Normalization &amp; Residual Connections</strong>: Stabilize training and allow gradients to flow properly.</li></ul><h3>4. The Decoder</h3><p>The decoder generates the output. It uses:</p><ul><li><strong>Masked Self-Attention</strong>: Looks at previously generated words (but not future ones) during output generation.</li><li><strong>Cross-Attention</strong>: Attends to the encoder’s output to understand the original input while generating.</li></ul><h3>5. Output Layer</h3><p>A final linear layer + softmax converts the decoder’s output into probabilities over the vocabulary, predicting the next word.</p><p><strong>The entire process is parallelizable</strong>, which is why Transformers can be trained on massive datasets orders of magnitude faster than their predecessors.</p><h3>Why Is the Transformer Architecture Used?</h3><p>The Transformer solved problems that had plagued NLP for decades:</p><p><strong>Speed</strong>: Unlike RNNs, which process sequentially, Transformers process data in parallel — dramatically cutting training time.</p><p><strong>Long-range dependencies</strong>: RNNs “forget” context from earlier in a long sequence. Transformers maintain context across the entire sequence via attention.</p><p><strong>Scalability</strong>: Transformers scale beautifully — the more compute and data you throw at them, the better they get. This gave rise to the era of Large Language Models (LLMs).</p><p><strong>Transfer learning</strong>: A Transformer pre-trained on massive data can be fine-tuned for specific tasks with relatively little labeled data — a game changer for industry applications.</p><h3>Where Is the Transformer Architecture Used?</h3><p>You might be surprised just how many things you use daily run on Transformers:</p><p><strong>Natural Language Processing (NLP)</strong> BERT, GPT, T5, LLaMA — every modern LLM is built on the Transformer. This powers chatbots, text summarization, sentiment analysis, and question answering.</p><p><strong>Computer Vision</strong> Vision Transformers (ViTs) apply the same architecture to image patches. They now rival or beat convolutional neural networks (CNNs) on image classification tasks.</p><p><strong>Speech &amp; Audio</strong> Whisper (OpenAI’s speech-to-text) and models like AudioLM use Transformers to understand and generate audio.</p><p><strong>Protein Structure Prediction</strong> AlphaFold 2 — which solved one of biology’s greatest challenges — uses a Transformer-based architecture. This has massive implications for drug discovery.</p><p><strong>Code Generation</strong> GitHub Copilot, Claude, and ChatGPT’s code capabilities are all Transformer-based. They understand programming languages just as they understand human languages.</p><p><strong>Search Engines</strong> Google’s BERT model, integrated into Search in 2019, transformed how Google understands user queries — it’s a direct application of the Transformer.</p><p><strong>Recommendation Systems</strong> YouTube, Spotify, and Netflix use Transformer variants to understand user preferences and recommend content.</p><h3>Why Is the Transformer So Helpful?</h3><p>Let’s be concrete about the real-world impact:</p><p><strong>For Developers</strong>: Transformers eliminate the need to build complex feature engineering pipelines. Pre-trained models like BERT or GPT can be fine-tuned in hours for specific tasks.</p><p><strong>For Businesses</strong>: Customer service chatbots, document summarization, contract analysis, and code review are now automatable at scale with Transformer-powered tools.</p><p><strong>For Researchers</strong>: Drug discovery, climate modeling, genomics, and materials science are being accelerated by Transformer models that can find patterns in complex scientific data.</p><p><strong>For Regular Users</strong>: Every time you get an accurate translation, a smart autocomplete suggestion, or a relevant search result — a Transformer helped make that happen.</p><h3>The Future of Transformer Architecture</h3><p>The original Transformer has already spawned an entire family of variants:</p><p><strong>BERT</strong> (Bidirectional Encoder Representations from Transformers) — encoder-only, great for understanding tasks.</p><p><strong>GPT series</strong> (Decoder-only) — optimized for generation tasks, culminating in GPT-4 and beyond.</p><p><strong>T5</strong> (Text-to-Text Transfer Transformer) — frames every NLP task as text-to-text.</p><p><strong>Vision Transformer (ViT)</strong> — brings Transformers to images.</p><p><strong>Multimodal Transformers</strong> — models like GPT-4V and Gemini that process text, images, audio, and video together.</p><p>The trajectory is clear: Transformers are becoming the <strong>universal architecture</strong> for machine learning across nearly every domain. Researchers are now exploring sparse attention, linear attention, and state-space models (like Mamba) as potential successors — but for now, Transformers remain firmly at the throne.</p><h3>Key Takeaways</h3><p>The Transformer is not just another ML architecture — it’s the foundational technology powering the AI revolution. Here’s what to remember:</p><ul><li>Introduced in 2017, it replaced sequential RNNs with parallel, attention-based processing.</li><li>The <strong>self-attention mechanism</strong> is its superpower — letting models understand context across entire sequences.</li><li>It’s used in everything: language, vision, audio, science, and code.</li><li>You can start using it today via Hugging Face’s transformers library or cloud APIs — no PhD required.</li><li>It scales with compute, which is why companies are spending billions building larger and larger models.</li></ul><p>Understanding the Transformer isn’t just academic trivia — it’s becoming essential literacy for anyone working in technology, business, or any field touched by AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b941f5d9843d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAG Everywhere: Day 1 of My Journey into Retrieval-Augmented Generation]]></title>
            <link>https://medium.com/@vidhi.goyal1812/rag-everywhere-day-1-of-my-journey-into-retrieval-augmented-generation-691b7ec41f95?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/691b7ec41f95</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[hallucinations]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[ai-engineer]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 06:56:08 GMT</pubDate>
            <atom:updated>2026-01-12T06:56:08.055Z</atom:updated>
            <content:encoded><![CDATA[<p><em>If fine-tuning was my first instinct, RAG became my first real realization.</em></p><h3>Why This Series?</h3><p>These days, almost every GenAI discussion ends with the same advice:</p><blockquote><strong><em>“Just use RAG.”</em></strong></blockquote><blockquote>Whether the question is:</blockquote><ul><li><em>How do we reduce hallucinations?</em></li><li><em>How do we make LLMs answer from our own data?</em></li><li><em>How do we build AI systems that actually work in production?</em></li></ul><p>The answer is always the same.</p><p>But here’s the problem 👇<br> Most explanations jump straight into <strong>tools and buzzwords</strong>:</p><ul><li>Vector databases</li><li>Embeddings</li><li>Pipelines and frameworks</li></ul><p>Very few explain <strong>why RAG exists in the first place</strong>.</p><p>So this series starts from the basics — <br> not from tools, but from <strong>first principles</strong>.</p><p>Welcome to <strong>Day 1 of my RAG journey</strong>.</p><h3>First Things First: What Is RAG?</h3><p><strong>RAG (Retrieval-Augmented Generation)</strong> is a technique where:</p><blockquote><em>A Large Language Model does not rely only on its internal training data,<br> but </em><strong><em>retrieves relevant external information first</em></strong><em>,<br> and then generates an answer using that context</em></blockquote><h3>In simple words:</h3><p>🧠 <strong>LLM + Retrieval + Context = More reliable answers</strong></p><p>A Simple Example (Without RAG vs With RAG)</p><h3>Without RAG</h3><p>You ask an LLM:</p><p><em>“What is our company’s leave policy?”</em></p><p>The model:</p><ul><li>Has never seen your internal documents</li><li>Guesses based on general knowledge</li><li>Sounds confident</li><li>May be completely wrong</li></ul><h3>With RAG</h3><p>The system:</p><ol><li>Searches your internal HR documents</li><li>Retrieves the relevant section</li><li>Passes that text to the LLM</li><li>The LLM answers <strong>only using that content</strong></li></ol><p>👉 The result: <strong>accurate, grounded, and auditable answers</strong></p><h3>The Core Problems RAG Solves</h3><p>LLMs are powerful, but they have <strong>three fundamental limitations</strong>.</p><h3>1️⃣ Static Knowledge</h3><p>LLMs are trained on data up to a fixed point in time.</p><p>They do <strong>not</strong> know:</p><ul><li>Your company’s internal documents</li><li>Your private APIs</li><li>Yesterday’s updates</li></ul><p>From the model’s perspective, this information simply <strong>does not exist</strong>.</p><h3>2️⃣ Hallucinations</h3><p>When an LLM does not know the answer, it often:</p><ul><li>Responds confidently</li><li>Produces something that sounds plausible</li><li>But is factually incorrect</li></ul><p>This behavior is called <strong>hallucination</strong>.</p><p>The real issue is not that the model lies — <br> it’s that the model <strong>doesn’t know when it doesn’t know</strong>.</p><h3>3️⃣ No Source of Truth</h3><p>By default, LLMs:</p><ul><li>Do not cite sources</li><li>Do not verify facts</li><li>Rarely say <em>“I don’t know”</em></li></ul><p>This makes them <strong>risky for production systems</strong>.</p><h3>So… Why Not Just Fine-Tune the Model?</h3><p>This is one of the most common questions.</p><p>Fine-tuning sounds attractive, but the reality is different.</p><h3>Problems with Fine-Tuning:</h3><ul><li>Expensive and time-consuming</li><li>Requires large, clean datasets</li><li>Needs retraining when data changes</li><li>Still does <strong>not fully eliminate hallucinations</strong></li></ul><p>Most importantly:</p><p><strong><em>Fine-tuning teaches the model how to speak better,<br> not what it should know right now.</em></strong></p><h3>Why We Choose RAG Over Fine-Tuning</h3><p>With RAG:</p><ul><li>Your data stays outside the model</li><li>You can update knowledge without retraining</li><li>Answers are grounded in retrieved context</li></ul><p>This is why <strong>most real-world GenAI systems use RAG</strong>.</p><h3>What Does “Retrieval” Actually Mean?</h3><p>Retrieval simply means:</p><p><em>Finding the </em><strong><em>most relevant information</em></strong><em> before generating an answer.</em></p><p>This information can come from:</p><ul><li>PDFs</li><li>Databases</li><li>APIs</li><li>Knowledge bases</li><li>Internal company documents</li></ul><p>The model does not guess.<br> It <strong>reads first, then answers</strong>.</p><h3>What Does “Augmentation” Mean?</h3><p>Augmentation means:</p><p><em>Injecting the retrieved information into the model’s prompt.</em></p><p>in simple Words:</p><p><strong>Giving context(retrieved ) along with the prompt and let the output</strong></p><h4>Example:</h4><p>Basic prompt:</p><p><em>“Explain the company leave policy.”</em></p><p>Augmented prompt:</p><p><em>“Based on the following documents, explain the company leave policy.”</em></p><p>This approach:</p><ul><li>Reduces hallucinations</li><li>Improves accuracy</li><li>Makes responses auditable</li></ul><h3>RAG and Hallucinations: The Key Connection</h3><p>Hallucinations occur when:</p><ul><li>The model lacks information</li><li>But is forced to generate an answer anyway</li></ul><p>RAG changes this by:<br> ✔ Providing relevant facts<br> ✔ Limiting unnecessary creativity<br> ✔ Anchoring responses to reality</p><p><strong><em>Less guessing. More knowing.</em></strong></p><h3>A Mental Model That Helped Me</h3><p>Think of RAG as an <strong>open-book exam</strong></p><ul><li>Fine-tuned model → a student who memorized old notes</li><li>RAG-based model → a student who looks up the right page before answering</li></ul><p>Which one would you trust in production?</p><h3>What This Series Will Cover Next</h3><p>In upcoming posts, I’ll dive into:</p><ul><li>How retrieval actually works (without jargon)</li><li>Embeddings explained simply</li><li>Vector databases vs traditional search</li><li>Chunking strategies that truly matter</li><li>Common RAG mistakes nobody talks about</li></ul><h3>Day 1 Takeaway</h3><h4><em>RAG is not just a technique.<br> It’s a mindset for building trustworthy AI systems.</em></h4><p>If you’re building AI that:</p><ul><li>Must be correct</li><li>Must be explainable</li><li>Must work on your own data.</li></ul><p>Then before fine-tuning,<br> <strong>start with RAG.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=691b7ec41f95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Manual Tester to AI/ML Full-Stack Developer: My Career Switch Journey and Lessons Learned]]></title>
            <link>https://medium.com/@vidhi.goyal1812/from-manual-tester-to-ai-ml-full-stack-developer-my-career-switch-journey-and-lessons-learned-91615f9cde6e?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/91615f9cde6e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[career-switch]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Tue, 30 Sep 2025 11:14:34 GMT</pubDate>
            <atom:updated>2025-09-30T11:14:34.872Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>How I switched from a manual tester with no AI background to an AI/ML full-stack developer — my journey, struggles, client success, and lessons.</blockquote><p>It all started in my final year of college, when like every other student, I was preparing day and night for campus placements. I still remember the anxiety in the air — the whispered conversations about which company was hiring, the resumes we polished dozens of times, and the nervous smiles before interviews.</p><p>When my turn came, I landed my first placement as a <strong>manual tester</strong>. For most of my batchmates, this was a moment of celebration. And don’t get me wrong — I was grateful. A job right out of college meant stability and security. But deep inside, I felt an emptiness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4s7Pvq4LduthOOYy67VdXA.png" /></figure><h3>Chapter 1: The Beginning — Life as a Manual Tester</h3><p>On my first day at work, I was handed test cases and asked to execute them. The work was straightforward: follow steps, find bugs, write reports. It gave me discipline and sharpened my attention to detail.</p><p>But after a few weeks, I realized something. I wasn’t <strong>building anything</strong>. The creativity I imagined in software development — the thrill of solving problems and seeing my code come alive — was missing.</p><p>I started asking myself tough questions:</p><ul><li><em>“Is this what I want to do for the next five years?”</em></li><li><em>“Am I capable of more?”</em></li><li><em>“What if I could be the one creating, not just testing?”</em></li></ul><p>That was the first spark that pushed me out of my comfort zone.</p><h3>Chapter 2: A World Called AI/ML</h3><p>During my B.Tech, AI/ML wasn’t my focus. I didn’t belong to any <strong>AI-specific domain</strong>. In fact, I had zero practical knowledge of artificial intelligence.</p><p>But while working as a tester, I saw how <strong>AI was transforming industries — </strong>chatbots replacing support tickets, machine learning predicting user behavior, and computer vision automating tasks once done manually.</p><p>I knew I couldn’t just watch from the sidelines. I wanted to be part of that revolution.</p><p>So I made a promise to myself: <strong>I will learn AI/ML from scratch, no matter how difficult it looks.</strong></p><h3>Chapter 3: Learning in the Dark</h3><p>The early days of self-learning were brutal. After long hours at my job, I would stay up late with <strong>YouTube tutorials, online courses, and free GitHub</strong> projects.</p><p>At first, the concepts felt like an alien language:</p><ul><li>What’s a <strong>neural network</strong>?</li><li>How does a <strong>training dataset</strong> actually work?</li><li>Why is Python the “<strong>language of AI</strong>”?</li></ul><p>There were nights when I wanted to give up. I would stare at code errors for hours, wondering if I had chosen the wrong path.</p><p>But slowly, things started to click.</p><ul><li>Writing <strong>my first machine learning model in Python</strong> felt magical.</li><li>Seeing a chatbot respond correctly gave me confidence.</li><li>Building small<strong> full-stack apps with React, Node.js, and databases </strong>felt like unlocking new superpowers.</li></ul><p>Every small win reminded me why I had started.</p><h3>Chapter 4: Building the Foundation</h3><p>I didn’t jump directly into advanced AI. I built my technical base brick by brick:</p><ul><li><strong>Programming</strong>: Mastering Python, Java, and JavaScript.</li><li><strong>Full-stack development</strong>: Learning how to build applications end-to-end using React, Node.js, and Spring Boot.</li><li><strong>Databases</strong>: Designing efficient structures in MySQL and MongoDB.</li><li><strong>AI/ML basics</strong>: Linear regression, decision trees, NLP, computer vision.</li></ul><p>Instead of rushing, I took time to <strong>understand, practice, and implement</strong>. My GitHub slowly became a reflection of my progress — a library of projects that told the story of persistence.</p><h3>Chapter 5: The Breakthrough — My First AI/ML Client Project</h3><p>Everything I had learned so far was put to the test when I got the opportunity to work on a <strong>client project in AI/ML</strong>.</p><p>I was nervous. This wasn’t a tutorial anymore. A real client was counting on me to deliver results.</p><p>The project required me to:</p><ul><li>Train and integrate AI models.</li><li>Build a working full-stack solution around those models.</li><li>Deliver everything on a tight deadline.</li></ul><p>There were countless challenges: datasets that didn’t fit, models that wouldn’t converge, APIs that failed. I remember one weekend where I worked through the night, determined to make the system run smoothly.</p><p>And then — it worked.</p><p>The client was happy. The system functioned as expected. That project was proof that I had truly transformed from a <strong>manual tester into an AI/ML full-stack developer</strong>.</p><h3>Chapter 6: Lessons Learned on the Journey</h3><p>Looking back, here’s what my journey taught me:</p><ol><li><strong>Every role teaches you something</strong> — Manual testing sharpened my detail-oriented mindset, which became crucial in debugging AI models.</li><li><strong>Self-learning is the biggest skill</strong> — I didn’t wait for a degree or a formal course; I built my own curriculum.</li><li><strong>Real projects matter more than theory</strong> — Applying knowledge to client work changed everything.</li><li><strong>Dedication beats background</strong> — You don’t need to come from an AI-specific domain. Consistency and focus will take you there.</li></ol><h3>Chapter 7: A Message for Those Feeling Stuck</h3><p>If you’re reading this and you feel stuck in a non-technical role — or in a field that doesn’t match your passion — please remember:</p><ul><li>You <strong>can</strong> switch.</li><li>You don’t need a perfect background.</li><li>You don’t need someone else’s permission to start.</li></ul><p>All you need is the courage to take that <strong>first step</strong> and the patience to keep walking.</p><h3>Conclusion</h3><p>Today, I proudly call myself an <strong>AI/ML full-stack developer</strong>. My journey didn’t start in AI, but through discipline, sleepless nights of learning, and hands-on client experience, I made the switch.</p><p>If you’ve been dreaming of a career in AI/ML but feel trapped in your current job, let this story be your sign. Take that first step — you’ll be amazed how far it can lead you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91615f9cde6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Day That Changed My Perspective on Leadership]]></title>
            <link>https://medium.com/@vidhi.goyal1812/a-day-that-changed-my-perspective-on-leadership-385b79fb149a?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/385b79fb149a</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[team-motivation]]></category>
            <category><![CDATA[corporate-employee]]></category>
            <category><![CDATA[team-management]]></category>
            <category><![CDATA[manager]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Wed, 24 Sep 2025 09:52:48 GMT</pubDate>
            <atom:updated>2025-09-24T09:52:48.760Z</atom:updated>
            <content:encoded><![CDATA[<p>It was a typical Monday morning. I logged into my laptop with a cup of coffee in hand, ready to face another week in the corporate world. The project deadline was looming, and my inbox was overflowing with pending tasks. I glanced at my manager’s calendar — back-to-back meetings, reminders, and check-ins — and braced myself for another week of micro-managed chaos.</p><p>My manager, Arjun, walked in right on time. Efficient, no-nonsense, and notorious for his strict approach to deadlines, he had a reputation for keeping everyone on edge. As usual, he started the daily lead:<br> <em>“Morning team, let’s go through the tasks completed yesterday. Have you finished the report? Is the code deployed? What’s pending?”</em></p><p>His tone was sharp, and his eyes scanned every detail, as if he could spot even the smallest mistake from across the room. I answered, keeping my explanations brief. Around me, the team was tense, alert, and hesitant. By the end of the stand-up, it felt like a checklist had been ticked, but motivation was nowhere to be found. I left the meeting feeling drained, questioning whether this was really what leadership was supposed to feel like.</p><h3>The Struggle Under Arjun</h3><p>The weeks that followed under Arjun were predictable yet exhausting. He controlled every move, checked every detail, and never let us make decisions independently. If a task was delayed by even a few hours, he’d call it out in the next meeting. Feedback rarely felt constructive. More often than not, it sounded like criticism:<br> <em>“You did this wrong. Fix it before tomorrow.”</em></p><p>We delivered tasks on time, but the team was running on empty. Nobody volunteered ideas, and mistakes were hidden rather than discussed openly. I remember one instance when I suggested an alternative approach for a client presentation. Arjun dismissed it instantly:<br> <em>“We’ve tried that before. It won’t work.”</em></p><p>I quickly learned to keep my ideas to myself. Creativity and motivation were slowly eroding, replaced by a culture of caution and fear. While Arjun’s <strong>management style</strong> produced short-term efficiency, it lacked any <strong>long-term impact</strong> on the team’s growth.</p><h3>Enter Maya: The Manager Who Changed Everything</h3><p>A few months later, our team welcomed a new manager: Maya. Her reputation preceded her — she was known for her <strong>effective leadership</strong> and <strong>employee empowerment</strong> approach. Initially, I was skeptical. Could anyone really manage this team differently than Arjun?</p><p>On her first day, Maya called a team meeting. But unlike Arjun, the meeting wasn’t about tasks or deadlines. She asked a simple yet powerful question:<br> <em>“How are you all doing? What part of this project excites you?”</em></p><p>She listened — really listened. She asked about our challenges, aspirations, and ideas. When she finally introduced the project for the week, it wasn’t with a list of instructions. Instead, she explained <em>why it mattered</em>:<br> <em>“This campaign will impact our client’s growth and our team’s reputation. How can we make it exceptional?”</em></p><p>For the first time, work had meaning beyond completing tasks. It felt like we were contributing to something larger than ourselves.</p><h3>The Difference in Daily Leadership</h3><p>Maya’s style contrasted sharply with Arjun’s. She didn’t micromanage. Instead, she provided clarity and guidance while allowing us autonomy. Mistakes were opportunities to learn, not reasons for embarrassment. She encouraged discussions, welcomed suggestions, and made every team member feel their contribution mattered.</p><p>I recall making an error in a client report. Under Arjun, I would have been mortified, stressed, and afraid of criticism. With Maya, she calmly said:<br> <em>“Good effort. Here’s a better way to present this. Let’s do it together this time.”</em></p><p>Her feedback didn’t make me feel small — it made me feel supported. Her approach to <strong>leadership skills</strong> and <strong>team motivation</strong> was transforming the team culture</p><h3>Small Actions, Big Impact</h3><p>Over the next few months, Maya’s influence reshaped the team completely. Team members started volunteering ideas. Collaboration improved. Responsibilities were shared more evenly, and even the quietest members began speaking up in meetings. The team’s confidence grew alongside our <strong>workplace productivity</strong>.</p><p>I realized that Arjun had been producing short-term results. Reports were submitted, deadlines were met, but team growth and morale were stagnant. Maya, on the other hand, created <strong>long-term impact</strong>. She wasn’t just managing tasks; she was shaping careers, building confidence, and creating a motivated, high-performing team.</p><h3>Leadership Lessons I Learned</h3><p>Reflecting on my experience with Arjun and Maya, I discovered several invaluable lessons about effective leadership:</p><ol><li><strong>People First, Tasks Second</strong>: Motivation comes from trust and support, not just deadlines.</li><li><strong>Clarity Over Control</strong>: Explaining the purpose of work empowers teams more than micromanaging.</li><li><strong>Feedback as Growth, Not Criticism</strong>: Constructive guidance fuels confidence.</li><li><strong>Empowerment Beats Authority</strong>: Teams thrive when they feel trusted, not controlled.</li><li><strong>Great Managers Build Leaders</strong>: Results are important, but developing people has a lasting impact.</li></ol><h3>Conclusion</h3><p>That Monday morning changed my perspective forever. It showed me the real difference between an <strong>average manager</strong> and a <strong>great manager</strong>. Arjun’s approach produced short-term efficiency but drained the team. Maya’s approach built confidence, innovation, and long-term growth.</p><p>From that day onward, I knew what kind of manager I wanted to become: someone who inspires, mentors, and empowers people. Someone who doesn’t just deliver projects but creates a team that can achieve far more than anyone imagined.</p><p>👉 <strong>Average managers manage tasks. Great managers build futures.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385b79fb149a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Tested 4OCR Tools for Real Projects — Here’s the One Developers Should Use in 2025]]></title>
            <link>https://medium.com/@vidhi.goyal1812/best-ocr-tools-in-2025-tesseract-easyocr-paddleocr-and-anpr-compared-603e622fffb5?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/603e622fffb5</guid>
            <category><![CDATA[paddleocr]]></category>
            <category><![CDATA[ocr-tesseract]]></category>
            <category><![CDATA[tesseract]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 16:16:05 GMT</pubDate>
            <atom:updated>2025-11-20T06:14:33.904Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction: Why OCR Matters in 2025:</strong></h3><p>OCR (Optical Character Recognition) has become one of the most in-demand AI applications. From <strong>document scanning</strong> to <strong>license plate recognition (ANPR)</strong>, OCR saves time, reduces manual work, and makes data processing smarter.</p><p>In this blog, we’ll compare the <strong>best OCR libraries in 2025 — Tesseract, EasyOCR, PaddleOCR, and ANPR</strong> — so you know which one suits your project.</p><h3>What is OCR?</h3><p>OCR stands for <strong>Optical Character Recognition</strong>, a technology that extracts text from images, PDFs, and videos.</p><p>👉 Real-life examples of OCR:</p><ul><li>Extracting text from scanned books</li><li>Converting bills and invoices into digital records</li><li>Detecting car number plates (ANPR systems)</li></ul><h3><strong>Top OCR Tools in 2025:</strong></h3><h3>op OCR Tools in 2025</h3><h3>1. Tesseract OCR</h3><p>Tesseract is the <strong>most popular open-source OCR engine</strong>, maintained by Google.</p><p><strong>Features:</strong></p><ul><li>Supports 100+ languages</li><li>Open-source and free</li><li>Works best on printed/scanned text</li></ul><p><strong>Pros:</strong><br> High accuracy for clean printed text<br> Lightweight and free</p><p><strong>Cons:</strong><br> Poor performance on handwritten/curved text<br> Slower than deep learning-based OCR</p><p><strong>Use Cases:</strong> Invoice scanning, digitizing books, text extraction from documents.</p><h3>2. EasyOCR</h3><p>EasyOCR is a <strong>deep learning-based OCR library</strong> that works well with handwritten text and multiple languages.</p><p><strong>Features:</strong></p><ul><li>Supports 80+ languages</li><li>Built with PyTorch</li><li>Can detect text in complex images</li></ul><p><strong>Pros:</strong><br> Great for handwritten and curved text<br> Easy Python integration</p><p><strong>Cons:</strong><br> Slower on CPU<br> Requires GPU for large datasets</p><p><strong>Use Cases:</strong> Handwriting recognition, multilingual OCR, image text extraction.</p><h3>3. PaddleOCR</h3><p>Developed by Baidu, PaddleOCR is one of the <strong>most advanced OCR frameworks</strong>.</p><p><strong>Features:</strong></p><ul><li>End-to-end OCR pipeline</li><li>Supports 80+ languages</li><li>Works on documents, ID cards, street signs</li></ul><p><strong>Pros:</strong><br> Very high accuracy<br> Suitable for enterprise-level projects</p><p><strong>Cons:</strong><br> Larger setup size<br> Learning curve for PaddlePaddle framework</p><p><strong>Use Cases:</strong> Business OCR, large-scale enterprise solutions, multilingual document recognition.</p><h3>4. ANPR (Automatic Number Plate Recognition)</h3><p>ANPR is a <strong>specialized OCR system</strong> used to detect vehicle license plates.</p><p><strong>Features:</strong></p><ul><li>Detects and reads vehicle number plates</li><li>Works with CCTV, traffic cameras, toll booths</li></ul><p><strong>Pros:</strong><br> Specialized for traffic management<br> Can integrate with smart city systems</p><p><strong>Cons:</strong><br> Accuracy depends on plate format and image clarity<br> Requires preprocessing for low-light images</p><p><strong>Use Cases:</strong> Traffic surveillance, toll collection, parking systems, smart city solutions</p><h3>Which OCR Tool Should You Use?</h3><ul><li><strong>For basic document scanning → Tesseract</strong></li><li><strong>For handwriting &amp; multilingual text → EasyOCR</strong></li><li><strong>For enterprise solutions → PaddleOCR</strong></li><li><strong>For license plates → ANPR</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=603e622fffb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI in Today’s World: How It’s Useful and Why It Can Be Dangerous in the Future]]></title>
            <link>https://medium.com/@vidhi.goyal1812/ai-in-todays-world-how-it-s-useful-and-why-it-can-be-dangerous-in-the-future-98ac61e07508?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/98ac61e07508</guid>
            <category><![CDATA[ai-benefits-and-risks]]></category>
            <category><![CDATA[ai-future]]></category>
            <category><![CDATA[technology-trends]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ethics-in-ai-evolution]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 16:15:18 GMT</pubDate>
            <atom:updated>2025-09-21T16:15:18.556Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial Intelligence (<strong>AI</strong>) is no longer just science fiction — it’s part of our daily lives. From chatbots like <strong>ChatGPT</strong>, voice assistants like <strong>Siri and Alexa</strong>, to self-driving cars, AI is shaping industries, jobs, and even personal decision-making.</p><p>But while AI is incredibly <strong>useful</strong>, it also carries potential <strong>dangers</strong> if not used responsibly. In this blog, let’s explore both sides of AI — the <strong>benefits</strong> we enjoy today and the <strong>risks</strong> we may face in the upcoming future.</p><h3>How AI is Useful Today</h3><p>AI has become an invisible assistant in our lives. Here are the top ways it’s helping us:</p><h3>1. Healthcare Advancements</h3><p>AI helps doctors detect diseases early (like cancer, diabetes, or heart problems) using medical images and predictive algorithms. Personalized treatment plans and drug discovery are also becoming faster.</p><h3>2. Productivity &amp; Automation</h3><p>From smart email filters to automated customer support, AI saves time and reduces repetitive work. Tools like <strong>ChatGPT, Copilot, and Jasper AI</strong> are boosting efficiency in content creation and coding.</p><h3>3. Transportation &amp; Safety</h3><p>Self-driving cars and AI-based traffic systems are improving road safety and reducing human errors. Navigation apps use AI to predict traffic and suggest the best routes.</p><h3>4. Finance &amp; Security</h3><p>Banks use AI to detect fraud, analyze transactions, and manage investments. Chatbots provide 24/7 support, while AI-based algorithms assist in stock market predictions.</p><h3>5. Personalized Experiences</h3><p>From Netflix recommendations to personalized ads on Instagram, AI customizes digital experiences for every user, keeping them more relevant and engaging.</p><h3>⚠️ Why AI Can Be Dangerous</h3><p>While AI offers huge benefits, it also comes with risks if not carefully managed:</p><h3>1. Job Losses &amp; Unemployment</h3><p>Automation means many repetitive jobs (like data entry, call centers, and even some programming tasks) may be replaced by machines. This could increase unemployment if reskilling is ignored.</p><h3>2. Bias &amp; Discrimination</h3><p>AI learns from data. If the data is biased, AI decisions (like hiring or loan approvals) may also be biased — leading to unfair outcomes.</p><h3>3. Privacy &amp; Security Risks</h3><p>AI systems can misuse personal data. Facial recognition and surveillance raise concerns about privacy and government overreach.</p><h3>4. Fake Content &amp; Deepfakes</h3><p>AI can generate realistic fake videos, voices, and news, which can be misused for misinformation, scams, and even political manipulation.</p><h3>5. Superintelligence Risks</h3><p>In the far future, experts worry about <strong>AGI (Artificial General Intelligence)</strong> — machines that can think and act beyond human control. If mismanaged, it could pose a threat to humanity itself.</p><h3>🔮 The Future of AI: Balance Between Usefulness &amp; Danger</h3><p>The future of AI depends on <strong>how we manage it today</strong>. Governments, companies, and individuals must work together to:</p><ul><li>Create <strong>ethical guidelines</strong> for AI usage</li><li>Ensure <strong>fair and unbiased data</strong></li><li>Train people with <strong>new AI-era skills</strong></li><li>Regulate industries to prevent misuse</li><li>Encourage AI for <strong>positive causes</strong> like sustainability, education, and healthcare</li></ul><p>If handled responsibly, AI will be humanity’s greatest tool. But if left unchecked, it could also be one of the biggest threats.</p><h3>Final Thoughts</h3><p>Artificial Intelligence is like fire — extremely <strong>powerful and useful</strong>, but dangerous if misused. The key lies in <strong>balance</strong>: using AI to improve lives while putting safeguards in place to prevent harm.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98ac61e07508" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode Contains Duplicate Problem in Java | Brute Force, Sorting, and HashSet Solutions Explained]]></title>
            <link>https://medium.com/@vidhi.goyal1812/leetcode-contains-duplicate-problem-in-java-brute-force-sorting-and-hashset-solutions-explained-ef45299ea327?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef45299ea327</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[coding-interview-prep]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Fri, 19 Sep 2025 18:55:43 GMT</pubDate>
            <atom:updated>2025-09-19T18:55:43.887Z</atom:updated>
            <content:encoded><![CDATA[<p>The <strong>Contains Duplicate</strong> problem (LeetCode 217) is a common <strong>LeetCode array question</strong> asked in coding interviews. The task is simple: given an integer array nums, return true if any value appears <strong>at least twice</strong>, otherwise return false. For example, nums = [1,2,3,1] returns true (because 1 appears twice), while nums = [1,2,3,4] returns false (all elements are distinct). In this guide for a <strong>Java beginner</strong> doing <strong>coding interview prep</strong>, we’ll explain the problem, show a simple brute-force solution, and two optimized solutions (using <strong>HashSet in Java</strong> and sorting), complete with Java code, explanations, and a comparison of their trade-offs.</p><h3><strong>Problem Statement:</strong></h3><ul><li><strong>Input:</strong> An integer array nums.</li><li><strong>Output:</strong> true if <strong>any</strong> value appears at least twice; otherwise false.</li></ul><p><strong>Example 1:</strong></p><ul><li>Input: nums = [1,2,3,1]</li><li>Output: true (the number 1 appears twice).</li></ul><p><strong>Example 2:</strong></p><ul><li>Input: nums = [1,2,3,4]</li><li>Output: false (all elements are unique).</li></ul><p><strong>Example 3:</strong></p><ul><li>Input: nums = [1,1,1,3,3,4,3,2,4,2]</li><li>Output: true (numbers 1, 3, 4, and 2 repeat)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*wV4Gf-wn1YegVNtwLmLQOw.png" /></figure><h3><strong>GOAL:</strong></h3><p><strong>Detect any duplicate</strong> in the array. We will discuss three approaches: a straightforward <strong>brute-force</strong> solution, and two optimizations (<strong>sorting</strong> and <strong>HashSet</strong>) that speed up the search.</p><h3>1. Brute Force Approach:</h3><p>Step 1 — <strong>Pick the first element of the array</strong></p><p><strong>What to do:</strong> Start with the element at index i = 0. This is your current reference value.<br> <strong>Why:</strong> You need a fixed value to compare against the rest of the array. Starting from the first element ensures you eventually check every pair.<br> <strong>Implementation note:</strong> In code this is the outer loop for (int i = 0; i &lt; nums.length; i++).<br> <strong>Edge case:</strong> If the array has 0 or 1 element, there can be no duplicate — you can return false immediately.</p><p>Step 2 — Compare it with all elements that come after it</p><p><strong>What to do:</strong> For the current i, check every element j where j = i + 1 to nums.length - 1.<br> <strong>Why </strong><strong>j = i + 1?</strong> This avoids comparing the element with itself and prevents checking the same pair twice (e.g., if you checked nums[0] vs nums[1], you don&#39;t need to later check nums[1] vs nums[0]).<br> <strong>Implementation note:</strong> This is the inner loop: for (int j = i + 1; j &lt; nums.length; j++).<br> <strong>Tip:</strong> Always start j from i+1 — it halves redundant comparisons and keeps logic simple.</p><p>Step 3 — If a match is found → return true</p><p><strong>What to do:</strong> Inside the inner loop, check if (nums[i] == nums[j]) and immediately return true when it’s true.<br> <strong>Why early return?</strong> As soon as you find any duplicate you don’t need to keep searching — early exit saves time.<br> <strong>Implementation note:</strong> if (nums[i] == nums[j]) return true;<br> <strong>Behavior:</strong> This makes the algorithm potentially faster than full O(n²) in practice when duplicates are early in the array.</p><p>Step 4 — If no match is found, move to the next element</p><p><strong>What to do:</strong> If you finish the inner loop for a given i without finding a duplicate, increment i and repeat the process with the next element as the new reference.<br> <strong>Why:</strong> You must check every element as a potential duplicate candidate to be sure the array has no duplicates.<br> <strong>Implementation note:</strong> The outer loop continues to the next i automatically — for (int i = 0; i &lt; nums.length; i++).<br> <strong>Tip:</strong> This nested structure guarantees that all unique pairs (i, j) with i &lt; j are checked exactly once.</p><p>Step 5 — If the entire array is checked and no duplicates are found → return false</p><p><strong>What to do:</strong> When both loops complete without an early return, conclude there are no duplicates and return false.<br> <strong>Why:</strong> You have checked every pair; no match means every element is distinct.<br> <strong>Implementation note:</strong> Place return false; after both loops.<br> <strong>Complexity reminder:</strong> This complete traversal is O(n²) time in the worst case and O(1) extra space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3foFiQQAntT6_PFfcUC8qA.png" /></figure><p><strong>Time Complexity:</strong> The brute-force solution has <strong>O(n²)</strong> time complexity (because each of the n elements is compared with all others).<br> <strong>Space Complexity:</strong> It uses <strong>O(1)</strong> extra space, since no additional data structures grow with input size.</p><p>This approach is easy to understand but very slow for large arrays. It’s mainly useful for very small inputs or to illustrate the simplest solution.</p><h3>2. Sorting Approach</h3><p>The idea is simple: if we <strong>sort the array</strong>, all duplicates will appear <strong>next to each other</strong>. Then, we only need to check whether any two adjacent elements are equal.</p><p>Step 1 — Sort the array</p><p><strong>What to do:</strong> Rearrange the array in non-decreasing order.<br> <strong>Why:</strong> Once sorted, duplicates (if any) will always appear consecutively, which makes checking much easier.<br> <strong>Implementation note:</strong> In Java, use Arrays.sort(nums);.<br> <strong>Complexity:</strong> Sorting takes <strong>O(n log n)</strong> time.</p><p>Step 2 — Compare each element with the next one</p><p><strong>What to do:</strong> Loop through the sorted array and check if nums[i] == nums[i+1].<br> <strong>Why:</strong> If two adjacent elements are equal, it means a duplicate exists.<br> <strong>Example:</strong> For [1, 3, 2, 3], after sorting → [1, 2, 3, 3]. Here, 3 == 3 at adjacent positions → duplicate found.</p><p>Step 3 — If a match is found → return true</p><p><strong>What to do:</strong> As soon as we detect two adjacent equal elements, return true.<br> <strong>Why:</strong> There’s no need to continue further — one duplicate is enough to confirm.<br> <strong>Implementation note:</strong> Inside the loop:</p><p>Step 4 — If no match is found, return false</p><p><strong>What to do:</strong> If the loop finishes without finding duplicates, it means all elements are unique.<br> <strong>Why:</strong> Sorting guarantees that all duplicates would be adjacent — if none were found, no duplicates exist.<br> <strong>Implementation note:</strong> After the loop, add return false;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lVfEZAtmGQEX0l63tt8Tw.png" /></figure><p><em>Reasoning:</em> Sorting ensures that any duplicate values end up next to each other, so one pass is enough to detect repeats.</p><p><strong>Time Complexity:</strong> Sorting takes <strong>O(n log n)</strong> time, and the subsequent scan is O(n), so overall O(n log n).<br> <strong>Space Complexity:</strong> Using in-place sort, the extra space is <strong>O(log n)</strong> due to recursion or merge overhead (Java’s sort uses about O(log n) stack space for quicksort/mergesort).</p><p>This method is often faster than brute force for moderate-size arrays, especially when we want to avoid extra data structures. It’s a good middle-ground if memory is limited, but still slower than O(n) for very large n.</p><h3>3. HashSet Solution (Most Efficient)</h3><p>The <strong>HashSet</strong> is the most optimized way to solve the <strong>Contains Duplicate</strong> problem. Why? Because a <strong>HashSet in Java</strong> stores only <strong>unique values</strong>. If we try to insert an element that already exists, we instantly know there’s a duplicate.</p><p>Step 1 :Create an empty HashSet</p><p><strong>What to do:</strong> Initialize a HashSet&lt;Integer&gt;.<br> <strong>Why:</strong> A HashSet automatically ensures that no two identical elements exist inside it.</p><p><strong>Benefit:</strong> HashSet provides <strong>O(1) average time</strong> for both insertion and lookup.</p><p>Step 2 — Iterate through each element of the array</p><p><strong>What to do:</strong> Use a loop to go through each number in the array.<br> <strong>Why:</strong> We need to check every element to ensure it hasn’t appeared before.</p><p>Step 3 — Check if the element already exists in the HashSet</p><p><strong>What to do:</strong> Before inserting, check if set.contains(num).<br> <strong>Why:</strong> If the number is already in the set, it means we’ve found a duplicate.</p><p>Step 4 — If not found, insert the element into the HashSet</p><p><strong>What to do:</strong> Add the number to the set if it’s not already present.<br> <strong>Why:</strong> This builds our history of seen numbers.</p><p>Step 5 — If the loop finishes with no duplicates, return false</p><p><strong>What to do:</strong> After checking all numbers, if no duplicate is found, return false.<br> <strong>Why:</strong> This means every element in the array is unique.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*SIX7JYDfyxuK3GAhSGtMkQ.png" /></figure><p><em>Reasoning:</em> A <strong>HashSet in Java</strong> stores only unique elements and has average-case constant-time membership checks. This lets us detect duplicates in one pass without sorting.</p><p><strong>Time Complexity:</strong> O(n) — we do one pass through the array, and each contains/add is O(1) on average.<br> <strong>Space Complexity:</strong> O(n) – in the worst case (all elements distinct), we store all n elements in the set</p><h3>Comparison of Approaches</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UeDXjABggIzZewwsWHsnYA.png" /></figure><p>Each method has its reasoning:</p><ul><li><strong>Brute force</strong> compares all pairs (n² checks).</li><li><strong>Sorting</strong> makes duplicates adjacent, so one pass detects them.</li><li><strong>HashSet</strong> exploits O(1) average lookups to track seen values.</li></ul><h3>Conclusion</h3><p>In summary, the <strong>HashSet</strong> solution is generally the best for this problem in an interview setting. It achieves <strong>O(n)</strong> time by leveraging constant-time lookups, which is ideal for large inputs. The <strong>sorting</strong> approach is a simple alternative (O(n log n) time) if extra space must be minimal. The <strong>brute force</strong> method (O(n²) time) is mainly useful as a learning step or for tiny arrays.</p><h3><strong>When to use each:</strong></h3><ul><li>Use <strong>HashSet</strong> when you want the fastest check and have memory to spare. It’s the go-to solution in most cases.</li><li>Use <strong>Sorting</strong> when you cannot use extra memory and can afford O(n log n) time.</li><li>Use <strong>Brute force</strong> only for explanation or very small input sizes.</li></ul><p>Try by yourself: <a href="https://leetcode.com/problems/contains-duplicate/">https://leetcode.com/problems/contains-duplicate/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef45299ea327" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two Sum Problem in Java — Brute Force, HashMap & Two Pointers Explained (LeetCode Solution)]]></title>
            <link>https://medium.com/@vidhi.goyal1812/two-sum-problem-in-java-brute-force-hashmap-two-pointers-explained-leetcode-solution-8ce279ecacd0?source=rss-bbd44cf4d5fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce279ecacd0</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[coding-interview-prep]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Vidhi Goyal]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 17:19:46 GMT</pubDate>
            <atom:updated>2025-09-18T17:19:46.168Z</atom:updated>
            <content:encoded><![CDATA[<h3>Two Sum Problem in Java — Brute Force, HashMap &amp; Two Pointers Explained (LeetCode Solution)</h3><p>If you are preparing for <strong>coding interviews</strong>, chances are you’ve already come across the <strong>Two Sum Problem</strong>. It’s one of the most popular <strong>LeetCode problems</strong> and a favorite among interviewers because it tests your ability to move from a <strong>naive brute force approach</strong> to more <strong>optimized solutions</strong>.</p><p>In this blog, we’ll break down the problem step by step and solve it using:</p><ul><li><strong>Brute Force</strong> (Beginner’s Approach)</li><li><strong>Hash Map</strong> (Optimized with extra memory)</li><li><strong>Two Pointers</strong> (Optimized with sorting technique)</li></ul><p>Problem Statement:</p><p><strong>Two Sum </strong>:<br>Given an array of integers nums and an integer target, return the indices of the two numbers such that they add up to the target.</p><p>You may assume that each input would have exactly one solution, and you may not use the same element twice.</p><p>You can return the answer in any order.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*c4zXrx85h0nfFiVdfxkr_w.png" /><figcaption>Two Sum</figcaption></figure><p>Explaination of the Problem:</p><p>You are given an <strong>array of integers</strong> nums and an integer target. Your task is to find two numbers in the array such that they add up exactly to the target`.<br> Return the <strong>indices</strong> of these two numbers.</p><p>NOTE:</p><p>Some conditions /rules you have in your mind:</p><ul><li>You cannot use the <strong>same element twice</strong>.</li><li>There will always be <strong>exactly one solution</strong>.</li><li>The order of indices doesn’t matter, as long as you return both.</li></ul><p>Now we start <strong>solving the question by using 3 Approaches</strong></p><ol><li><strong>Brute Force Approach to solve the Two Sum problem in Java:</strong></li></ol><ul><li>Loop through each element i.</li><li>For each i, loop through the next elements j.</li><li>If nums[i] + nums[j] == target, return the indices [i, j].</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*K3Bns1BUUU_iwnvI3J0ibQ.png" /></figure><p><strong><em>Problem with this approach: </em></strong>Works fine for small inputs, but not scalable for large datasets.</p><p>2. <strong>Optimized Approach using Hash Map</strong></p><p>Instead of checking all pairs, we can use a <strong>Hash Map</strong> to store numbers as we traverse.</p><ul><li>Create a HashMap to store (value → index).</li><li>For each element, calculate complement = target - nums[i].</li><li>If complement exists in HashMap, return the indices.</li><li>Otherwise, store nums[i] in the HashMap.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*b4lHSFC5ivo90rVR0UoAHQ.png" /></figure><p><strong><em>Problem with this approach:</em></strong></p><p><strong>Time Complexity</strong>: O(n) (single loop)</p><p><strong>Space Complexity</strong>: O(n) (extra HashMap)</p><p><strong>3. Optimized Approach using Two Pointers:</strong><em>This one is my favourite and always wins when interviewer asked the optimized approach</em></p><p>This method works when we are allowed to <strong>sort the array</strong>.<br>ort the array while keeping track of original indices.</p><ul><li>Use two pointers</li><li>One starting at the beginning (left).</li><li>One starting at the end (right).</li><li>If nums[left] + nums[right] == target, return indices.</li><li>If sum &lt; target → move left pointer.</li><li>If sum &gt; target → move right pointer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*_RqdCXl70y3S7hOxwQtgIA.png" /></figure><p>The time complexity is O(nlogn) of this approach which make it more feasible than other solutions.</p><p><strong>Time and Space Complexity Comparison of Two Sum Approaches in Java</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QWX_2qaxehzQUYJbh2hUEQ.png" /></figure><p>“<strong>In conclusion, the Two Sum problem in Java can be solved using brute force, hash map, and two pointers. While brute force is simple, the hash map and two-pointer approaches are more optimized and interview-ready.</strong>”</p><h3>FAQ Section</h3><p><strong>Q1: Can Two Sum be solved without extra space in Java?</strong><br> Ans: Yes, using the two-pointer technique after sorting, but you must handle original indices carefully.</p><p><strong>Q2: Why is HashMap approach preferred in interviews?</strong><br> Ans: Because it gives O(n) time complexity and is easier to implement</p><p>Resources :: <a href="https://leetcode.com/problems/two-sum/description/">https://leetcode.com/problems/two-sum/description/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce279ecacd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>