<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abhishek Gupta </title>
    <description>The latest articles on DEV Community by Abhishek Gupta  (@abhishek-nexgen-dev).</description>
    <link>https://dev.to/abhishek-nexgen-dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2038086%2F2a08f760-c85f-4dbe-ab47-e0ac2756e937.jpg</url>
      <title>DEV Community: Abhishek Gupta </title>
      <link>https://dev.to/abhishek-nexgen-dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishek-nexgen-dev"/>
    <language>en</language>
    <item>
      <title>Gemini &amp; Gemini CLI — Beginner Learning Notes</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Thu, 15 Oct 2026 16:59:39 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/gemini-gemini-cli-beginner-learning-notes-52ln</link>
      <guid>https://dev.to/abhishek-nexgen-dev/gemini-gemini-cli-beginner-learning-notes-52ln</guid>
      <description>&lt;h2&gt;
  
  
  Chapter 1: Introduction to Gemini CLI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What is Artificial Intelligence (AI)?
&lt;/h3&gt;

&lt;p&gt;Artificial Intelligence (AI) is a technology that enables computers to perform tasks that normally require human intelligence.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understanding questions.&lt;/li&gt;
&lt;li&gt;Generating text and code.&lt;/li&gt;
&lt;li&gt;Recognizing patterns.&lt;/li&gt;
&lt;li&gt;Explaining concepts.&lt;/li&gt;
&lt;li&gt;Helping solve problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. What is Gemini?
&lt;/h3&gt;

&lt;p&gt;Gemini is a family of AI models developed by Google.&lt;/p&gt;

&lt;p&gt;An AI model processes input and generates a response based on its training and the information available to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Explain JavaScript functions in simple English.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Gemini can explain functions, provide examples, and help you understand how they work.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. What is Gemini CLI?
&lt;/h3&gt;

&lt;p&gt;Gemini CLI is an open-source AI assistant that lets developers interact with Gemini through a command-line interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CLI stands for Command-Line Interface.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of using only a web-based chat interface, you can work with Gemini from your terminal and use its available tools to interact with your development project.&lt;/p&gt;

&lt;p&gt;For example, you can ask Gemini CLI to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explain your project structure.&lt;/li&gt;
&lt;li&gt;Create or edit source files.&lt;/li&gt;
&lt;li&gt;Find bugs in your code.&lt;/li&gt;
&lt;li&gt;Help write tests.&lt;/li&gt;
&lt;li&gt;Run commands when permitted.&lt;/li&gt;
&lt;li&gt;Generate documentation.&lt;/li&gt;
&lt;li&gt;Help you understand an unfamiliar codebase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain the folder structure of this project.
Identify the main entry point.
Do not modify any files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gemini CLI can inspect relevant project files using its available tools and permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How is Gemini CLI different from a normal AI chatbot?
&lt;/h3&gt;

&lt;p&gt;A normal chatbot is primarily designed for conversations. Gemini CLI is designed to bring AI assistance into a terminal-based development workflow.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gemini chat&lt;/th&gt;
&lt;th&gt;Gemini CLI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Usually accessed through a chat interface&lt;/td&gt;
&lt;td&gt;Accessed through a terminal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Explains concepts and generates code&lt;/td&gt;
&lt;td&gt;Can work with project files using tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You often copy code into your editor&lt;/td&gt;
&lt;td&gt;It can edit files when authorized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works with information you provide&lt;/td&gt;
&lt;td&gt;Can inspect relevant local project information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mainly conversation-oriented&lt;/td&gt;
&lt;td&gt;Supports tool-assisted development tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Gemini is the AI model family. Gemini CLI is the tool used to interact with Gemini from the command line.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Why do developers use Gemini CLI?
&lt;/h3&gt;

&lt;p&gt;Imagine you have an existing React project with many files. You want to understand how the application works.&lt;/p&gt;

&lt;p&gt;Without an AI coding assistant, you may need to inspect every relevant file manually.&lt;/p&gt;

&lt;p&gt;With Gemini CLI, you can ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Study this project and explain:
1. The main application entry point.
2. The components folder.
3. How routing works.
4. How API requests are handled.
5. Where the application state is managed.

Explain everything in beginner-friendly language.
Do not modify any files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can help you understand the project faster. However, you should verify its explanations against the actual code.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. What are the limitations of Gemini CLI?
&lt;/h3&gt;

&lt;p&gt;Gemini CLI is helpful, but it is not perfect.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It can generate incorrect code.&lt;/li&gt;
&lt;li&gt;It can misunderstand project requirements.&lt;/li&gt;
&lt;li&gt;It can make unwanted changes if instructions are unclear.&lt;/li&gt;
&lt;li&gt;It may not have access to every file or tool.&lt;/li&gt;
&lt;li&gt;It may require authentication and an internet connection.&lt;/li&gt;
&lt;li&gt;Its available features depend on the installed version, account, configuration, and permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Never accept AI-generated code blindly. Review it, test it, and understand the changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quick revision
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI:&lt;/strong&gt; Technology that enables computers to perform intelligent tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini:&lt;/strong&gt; Google's family of AI models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini CLI:&lt;/strong&gt; A terminal-based AI assistant.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLI:&lt;/strong&gt; Command-Line Interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; An instruction or question given to an AI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Codebase:&lt;/strong&gt; The collection of source code and related files in a project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interview questions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q1. What is Gemini CLI?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gemini CLI is an open-source, terminal-based AI assistant that allows developers to interact with Gemini and perform coding tasks using available tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2. What does CLI stand for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CLI stands for Command-Line Interface. It allows users to interact with a computer or program by entering text commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3. How is Gemini CLI useful to developers?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It can help developers understand codebases, generate and edit files, debug problems, write tests, and create documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q4. Does Gemini CLI always generate correct code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. It can make mistakes, so developers should review the generated code and run appropriate tests.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 2: Terminal and Command-Line Basics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What is a terminal?
&lt;/h3&gt;

&lt;p&gt;A terminal is an application that lets you interact with your computer by typing commands.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows: PowerShell or Windows Terminal.&lt;/li&gt;
&lt;li&gt;Linux: Terminal.&lt;/li&gt;
&lt;li&gt;macOS: Terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. What is a shell?
&lt;/h3&gt;

&lt;p&gt;A shell is a program that interprets commands and executes them or passes them to the appropriate system tools.&lt;/p&gt;

&lt;p&gt;For example, Bash and Zsh are common Linux/macOS shells. PowerShell is commonly used on Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember the difference:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Terminal:&lt;/strong&gt; The application where you enter commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shell:&lt;/strong&gt; The program that interprets those commands.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Essential terminal commands
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pwd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show the current directory on Linux/macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List files on Linux/macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List files in PowerShell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd folder-name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Enter a directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mkdir project-name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;node --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check the Node.js version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check the npm version&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Some commands differ between operating systems and shells.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Working with a project directory
&lt;/h3&gt;

&lt;p&gt;Suppose you want to create a folder for learning Gemini CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;learning-project
&lt;span class="nb"&gt;cd &lt;/span&gt;learning-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What happens?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;mkdir learning-project&lt;/code&gt; creates a directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd learning-project&lt;/code&gt; moves into that directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start Gemini CLI from the project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gemini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps the tool work with the intended project context.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Why does the current directory matter?
&lt;/h3&gt;

&lt;p&gt;The current directory is the location in which your shell is currently working.&lt;/p&gt;

&lt;p&gt;When you start Gemini CLI from a project directory, its access to project files and instruction files depends on the working directory, configuration, permissions, and instruction-loading rules.&lt;/p&gt;

&lt;p&gt;For example, starting it inside your React project is more useful when you want help with that React project than starting it from an unrelated directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best practice:&lt;/strong&gt; Check your current directory before asking an AI assistant to modify files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Practice task
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your terminal.&lt;/li&gt;
&lt;li&gt;Create a folder named &lt;code&gt;gemini-practice&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Enter that folder.&lt;/li&gt;
&lt;li&gt;Check your current location.&lt;/li&gt;
&lt;li&gt;Start Gemini CLI if it is installed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Interview questions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q1. What is a terminal?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A terminal is an application that provides a text-based interface for interacting with a computer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2. What is a shell?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A shell interprets commands and executes them or invokes the required programs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3. Why should you start Gemini CLI from the project directory?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It helps Gemini CLI work in the intended project context and locate relevant files according to its configuration and permissions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 3: Installing and Starting Gemini CLI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What is Node.js?
&lt;/h3&gt;

&lt;p&gt;Node.js is a JavaScript runtime that allows JavaScript to run outside a web browser.&lt;/p&gt;

&lt;p&gt;It is required for the npm-based Gemini CLI installation method described in these notes.&lt;/p&gt;

&lt;p&gt;Official website: &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;https://nodejs.org/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. What is npm?
&lt;/h3&gt;

&lt;p&gt;npm is a package manager used to install and manage JavaScript packages.&lt;/p&gt;

&lt;p&gt;A package manager helps developers install software and its dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Check your installation
&lt;/h3&gt;

&lt;p&gt;Run these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;--version&lt;/span&gt;
npm &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If both commands return version numbers, Node.js and npm are available in your terminal.&lt;/p&gt;

&lt;p&gt;If either command is unavailable, check your installation and PATH configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Install Gemini CLI using npm
&lt;/h3&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @google/gemini-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understand the command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npm&lt;/code&gt;: Runs the package manager.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;install&lt;/code&gt;: Installs a package.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-g&lt;/code&gt;: Requests a global installation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@google/gemini-cli&lt;/code&gt;: Identifies the package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Verify the installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gemini &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gemini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the authentication instructions displayed on your screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. What is global installation?
&lt;/h3&gt;

&lt;p&gt;A global installation makes a package's command available from different directories, subject to your system's PATH and installation configuration.&lt;/p&gt;

&lt;p&gt;This is useful for command-line tools that you want to run across multiple projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Linux installation using Snap
&lt;/h3&gt;

&lt;p&gt;Snap is a package system available on supported Linux distributions.&lt;/p&gt;

&lt;p&gt;Check Snap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;snap version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;install &lt;/span&gt;gemini-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify and start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gemini &lt;span class="nt"&gt;--version&lt;/span&gt;
gemini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; This Snap package is community-maintained, not an official Google-published package. Snap may also restrict access to some files.&lt;/p&gt;

&lt;p&gt;For beginners, the npm method is a straightforward option when Node.js and npm are configured correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Common installation problems
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;What to check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;node&lt;/code&gt; not found&lt;/td&gt;
&lt;td&gt;Install Node.js and check PATH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;npm&lt;/code&gt; not found&lt;/td&gt;
&lt;td&gt;Check Node.js installation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;gemini&lt;/code&gt; not found&lt;/td&gt;
&lt;td&gt;Check installation output and executable path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Permission denied&lt;/td&gt;
&lt;td&gt;Check npm configuration and file permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Login fails&lt;/td&gt;
&lt;td&gt;Check network and supported authentication options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project files are inaccessible&lt;/td&gt;
&lt;td&gt;Check the current directory and filesystem permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Avoid immediately using &lt;code&gt;sudo&lt;/code&gt; to solve npm global-installation errors. Fix the underlying permission or configuration problem instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Authentication
&lt;/h3&gt;

&lt;p&gt;Authentication establishes that you are authorized to use a service.&lt;/p&gt;

&lt;p&gt;On first launch, Gemini CLI may offer authentication options. Follow the current instructions displayed by your installed version.&lt;/p&gt;

&lt;p&gt;Available options can depend on your account, location, and configuration.&lt;/p&gt;

&lt;p&gt;Official documentation: &lt;a href="https://geminicli.com/docs/" rel="noopener noreferrer"&gt;https://geminicli.com/docs/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Practice task
&lt;/h3&gt;

&lt;p&gt;Install Gemini CLI and confirm that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js works.&lt;/li&gt;
&lt;li&gt;npm works.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gemini --version&lt;/code&gt; returns a version.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gemini&lt;/code&gt; starts successfully.&lt;/li&gt;
&lt;li&gt;You can complete a supported authentication flow.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Chapter 4: Understanding Prompts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What is a prompt?
&lt;/h3&gt;

&lt;p&gt;A prompt is the instruction or question you give an AI assistant.&lt;/p&gt;

&lt;p&gt;The quality of your prompt affects how clearly the assistant understands your requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Weak prompt vs. good prompt
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Weak prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Make a calculator website.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The instruction does not explain what kind of website is needed, which technologies to use, or what features to include.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Build a complete, responsive calculator web application.

Requirements:

1. Technologies
- Use HTML, CSS, and vanilla JavaScript.
- Do not use external libraries or frameworks.
- Separate the application into index.html, style.css, and script.js.

2. Calculator functionality
- Support addition, subtraction, multiplication, and division.
- Support decimal numbers and negative numbers.
- Include Clear (C), Delete (⌫), and Equals (=) buttons.
- Follow standard arithmetic operator precedence.
- Support keyboard input.
- Prevent division by zero and display a helpful error message.
- Handle invalid expressions safely.

3. UI and design
- Create a clean, modern, professional calculator interface.
- Use a dark theme with subtle blue accents.
- Make buttons easy to identify and use.
- Display the current expression and result clearly.
- Support desktop, tablet, and mobile screens.
- Include hover, focus, and pressed states.

4. Code quality
- Use readable, maintainable JavaScript.
- Separate UI updates from calculation logic where practical.
- Do not use eval() to calculate expressions.
- Avoid unnecessary code and dependencies.
- Include helpful comments for important logic.

5. Testing
- Test addition, subtraction, multiplication, and division.
- Test decimals, negative numbers, and operator precedence.
- Test division by zero, invalid input, Clear, and Delete.
- Fix any issues found during testing.

6. Completion report
- List the files created or modified.
- Explain how to run the application.
- Summarize the tests performed and their actual results.
- Report any unfinished features or known limitations.

First inspect the existing project, if one exists. Then implement the calculator, run the available checks, and summarize the completed work. Do not claim a test passed unless you actually ran it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second prompt gives the AI clearer requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. A simple prompt-writing formula
&lt;/h3&gt;

&lt;p&gt;Use these four elements:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goal + Context + Requirements + Restrictions&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Goal:&lt;/strong&gt; What do you want to accomplish?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; What project or files are involved?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Requirements:&lt;/strong&gt; What must the result include?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restrictions:&lt;/strong&gt; What must not be changed?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Goal:
Fix the login form validation.

Context:
This is an existing React application.

Requirements:
Validate the email and password fields.
Display useful error messages.
Keep the current design.

Restrictions:
Do not change the authentication API.
Do not modify unrelated files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Prompting tips
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Explain your goal clearly.&lt;/li&gt;
&lt;li&gt;Mention the technology stack.&lt;/li&gt;
&lt;li&gt;Provide relevant error messages.&lt;/li&gt;
&lt;li&gt;Describe the expected behavior.&lt;/li&gt;
&lt;li&gt;Specify what should not change.&lt;/li&gt;
&lt;li&gt;Ask for explanations when learning.&lt;/li&gt;
&lt;li&gt;Request tests when appropriate.&lt;/li&gt;
&lt;li&gt;Review changes before accepting them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interview questions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q1. What is prompt engineering?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Prompt engineering is the practice of writing and refining instructions so that an AI system can better understand the task and produce useful results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2. What makes a prompt effective?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A useful prompt clearly states the goal, provides relevant context, lists requirements, and specifies important restrictions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3. Can a detailed prompt guarantee a correct result?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. A detailed prompt reduces ambiguity, but the result must still be checked and tested.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 5: Using Gemini CLI with an Existing Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. First understand the project
&lt;/h3&gt;

&lt;p&gt;Do not immediately ask the AI to rewrite your entire application.&lt;/p&gt;

&lt;p&gt;Start by understanding the existing codebase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze this project.

Explain:
1. The folder structure.
2. The main entry point.
3. The technologies used.
4. How the application starts.
5. How the frontend communicates with the backend.

Use simple English.
Do not modify any files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Generate a new feature
&lt;/h3&gt;

&lt;p&gt;After understanding the project, ask for a specific task.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add a search field to the existing user list.

Requirements:
- Search users by name.
- Update results as the user types.
- Follow the existing coding style.
- Keep the current layout.
- Do not modify unrelated features.
- Explain the changes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Debug an error
&lt;/h3&gt;

&lt;p&gt;When something breaks, ask the AI to investigate the cause before changing code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Investigate this error.

First:
1. Identify the likely cause.
2. Explain why it happens.
3. Suggest the smallest suitable fix.

Then apply the fix only if appropriate.
Run the relevant tests if available.
Do not change unrelated files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Review changes
&lt;/h3&gt;

&lt;p&gt;After the assistant modifies code, check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which files changed?&lt;/li&gt;
&lt;li&gt;Does the code solve the original problem?&lt;/li&gt;
&lt;li&gt;Were unrelated files modified?&lt;/li&gt;
&lt;li&gt;Are there new errors?&lt;/li&gt;
&lt;li&gt;Do existing tests still pass?&lt;/li&gt;
&lt;li&gt;Are there security or performance concerns?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; You remain responsible for the code, even when an AI assistant writes it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 6: Understanding GEMINI.md
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What is GEMINI.md?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;GEMINI.md&lt;/code&gt; is a Markdown file that provides project-specific instructions and context to Gemini CLI.&lt;/p&gt;

&lt;p&gt;It can help the assistant follow the project's conventions across multiple tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project Instructions&lt;/span&gt;

&lt;span class="gu"&gt;## Technology&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use JavaScript for frontend code.
&lt;span class="p"&gt;-&lt;/span&gt; Follow the existing framework and project structure.

&lt;span class="gu"&gt;## Coding Style&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Write small, readable functions.
&lt;span class="p"&gt;-&lt;/span&gt; Use meaningful variable names.
&lt;span class="p"&gt;-&lt;/span&gt; Avoid unnecessary duplication.

&lt;span class="gu"&gt;## Project Rules&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Do not modify unrelated files.
&lt;span class="p"&gt;-&lt;/span&gt; Explain important changes.
&lt;span class="p"&gt;-&lt;/span&gt; Run relevant tests when possible.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Why is it useful?
&lt;/h3&gt;

&lt;p&gt;Without project instructions, you may need to repeat the same requirements in multiple prompts.&lt;/p&gt;

&lt;p&gt;A suitable &lt;code&gt;GEMINI.md&lt;/code&gt; file provides reusable guidance.&lt;/p&gt;

&lt;p&gt;However, it does not guarantee perfect compliance. You should still review the generated code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Interview question
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is the purpose of &lt;code&gt;GEMINI.md&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It provides reusable project instructions and context that help Gemini CLI understand the project's conventions and requirements.&lt;/p&gt;

&lt;p&gt;Official documentation: &lt;a href="https://geminicli.com/docs/" rel="noopener noreferrer"&gt;https://geminicli.com/docs/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 7: Commands and Tools
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Gemini CLI slash commands
&lt;/h3&gt;

&lt;p&gt;Common commands include:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/help&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show help information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspect available tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/clear&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Clear conversation context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/quit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Exit, where supported&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The available commands may vary between versions. Use &lt;code&gt;/help&lt;/code&gt; to check the commands supported by your installation.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Terminal commands vs. slash commands
&lt;/h3&gt;

&lt;p&gt;These are different types of commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terminal command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is executed by your shell.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini CLI slash command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is entered inside the Gemini CLI interface.&lt;/p&gt;

&lt;p&gt;Do not assume that every terminal command is a Gemini CLI slash command.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. What are tools?
&lt;/h3&gt;

&lt;p&gt;Tools allow an AI assistant to perform actions beyond generating text.&lt;/p&gt;

&lt;p&gt;Depending on the configuration, available tools may allow Gemini CLI to inspect files, edit code, run commands, or access other resources.&lt;/p&gt;

&lt;p&gt;Tool access may be restricted by permissions and configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Why are permissions important?
&lt;/h3&gt;

&lt;p&gt;Some actions only read information. Others can change files or execute commands.&lt;/p&gt;

&lt;p&gt;Before approving an unfamiliar or destructive action:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand what it will do.&lt;/li&gt;
&lt;li&gt;Check which files or resources it affects.&lt;/li&gt;
&lt;li&gt;Confirm that the action is appropriate.&lt;/li&gt;
&lt;li&gt;Keep a backup or Git commit when necessary.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Chapter 8: Safety and Best Practices
&lt;/h2&gt;

&lt;p&gt;AI-assisted development introduces risks if generated commands or code are trusted without review.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important rules
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Never share passwords, API keys, or access tokens in prompts.&lt;/li&gt;
&lt;li&gt;Review file changes before accepting them.&lt;/li&gt;
&lt;li&gt;Understand commands before allowing them to run.&lt;/li&gt;
&lt;li&gt;Avoid approving destructive operations without checking their impact.&lt;/li&gt;
&lt;li&gt;Keep important work backed up or committed to Git.&lt;/li&gt;
&lt;li&gt;Run tests after making changes.&lt;/li&gt;
&lt;li&gt;Inspect generated code for security issues.&lt;/li&gt;
&lt;li&gt;Verify third-party packages before installing them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interview question
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why should developers review AI-generated code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because AI can produce incorrect, insecure, inefficient, or irrelevant code. Reviewing and testing the result helps ensure it meets the requirements.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 9: Interview Revision
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Important questions and answers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. What is Gemini CLI?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An open-source terminal-based AI assistant for working with Gemini and performing development tasks using available tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. What does CLI stand for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Command-Line Interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. What is the difference between Gemini and Gemini CLI?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gemini is Google's family of AI models, while Gemini CLI is a terminal-based tool for interacting with Gemini.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. What is a prompt?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An instruction or question given to an AI assistant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What is prompt engineering?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The practice of designing clear instructions to help an AI understand and perform a task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. What is Node.js?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A JavaScript runtime that allows JavaScript to execute outside a web browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. What is npm?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A package manager used to install and manage JavaScript packages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. What does &lt;code&gt;npm install -g&lt;/code&gt; mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It installs a package globally, making its command available from different directories when the environment is configured correctly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. What is authentication?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The process of verifying identity or establishing authorized access to a service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. What is &lt;code&gt;GEMINI.md&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Markdown file containing project-specific instructions and context for Gemini CLI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Why should Gemini CLI be started in the project directory?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To work in the intended project context and make relevant files available according to the tool's permissions and configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Does Gemini CLI replace a developer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. It assists with development, but developers must understand requirements, review code, test results, and make technical decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. What should you do before allowing the AI to edit an existing project?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Understand the task, define restrictions, review the planned changes, and protect important work with version control or backups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. How can you improve an incorrect AI-generated answer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Provide clearer context, specify the expected behavior, share relevant errors, and ask for a focused correction. Then verify the result.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 10: Practical Learning Checklist
&lt;/h2&gt;

&lt;p&gt;Use this checklist to measure your progress.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Explain Gemini and Gemini CLI in your own words.&lt;/li&gt;
&lt;li&gt;[ ] Explain the difference between a terminal and a shell.&lt;/li&gt;
&lt;li&gt;[ ] Install Node.js and npm.&lt;/li&gt;
&lt;li&gt;[ ] Install and launch Gemini CLI.&lt;/li&gt;
&lt;li&gt;[ ] Complete a supported authentication method.&lt;/li&gt;
&lt;li&gt;[ ] Ask Gemini CLI to explain a project without editing files.&lt;/li&gt;
&lt;li&gt;[ ] Write a clear prompt using goal, context, requirements, and restrictions.&lt;/li&gt;
&lt;li&gt;[ ] Create or modify a small feature.&lt;/li&gt;
&lt;li&gt;[ ] Ask Gemini CLI to investigate and fix a bug.&lt;/li&gt;
&lt;li&gt;[ ] Understand the purpose of &lt;code&gt;GEMINI.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;[ ] Inspect file changes and run relevant tests.&lt;/li&gt;
&lt;li&gt;[ ] Explain important concepts without looking at the notes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Revision
&lt;/h2&gt;

&lt;p&gt;Remember these core ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gemini is the AI model family.&lt;/li&gt;
&lt;li&gt;Gemini CLI brings AI assistance into the terminal.&lt;/li&gt;
&lt;li&gt;Prompts communicate your requirements.&lt;/li&gt;
&lt;li&gt;Project context helps the AI understand what it needs to do.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GEMINI.md&lt;/code&gt; provides reusable project instructions.&lt;/li&gt;
&lt;li&gt;Tools enable actions such as inspecting files or running commands.&lt;/li&gt;
&lt;li&gt;Permissions control which actions are allowed.&lt;/li&gt;
&lt;li&gt;Testing and code review remain essential.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Learning strategy:&lt;/strong&gt; Understand one concept, try one practical example, and then answer its interview question without looking at the notes.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cli</category>
      <category>gemini</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DevFest 2026 — Gemini CLI Game Challenges</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Thu, 15 Oct 2026 16:41:17 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/devfest-2026-gemini-cli-game-challenges-2dhe</link>
      <guid>https://dev.to/abhishek-nexgen-dev/devfest-2026-gemini-cli-game-challenges-2dhe</guid>
      <description>&lt;p&gt;Welcome to the Gemini CLI Game Challenges at &lt;strong&gt;DevFest Ranchi 2026&lt;/strong&gt;, organized by Google Developer Groups (GDG) Ranchi!&lt;/p&gt;

&lt;p&gt;These challenges are designed to help participants explore AI-assisted development, solve practical problems, build applications, and experience how Gemini CLI can support real-world software development.&lt;/p&gt;

&lt;p&gt;Whether you enjoy designing user interfaces, building AI-powered applications, or testing your knowledge of Gemini CLI, there is a challenge for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Challenge Overview
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Challenge&lt;/th&gt;
&lt;th&gt;Time Limit&lt;/th&gt;
&lt;th&gt;Maximum Score&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;UI Makeover Challenge&lt;/td&gt;
&lt;td&gt;5–10 minutes&lt;/td&gt;
&lt;td&gt;100 points&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build with Gemini — AI Chatbot Challenge&lt;/td&gt;
&lt;td&gt;30–35 minutes&lt;/td&gt;
&lt;td&gt;100 points&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI Faster Finger First Challenge&lt;/td&gt;
&lt;td&gt;20 minutes&lt;/td&gt;
&lt;td&gt;10 points&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All challenges are conducted at the DevFest Ranchi 2026 booth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; These are on-the-spot competitions. Participants must complete their assigned challenge and demonstrate their work to the booth organizers. There is no Google Form submission for the UI Makeover or AI Chatbot challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How to Participate
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Visit the Gemini CLI Game Challenges booth at DevFest Ranchi 2026.&lt;/li&gt;
&lt;li&gt;Meet the organizers or booth volunteers to learn about the available challenges.&lt;/li&gt;
&lt;li&gt;Get your assigned challenge, instructions, and starter project, where applicable.&lt;/li&gt;
&lt;li&gt;Read the requirements carefully before beginning.&lt;/li&gt;
&lt;li&gt;Complete the challenge independently using Gemini CLI and the provided resources.&lt;/li&gt;
&lt;li&gt;Demonstrate your completed work directly to the booth organizers within the allotted time.&lt;/li&gt;
&lt;li&gt;The organizers will evaluate your work according to the published scoring criteria.&lt;/li&gt;
&lt;li&gt;Participants with the highest scores and best completion times will be considered for exclusive DevFest goodies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;First Come, First Serve:&lt;/strong&gt; Participants should be ready to begin when their turn is announced. For challenges with equal scores, the participant who successfully completes and demonstrates the challenge first will receive priority.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. General Rules
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Individual participation:&lt;/strong&gt; Each participant must complete their assigned challenge independently unless the organizers announce otherwise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Gemini CLI:&lt;/strong&gt; Gemini CLI is the primary AI development tool for these challenges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Follow the starter project:&lt;/strong&gt; When a starter repository is provided, use it as the starting point and follow its instructions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Understand before building:&lt;/strong&gt; Read the challenge instructions and requirements before making changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Original work:&lt;/strong&gt; Do not copy another participant's solution or prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protect secrets:&lt;/strong&gt; Never commit API keys, passwords, tokens, or other sensitive information to a public repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test your work:&lt;/strong&gt; Verify that the application runs and its required features work before demonstrating it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Follow time limits:&lt;/strong&gt; Complete and demonstrate your work within the allocated time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask for assistance:&lt;/strong&gt; If you face an environment, setup, or tool issue, contact the organizers through the support channel or at the booth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On-the-spot evaluation:&lt;/strong&gt; Your work must be demonstrated to the booth organizers for evaluation. Merely completing the code without showing the working result may not qualify for full marks.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  4. Winner Selection and Exclusive Goodies
&lt;/h2&gt;

&lt;p&gt;The Gemini CLI Game Challenges are designed to reward practical skills, creativity, problem-solving, and effective use of AI development tools.&lt;/p&gt;

&lt;p&gt;Participants who successfully complete their assigned challenge will be evaluated by the booth organizers.&lt;/p&gt;

&lt;h3&gt;
  
  
  How winners are selected
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Highest score wins:&lt;/strong&gt; Participants are ranked according to their total evaluation score.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First Come, First Serve:&lt;/strong&gt; If multiple participants achieve the same highest score, the participant who completes and demonstrates the challenge first receives priority.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On-the-spot judging:&lt;/strong&gt; Organizers will evaluate the participant's actual work, functionality, originality, and understanding of the solution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exclusive goodies:&lt;/strong&gt; Participants who achieve the highest scores and satisfy the challenge requirements will have a chance to win exclusive DevFest goodies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the AI Faster Finger First Challenge, the first participant to submit all answers with the highest score wins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please note:&lt;/strong&gt; Participation does not guarantee a prize. Goodies are awarded based on the organizers' evaluation and the available prize allocation.&lt;/p&gt;




&lt;h1&gt;
  
  
  Challenge 1: UI Makeover Challenge
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Time limit:&lt;/strong&gt; 5–10 minutes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maximum score:&lt;/strong&gt; 100 points&lt;/p&gt;

&lt;h2&gt;
  
  
  Objective
&lt;/h2&gt;

&lt;p&gt;Improve an existing website's user interface using Gemini CLI.&lt;/p&gt;

&lt;p&gt;You will start with an existing project and redesign its interface to make it more attractive, readable, usable, and responsive while preserving its important functionality.&lt;/p&gt;

&lt;p&gt;This challenge focuses on how effectively you can communicate design requirements to an AI coding assistant and turn an existing interface into a better user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Need to Do
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the starter repository and inspect the existing project.&lt;/li&gt;
&lt;li&gt;Run the application and understand its current interface.&lt;/li&gt;
&lt;li&gt;Identify areas that need improvement, such as layout, spacing, typography, colors, navigation, or responsiveness.&lt;/li&gt;
&lt;li&gt;Use Gemini CLI to implement the improvements.&lt;/li&gt;
&lt;li&gt;Run the application and check that the redesign works.&lt;/li&gt;
&lt;li&gt;Demonstrate your updated interface to the organizers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Design Expectations
&lt;/h2&gt;

&lt;p&gt;Your redesigned interface should aim for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Visual quality:&lt;/strong&gt; A clean, consistent, professional design.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layout and spacing:&lt;/strong&gt; Proper alignment, spacing, and content hierarchy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typography:&lt;/strong&gt; Readable font sizes, appropriate font weights, and clear headings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Color consistency:&lt;/strong&gt; A balanced color palette with sufficient contrast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responsiveness:&lt;/strong&gt; A layout that works on mobile, tablet, and desktop screens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Functionality:&lt;/strong&gt; Existing important features and interactions should continue to work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User experience:&lt;/strong&gt; Navigation and content should be easy to understand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility:&lt;/strong&gt; Readable text, meaningful labels, and appropriate contrast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creativity:&lt;/strong&gt; Thoughtful improvements rather than unnecessary visual decoration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Starter Project
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub repository:&lt;/strong&gt; &lt;a href="https://github.com/abhishek-nexgen-dev/gdg-ranchi-ui-challenge" rel="noopener noreferrer"&gt;https://github.com/abhishek-nexgen-dev/gdg-ranchi-ui-challenge&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://gdg-ranchi-ui-challenge.vercel.app/" rel="noopener noreferrer"&gt;https://gdg-ranchi-ui-challenge.vercel.app/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example Gemini CLI Prompt
&lt;/h2&gt;

&lt;p&gt;Adapt this prompt to the actual interface and the time available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inspect the existing project and understand its current UI,
components, routes, and functionality.

Improve the interface to make it clean, modern, professional,
and responsive. Improve layout, spacing, typography, colors,
visual hierarchy, and navigation where needed.

Make sure the application works well on mobile, tablet, and
desktop screens. Preserve existing functionality and avoid
unnecessary dependencies or unrelated features.

Follow the project's existing technology stack and coding
conventions. Implement the changes in the codebase, then run
the application and check for obvious errors or broken
interactions.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Evaluation Criteria
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criterion&lt;/th&gt;
&lt;th&gt;Points&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Design Quality&lt;/td&gt;
&lt;td&gt;35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Responsiveness&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Functionality&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creativity and Originality&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Experience and Accessibility&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  On-the-Spot Judging
&lt;/h2&gt;

&lt;p&gt;After completing the redesign, participants must demonstrate the updated website directly to the organizers.&lt;/p&gt;

&lt;p&gt;The organizers will evaluate the actual interface, check important functionality, and assign scores according to the criteria above.&lt;/p&gt;

&lt;p&gt;Participants who achieve the highest scores will be considered for exclusive goodies.&lt;/p&gt;




&lt;h1&gt;
  
  
  Challenge 2: Build with Gemini — AI Chatbot Challenge
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Time limit:&lt;/strong&gt; 30–35 minutes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maximum score:&lt;/strong&gt; 100 points&lt;/p&gt;

&lt;h2&gt;
  
  
  Objective
&lt;/h2&gt;

&lt;p&gt;Build a functional AI-powered chatbot using Gemini and the provided starter project.&lt;/p&gt;

&lt;p&gt;This challenge focuses on integrating the Gemini API into an application and using an agent or tool to perform a useful action, rather than building only a static chat interface.&lt;/p&gt;

&lt;p&gt;Your application should allow users to interact with the chatbot, receive useful responses, and use at least one meaningful tool or agent capability.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Need to Do
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the starter repository and read its README and setup instructions.&lt;/li&gt;
&lt;li&gt;Understand the existing codebase and identify the parts that need implementation.&lt;/li&gt;
&lt;li&gt;Configure the required environment variables securely.&lt;/li&gt;
&lt;li&gt;Integrate the Gemini API using the supported project setup.&lt;/li&gt;
&lt;li&gt;Implement the chatbot's conversation flow.&lt;/li&gt;
&lt;li&gt;Add or complete at least one useful tool or agent action.&lt;/li&gt;
&lt;li&gt;Test the chatbot with different user inputs.&lt;/li&gt;
&lt;li&gt;Demonstrate the application and explain its main functionality to the organizers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Core Requirements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Gemini API Integration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Connect the application to the Gemini API.&lt;/li&gt;
&lt;li&gt;Send user messages to the model and display the generated responses.&lt;/li&gt;
&lt;li&gt;Handle loading states and API failures.&lt;/li&gt;
&lt;li&gt;Store API keys in environment variables rather than hardcoding them.&lt;/li&gt;
&lt;li&gt;Never expose private API keys in frontend code or a public repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Chatbot Functionality
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Provide a clear interface for entering messages.&lt;/li&gt;
&lt;li&gt;Display user messages and AI responses distinctly.&lt;/li&gt;
&lt;li&gt;Handle empty input and basic errors appropriately.&lt;/li&gt;
&lt;li&gt;Keep the conversation flow understandable and usable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Agent or Tool Usage
&lt;/h3&gt;

&lt;p&gt;Implement at least one useful tool or action appropriate to the application.&lt;/p&gt;

&lt;p&gt;For example, the chatbot could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Perform a calculation.&lt;/li&gt;
&lt;li&gt;Search or filter information from a provided dataset.&lt;/li&gt;
&lt;li&gt;Convert units.&lt;/li&gt;
&lt;li&gt;Look up information from predefined local data.&lt;/li&gt;
&lt;li&gt;Perform another meaningful action supported by the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tool should do useful work and produce an understandable result. A button that does nothing or a tool that is never invoked does not demonstrate meaningful tool usage.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. User Interface and Experience
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Keep the interface clean and easy to navigate.&lt;/li&gt;
&lt;li&gt;Make the chat input and response area readable.&lt;/li&gt;
&lt;li&gt;Show loading or processing feedback.&lt;/li&gt;
&lt;li&gt;Display understandable error messages.&lt;/li&gt;
&lt;li&gt;Make the application usable on different screen sizes where practical.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Starter Project and Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub repository:&lt;/strong&gt; &lt;a href="https://github.com/abhishek-nexgen-dev/AI-Chatbot-Challenge-Build-with-Gemini-API-Agents" rel="noopener noreferrer"&gt;https://github.com/abhishek-nexgen-dev/AI-Chatbot-Challenge-Build-with-Gemini-API-Agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini API documentation:&lt;/strong&gt; &lt;a href="https://ai.google.dev/gemini-api/docs/get-started" rel="noopener noreferrer"&gt;https://ai.google.dev/gemini-api/docs/get-started&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Suggested Implementation Workflow
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First 5 minutes&lt;/td&gt;
&lt;td&gt;Read the README, inspect the project, and understand the requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next 10 minutes&lt;/td&gt;
&lt;td&gt;Implement or complete Gemini API integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next 10 minutes&lt;/td&gt;
&lt;td&gt;Implement chatbot behavior and the required tool or agent action&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next 5 minutes&lt;/td&gt;
&lt;td&gt;Test the main features and fix obvious issues&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remaining 0–5 minutes&lt;/td&gt;
&lt;td&gt;Prepare the demonstration and explain your implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a suggested time allocation, not a separate scoring rule. The total challenge time is 30–35 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluation Criteria
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criterion&lt;/th&gt;
&lt;th&gt;Points&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemini API Integration&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent and Tool Usage&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Functionality and Response Quality&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UI and User Experience&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creativity and Demonstration&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  On-the-Spot Judging
&lt;/h2&gt;

&lt;p&gt;Once the application is ready, participants must demonstrate it directly to the organizers.&lt;/p&gt;

&lt;p&gt;The organizers may ask participants to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send a message to the chatbot and show the response.&lt;/li&gt;
&lt;li&gt;Demonstrate the implemented tool or agent action.&lt;/li&gt;
&lt;li&gt;Explain how the Gemini API is integrated.&lt;/li&gt;
&lt;li&gt;Show that the application handles errors appropriately.&lt;/li&gt;
&lt;li&gt;Explain the main implementation decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The organizers will evaluate the working application and assign scores according to the published criteria.&lt;/p&gt;

&lt;p&gt;Participants who achieve the highest scores will be considered for exclusive goodies.&lt;/p&gt;




&lt;h1&gt;
  
  
  Challenge 3: AI Faster Finger First Challenge
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Time limit:&lt;/strong&gt; 20 minutes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maximum score:&lt;/strong&gt; 10 points&lt;/p&gt;

&lt;h2&gt;
  
  
  Objective
&lt;/h2&gt;

&lt;p&gt;Test your knowledge of Gemini CLI, Gemini API, and AI agents in this fast-paced multiple-choice question challenge.&lt;/p&gt;

&lt;p&gt;This challenge rewards participants who can answer accurately and quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenge Rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;10 multiple-choice questions.&lt;/li&gt;
&lt;li&gt;1 point per correct answer.&lt;/li&gt;
&lt;li&gt;Total: 10 points.&lt;/li&gt;
&lt;li&gt;Answer as quickly and accurately as possible.&lt;/li&gt;
&lt;li&gt;Submit your answers using the official challenge process.&lt;/li&gt;
&lt;li&gt;The challenge must be completed within the 20-minute time limit.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Winner Selection
&lt;/h2&gt;

&lt;p&gt;The first participant to submit all answers with the highest score wins!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First Code, First Serve:&lt;/strong&gt; Participants who achieve the same highest score will be ranked based on their submission time. The participant who submits first will be declared the winner.&lt;/p&gt;

&lt;p&gt;The organizers will verify the submitted answers and completion time before declaring the winner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Submission Process
&lt;/h2&gt;

&lt;p&gt;The AI Faster Finger First Challenge uses the official Google Form for answer submission.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submission form:&lt;/strong&gt; &lt;a href="https://docs.google.com/forms/d/e/1FAIpQLScK-byoM9Dx4ieJt2ZHramhG5UGlZ6STxJu2wnYnUd9jv10HA/viewform?usp=dialog" rel="noopener noreferrer"&gt;https://docs.google.com/forms/d/e/1FAIpQLScK-byoM9Dx4ieJt2ZHramhG5UGlZ6STxJu2wnYnUd9jv10HA/viewform?usp=dialog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Participants must ensure their answers are submitted successfully before the challenge deadline.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Help, Support and Announcements
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Official WhatsApp Group
&lt;/h2&gt;

&lt;p&gt;Join the official WhatsApp group for GDG Ranchi DevFest 2026 Gemini CLI Game Challenges to receive important updates and support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Join here:&lt;/strong&gt; &lt;a href="https://chat.whatsapp.com/IMFmeH0VXX5C2Fn8hl7tfe?s=cl&amp;amp;p=a&amp;amp;mlu=4&amp;amp;ilr=4&amp;amp;iam=2" rel="noopener noreferrer"&gt;https://chat.whatsapp.com/IMFmeH0VXX5C2Fn8hl7tfe?s=cl&amp;amp;p=a&amp;amp;mlu=4&amp;amp;ilr=4&amp;amp;iam=2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The group will be used to share:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Challenge instructions and important announcements.&lt;/li&gt;
&lt;li&gt;Starter project and submission links.&lt;/li&gt;
&lt;li&gt;Updates, clarifications, and reminders.&lt;/li&gt;
&lt;li&gt;Help with setup and challenge-related issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Need help?&lt;/strong&gt; Check the group announcements first. If you need immediate assistance during your challenge, contact a GDG Ranchi organizer or booth volunteer.&lt;/p&gt;

&lt;p&gt;Joining the group does not replace completing your assigned challenge and demonstrating your work to the organizers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Reminders
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Complete your assigned challenge within the specified time.&lt;/li&gt;
&lt;li&gt;Demonstrate your work directly to the booth organizers.&lt;/li&gt;
&lt;li&gt;Keep your project and implementation ready for evaluation.&lt;/li&gt;
&lt;li&gt;Follow the official instructions provided at the booth.&lt;/li&gt;
&lt;li&gt;Do not share API keys, passwords, or other secrets.&lt;/li&gt;
&lt;li&gt;For the AI Faster Finger First Challenge, ensure your answers are submitted through the official Google Form.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Thank You!
&lt;/h1&gt;

&lt;p&gt;We look forward to seeing what you build at &lt;strong&gt;DevFest Ranchi 2026&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Explore Gemini CLI, experiment with your ideas, solve practical problems, and learn by building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build. Experiment. Demonstrate. Win!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Organized by Google Developer Groups (GDG) Ranchi.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cli</category>
      <category>devchallenge</category>
      <category>gemini</category>
    </item>
    <item>
      <title>GDG Ranchi DevFest Game 2026</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Sun, 04 Oct 2026 16:45:20 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/gdg-ranchi-devfest-game-2026-1b5a</link>
      <guid>https://dev.to/abhishek-nexgen-dev/gdg-ranchi-devfest-game-2026-1b5a</guid>
      <description>&lt;h1&gt;
  
  
  Participant &amp;amp; Game Management System
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Overview
&lt;/h2&gt;

&lt;p&gt;This system will manage &lt;strong&gt;participants, games, game registrations, game submissions, scores, and the leaderboard&lt;/strong&gt; for GDG Ranchi DevFest 2026.&lt;/p&gt;

&lt;p&gt;The system will have only &lt;strong&gt;two roles&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Super Admin&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Participant&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The system will be independent of Commudle. Participants can register themselves through the website, while the Super Admin manages participants, games, and scores.&lt;/p&gt;

&lt;p&gt;The main goal is to keep the system &lt;strong&gt;simple, reliable, and easy to operate during the event&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Main System Flow
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    GDG Ranchi Game System
                             │
              ┌──────────────┴──────────────┐
              │                             │
         SUPER ADMIN                   PARTICIPANT
              │                             │
      Manage Participants             Register Account
      Manage Games                     View Games
      Manage Registrations             Register for Game
      Manage Submissions               Submit Game
      Update Scores                    View Own Results
      View Leaderboard                 View Leaderboard
              │                             │
              └──────────────┬──────────────┘
                             │
                         LEADERBOARD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  3. Roles
&lt;/h1&gt;

&lt;h2&gt;
  
  
  3.1 Super Admin
&lt;/h2&gt;

&lt;p&gt;The Super Admin has complete control over the game management system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Super Admin can:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Login to admin dashboard&lt;/li&gt;
&lt;li&gt;View all participants&lt;/li&gt;
&lt;li&gt;Search participants&lt;/li&gt;
&lt;li&gt;Edit participants&lt;/li&gt;
&lt;li&gt;Disable participants&lt;/li&gt;
&lt;li&gt;Enable participants&lt;/li&gt;
&lt;li&gt;Create games&lt;/li&gt;
&lt;li&gt;Edit games&lt;/li&gt;
&lt;li&gt;Activate games&lt;/li&gt;
&lt;li&gt;Close games&lt;/li&gt;
&lt;li&gt;View game registrations&lt;/li&gt;
&lt;li&gt;View game submissions&lt;/li&gt;
&lt;li&gt;Update participant scores&lt;/li&gt;
&lt;li&gt;View participant game history&lt;/li&gt;
&lt;li&gt;View leaderboard&lt;/li&gt;
&lt;li&gt;Manage final event data&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  4. Participant
&lt;/h1&gt;

&lt;p&gt;Participants use the public website/dashboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Participant can:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Register their account&lt;/li&gt;
&lt;li&gt;Enter personal information&lt;/li&gt;
&lt;li&gt;View their participant profile&lt;/li&gt;
&lt;li&gt;View available games&lt;/li&gt;
&lt;li&gt;Register for games&lt;/li&gt;
&lt;li&gt;Submit completed games&lt;/li&gt;
&lt;li&gt;View their registered games&lt;/li&gt;
&lt;li&gt;View submitted games&lt;/li&gt;
&lt;li&gt;View scores&lt;/li&gt;
&lt;li&gt;View total points&lt;/li&gt;
&lt;li&gt;View leaderboard&lt;/li&gt;
&lt;li&gt;View their current rank&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Participants &lt;strong&gt;cannot&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit their game score&lt;/li&gt;
&lt;li&gt;Create games&lt;/li&gt;
&lt;li&gt;Edit other participants&lt;/li&gt;
&lt;li&gt;Disable participants&lt;/li&gt;
&lt;li&gt;Manage the leaderboard&lt;/li&gt;
&lt;li&gt;Manage other users&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  5. Participant Registration
&lt;/h1&gt;

&lt;p&gt;Participants can register themselves through a public registration form.&lt;/p&gt;

&lt;h3&gt;
  
  
  Registration form
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name *
Email *
Mobile Number *
Organization
City
Profile Photo
Other required information
Password *
Confirm Password *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successful registration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Registration
     ↓
Create Participant Account
     ↓
Generate Participant ID
     ↓
Participant Dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  6. Participant ID
&lt;/h1&gt;

&lt;p&gt;Every participant should receive a unique Participant ID.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GDG26-0001
GDG26-0002
GDG26-0003
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Participant ID can be used internally to identify a participant.&lt;/p&gt;

&lt;p&gt;It should be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unique&lt;/li&gt;
&lt;li&gt;Easy to read&lt;/li&gt;
&lt;li&gt;Stable&lt;/li&gt;
&lt;li&gt;Never reused&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant ID: GDG26-0042
Name: Abhishek Kumar
Email: abhishek@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  7. Participant Status
&lt;/h1&gt;

&lt;p&gt;Participants should not be permanently deleted by default.&lt;/p&gt;

&lt;p&gt;Instead, use a status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ACTIVE
DISABLED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Active
&lt;/h3&gt;

&lt;p&gt;The participant can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login&lt;/li&gt;
&lt;li&gt;Register for games&lt;/li&gt;
&lt;li&gt;Submit games&lt;/li&gt;
&lt;li&gt;View results&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disabled
&lt;/h3&gt;

&lt;p&gt;The participant cannot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login&lt;/li&gt;
&lt;li&gt;Register for new games&lt;/li&gt;
&lt;li&gt;Submit games&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, their previous registrations and scores remain stored.&lt;/p&gt;

&lt;p&gt;This protects historical event data.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Participant Dashboard
&lt;/h1&gt;

&lt;p&gt;After login, the participant sees a simple dashboard.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────┐
│ Welcome, Abhishek                   │
│ Participant ID: GDG26-0042          │
├─────────────────────────────────────┤
│ Total Games       5                 │
│ Completed Games   3                 │
│ Total Points      240               │
│ Current Rank      #12               │
└─────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dashboard sections
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Profile&lt;/li&gt;
&lt;li&gt;Available Games&lt;/li&gt;
&lt;li&gt;My Games&lt;/li&gt;
&lt;li&gt;My Results&lt;/li&gt;
&lt;li&gt;Leaderboard&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  9. Games
&lt;/h1&gt;

&lt;p&gt;The Super Admin creates and manages games.&lt;/p&gt;

&lt;p&gt;A game can contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Game Name
Description
Maximum Score
Start Time
End Time
Status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Game Name: Tech Quiz

Description:
Test your knowledge of technology and programming.

Maximum Score: 100

Start Time: 10:00 AM
End Time: 11:00 AM

Status: ACTIVE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  10. Game Status
&lt;/h1&gt;

&lt;p&gt;Every game should have a status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPCOMING
ACTIVE
CLOSED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  UPCOMING
&lt;/h3&gt;

&lt;p&gt;The game has not started yet.&lt;/p&gt;

&lt;p&gt;Participants can see the game but cannot submit it.&lt;/p&gt;

&lt;h3&gt;
  
  
  ACTIVE
&lt;/h3&gt;

&lt;p&gt;The game is currently available.&lt;/p&gt;

&lt;p&gt;Participants can register and submit the game.&lt;/p&gt;

&lt;h3&gt;
  
  
  CLOSED
&lt;/h3&gt;

&lt;p&gt;The game has ended.&lt;/p&gt;

&lt;p&gt;New registrations/submissions should not be allowed.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Create Game
&lt;/h1&gt;

&lt;p&gt;Only the Super Admin can create games.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create Game

Game Name: Coding Challenge

Description:
Solve the given programming challenges.

Maximum Score: 100

Start Time: 2:00 PM
End Time: 3:00 PM

Status: UPCOMING
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Game
 ↓
UPCOMING
 ↓
ACTIVE
 ↓
CLOSED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  12. Manage Games
&lt;/h1&gt;

&lt;p&gt;The Super Admin can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create game&lt;/li&gt;
&lt;li&gt;Edit game&lt;/li&gt;
&lt;li&gt;Change game status&lt;/li&gt;
&lt;li&gt;View registrations&lt;/li&gt;
&lt;li&gt;View submissions&lt;/li&gt;
&lt;li&gt;View results&lt;/li&gt;
&lt;li&gt;Close game&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example admin table:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Game&lt;/th&gt;
&lt;th&gt;Max Score&lt;/th&gt;
&lt;th&gt;Registrations&lt;/th&gt;
&lt;th&gt;Submissions&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tech Quiz&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;450&lt;/td&gt;
&lt;td&gt;430&lt;/td&gt;
&lt;td&gt;Closed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Coding Challenge&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;320&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;Active&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory Game&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;280&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Upcoming&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  13. Game Registration
&lt;/h1&gt;

&lt;p&gt;A participant can register for an available game.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant Dashboard
        ↓
Available Games
        ↓
Select Game
        ↓
Register
        ↓
Registration Successful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tech Quiz

Maximum Score: 100
Status: ACTIVE

[ Register for Game ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  14. Duplicate Registration Protection
&lt;/h1&gt;

&lt;p&gt;A participant must not be able to register for the same game twice.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Abhishek → Tech Quiz → Registered
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Abhishek tries again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Already Registered
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend must enforce this rule.&lt;/p&gt;




&lt;h1&gt;
  
  
  15. Game Submission
&lt;/h1&gt;

&lt;p&gt;After registering and playing the game, the participant submits the game.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tech Quiz
     ↓
Start Game
     ↓
Complete Game
     ↓
Submit Game
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After submission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: SUBMITTED
Score: 0
Points: 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The initial score should be &lt;strong&gt;0 by default&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Super Admin can later update the actual score.&lt;/p&gt;




&lt;h1&gt;
  
  
  16. Score Management
&lt;/h1&gt;

&lt;p&gt;Only the Super Admin can change scores.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant: Abhishek Kumar
Game: Tech Quiz

Current Score: 0

Maximum Score: 100

New Score: 85

[Update Score]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Score: 85
Points: 85
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  17. Score Validation
&lt;/h1&gt;

&lt;p&gt;The backend must validate the score.&lt;/p&gt;

&lt;p&gt;If:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Maximum Score = 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 ≤ Score ≤ 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Invalid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Score = 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend should reject it.&lt;/p&gt;

&lt;p&gt;The score should never be trusted only from the frontend.&lt;/p&gt;




&lt;h1&gt;
  
  
  18. Score and Points
&lt;/h1&gt;

&lt;p&gt;The system should store both &lt;strong&gt;score&lt;/strong&gt; and &lt;strong&gt;points&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For a simple implementation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Score = 85
Points = 85
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives flexibility if the event later wants different scoring rules.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Game Score = 80
Leaderboard Points = 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The current implementation can simply use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Points = Score
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;unless a different game-specific rule is required.&lt;/p&gt;




&lt;h1&gt;
  
  
  19. Participant Game History
&lt;/h1&gt;

&lt;p&gt;Every participant should be able to see their game history.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My Games

Game                Score    Points    Status
------------------------------------------------
Tech Quiz             85       85      Submitted
Memory Game            70       70      Submitted
Coding Challenge       0        0       Registered
Puzzle Game            95       95      Submitted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the bottom:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Games: 4
Completed Games: 3
Total Points: 250
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  20. Search Participant
&lt;/h1&gt;

&lt;p&gt;The Super Admin should be able to search participants.&lt;/p&gt;

&lt;p&gt;Search using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Participant ID&lt;/li&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Email&lt;/li&gt;
&lt;li&gt;Mobile number&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Search: GDG26-0042
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Abhishek Kumar
GDG26-0042
abhishek@example.com
9876543210
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  21. Participant Details Page
&lt;/h1&gt;

&lt;p&gt;The Super Admin should be able to open a participant profile.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant Details
────────────────────────────

Name: Abhishek Kumar
Participant ID: GDG26-0042
Email: abhishek@example.com
Mobile: 9876543210
Organization: NexGen Studio
City: Ranchi

Status: ACTIVE

Game History
────────────────────────────

Game              Score    Points
Tech Quiz           85       85
Memory Game         70       70
Coding Challenge     0        0

Total Points: 155
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The participant's profile image can also be displayed.&lt;/p&gt;




&lt;h1&gt;
  
  
  22. Manage Participants
&lt;/h1&gt;

&lt;p&gt;The Super Admin can view all participants.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Participant ID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Email&lt;/th&gt;
&lt;th&gt;Mobile&lt;/th&gt;
&lt;th&gt;Games&lt;/th&gt;
&lt;th&gt;Points&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GDG26-0001&lt;/td&gt;
&lt;td&gt;Rahul&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:rahul@example.com"&gt;rahul@example.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;98xxxxxx&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;280&lt;/td&gt;
&lt;td&gt;Active&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GDG26-0002&lt;/td&gt;
&lt;td&gt;Priya&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:priya@example.com"&gt;priya@example.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;97xxxxxx&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;210&lt;/td&gt;
&lt;td&gt;Active&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GDG26-0003&lt;/td&gt;
&lt;td&gt;Amit&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:amit@example.com"&gt;amit@example.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;96xxxxxx&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;Disabled&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;View
Edit
Disable
Enable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  23. Leaderboard
&lt;/h1&gt;

&lt;p&gt;The leaderboard shows participants ranked by total points.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rank&lt;/th&gt;
&lt;th&gt;Participant&lt;/th&gt;
&lt;th&gt;Games&lt;/th&gt;
&lt;th&gt;Total Points&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Rahul&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;450&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Priya&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;420&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Amit&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;390&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Abhishek&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;350&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The leaderboard should automatically update when scores change.&lt;/p&gt;




&lt;h1&gt;
  
  
  24. Ranking Calculation
&lt;/h1&gt;

&lt;p&gt;The basic ranking rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Points =
Game 1 Points
+ Game 2 Points
+ Game 3 Points
+ ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tech Quiz          80
Memory Game        70
Coding Challenge   90
Puzzle Game        60
----------------------
Total Points      300
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leaderboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ORDER BY total_points DESC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  25. Tie-Breaker
&lt;/h1&gt;

&lt;p&gt;Tie-breaking should be decided &lt;strong&gt;before the event&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Recommended order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Higher Total Points
2. Higher Highest Game Score
3. More Completed Games
4. Earlier Final Submission
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Rahul       300 points
Abhishek    300 points
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then compare the next tie-breaker.&lt;/p&gt;

&lt;p&gt;This avoids confusion when deciding the top 3 winners.&lt;/p&gt;




&lt;h1&gt;
  
  
  26. Top 3 Winners
&lt;/h1&gt;

&lt;p&gt;The final leaderboard determines the winners.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🥇 Rank 1 → Winner
🥈 Rank 2 → Runner-up
🥉 Rank 3 → Third Place
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Super Admin should have a final leaderboard view for announcing winners and distributing goodies.&lt;/p&gt;




&lt;h1&gt;
  
  
  27. Admin Dashboard
&lt;/h1&gt;

&lt;p&gt;The Super Admin dashboard should provide a quick overview.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────┐
│              ADMIN DASHBOARD               │
├────────────┬────────────┬──────────────────┤
│ Participants│ Games      │ Registrations    │
│     900     │     10     │      4,500       │
├────────────┼────────────┼──────────────────┤
│ Submissions│ Completed  │ Total Points     │
│    4,100    │    4,100   │     350,000      │
└────────────┴────────────┴──────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recent registrations&lt;/li&gt;
&lt;li&gt;Recent submissions&lt;/li&gt;
&lt;li&gt;Top participants&lt;/li&gt;
&lt;li&gt;Active games&lt;/li&gt;
&lt;li&gt;Games requiring attention&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  28. Recommended Pages
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Public Pages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
├── Home
├── Register
├── Login
└── Leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Participant Pages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/dashboard
/profile
/games
/my-games
/my-results
/leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Super Admin Pages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/admin
/admin/participants
/admin/participants/:id
/admin/games
/admin/games/create
/admin/games/:id
/admin/registrations
/admin/submissions
/admin/scores
/admin/leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  29. Database
&lt;/h1&gt;

&lt;p&gt;For this system, &lt;strong&gt;PostgreSQL&lt;/strong&gt; is a good choice.&lt;/p&gt;

&lt;p&gt;The expected workload is small.&lt;/p&gt;

&lt;p&gt;Even with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;900 participants
10 games
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The maximum game registrations would roughly be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;900 × 10 = 9,000 registrations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is very small for PostgreSQL.&lt;/p&gt;

&lt;p&gt;There is no need to introduce Redis, RabbitMQ, Elasticsearch, microservices, or Kubernetes just for this system.&lt;/p&gt;




&lt;h1&gt;
  
  
  30. Main Database Tables
&lt;/h1&gt;

&lt;p&gt;The system can start with these tables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;users
participants
games
game_registrations
game_results
score_update_logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Optional:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;activity_logs
email_logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  31. Users Table
&lt;/h1&gt;

&lt;p&gt;Used for authentication.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;users

id
name
email
password_hash
role
status
created_at
updated_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SUPER_ADMIN
PARTICIPANT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  32. Participants Table
&lt;/h1&gt;

&lt;p&gt;Stores participant information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;participants

id
participant_id
user_id
name
email
mobile
image_url
organization
city
status
created_at
updated_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id: UUID
participant_id: GDG26-0042
name: Abhishek Kumar
email: abhishek@example.com
mobile: 9876543210
status: ACTIVE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  33. Games Table
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;games

id
name
description
max_score
status
start_time
end_time
created_at
updated_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Tech Quiz
max_score: 100
status: ACTIVE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  34. Game Registrations Table
&lt;/h1&gt;

&lt;p&gt;This connects participants with games.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;game_registrations

id
participant_id
game_id
status
registered_at
created_at
updated_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important database rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UNIQUE(participant_id, game_id)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prevents duplicate registration.&lt;/p&gt;




&lt;h1&gt;
  
  
  35. Game Results Table
&lt;/h1&gt;

&lt;p&gt;Stores the result of a game.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;game_results

id
participant_id
game_id
score
points
status
submitted_at
updated_at
created_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;score = 0
points = 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  36. Score Update Logs
&lt;/h1&gt;

&lt;p&gt;Whenever an admin changes a score, the system should keep a record.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;score_update_logs

id
participant_id
game_id
old_score
new_score
old_points
new_points
updated_by
reason
created_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Old Score: 70
New Score: 80

Updated By: Admin
Reason: Manual evaluation correction
Time: 2026-10-04 15:30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful if a score is accidentally changed.&lt;/p&gt;




&lt;h1&gt;
  
  
  37. Database Relationship
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USER
 │
 └──── PARTICIPANT
          │
          ├──────── GAME REGISTRATION
          │                 │
          │                 └──── GAME
          │
          └──────── GAME RESULT
                            │
                            └──── GAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simplified:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participants
     │
     ├────&amp;lt; Game Registrations &amp;gt;──── Games
     │
     └────&amp;lt; Game Results &amp;gt;────────── Games
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  38. Backend Architecture
&lt;/h1&gt;

&lt;p&gt;Recommended stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend
React / Next.js

        ↓

Backend
Node.js
TypeScript
Express

        ↓

ORM
Prisma

        ↓

Database
PostgreSQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;External services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant Image
       ↓
Cloudinary

Email
       ↓
Email Provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  39. Backend Structure
&lt;/h1&gt;

&lt;p&gt;A simple structure is enough.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
│
├── modules/
│   ├── auth/
│   ├── participants/
│   ├── games/
│   ├── registrations/
│   ├── results/
│   └── leaderboard/
│
├── middleware/
│   ├── auth.ts
│   └── role.ts
│
├── database/
│
├── utils/
│
├── routes/
│
├── app.ts
└── server.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep modules separated by responsibility.&lt;/p&gt;




&lt;h1&gt;
  
  
  40. Authentication
&lt;/h1&gt;

&lt;p&gt;Participants and Super Admin both need authentication.&lt;/p&gt;

&lt;p&gt;Recommended:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Email
+
Password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Passwords must never be stored directly.&lt;/p&gt;

&lt;p&gt;Store:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;password_hash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a secure password hashing algorithm such as Argon2 or bcrypt.&lt;/p&gt;




&lt;h1&gt;
  
  
  41. Authorization
&lt;/h1&gt;

&lt;p&gt;Authentication answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who are you?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Authorization answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What are you allowed to do?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant
    ↓
GET /games
    ✓

Participant
    ↓
POST /games
    ✗

Super Admin
    ↓
POST /games
    ✓
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every protected backend operation should check the user's role.&lt;/p&gt;




&lt;h1&gt;
  
  
  42. Important Backend Rules
&lt;/h1&gt;

&lt;p&gt;The backend should enforce:&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 1
&lt;/h3&gt;

&lt;p&gt;Disabled participants cannot perform game actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 2
&lt;/h3&gt;

&lt;p&gt;Participant cannot register twice for the same game.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 3
&lt;/h3&gt;

&lt;p&gt;Participant cannot update their own score.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 4
&lt;/h3&gt;

&lt;p&gt;Only Super Admin can update scores.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 5
&lt;/h3&gt;

&lt;p&gt;Score cannot exceed maximum score.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 6
&lt;/h3&gt;

&lt;p&gt;Closed games cannot accept new submissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 7
&lt;/h3&gt;

&lt;p&gt;Leaderboard must use server-side data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 8
&lt;/h3&gt;

&lt;p&gt;Participant can only view their own private profile/results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 9
&lt;/h3&gt;

&lt;p&gt;Participant ID must be unique.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 10
&lt;/h3&gt;

&lt;p&gt;Important admin changes should be logged.&lt;/p&gt;




&lt;h1&gt;
  
  
  43. API Plan
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Authentication
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /auth/register
POST /auth/login
POST /auth/logout
GET  /auth/me
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Participant
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET    /participants/me
PATCH  /participants/me
GET    /participants/me/games
GET    /participants/me/results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Admin Participants
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET    /admin/participants
GET    /admin/participants/:id
PATCH  /admin/participants/:id
PATCH  /admin/participants/:id/status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Games
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET    /games
GET    /games/:id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Admin Games
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST   /admin/games
PATCH  /admin/games/:id
PATCH  /admin/games/:id/status
DELETE /admin/games/:id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of physically deleting an important game, it may be safer to close/archive it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Game Registration
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /games/:gameId/register
GET  /my-games
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Game Submission
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /games/:gameId/submit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Admin Results
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET   /admin/results
GET   /admin/results/:id
PATCH /admin/results/:id/score
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Leaderboard
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  44. Game Lifecycle
&lt;/h1&gt;

&lt;p&gt;A game follows this lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE
  ↓
UPCOMING
  ↓
ACTIVE
  ↓
CLOSED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Participant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Available
    ↓
Registered
    ↓
Playing
    ↓
Submitted
    ↓
Score Updated
    ↓
Completed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  45. Complete Participant Flow
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant visits website
          ↓
      Register
          ↓
    Account created
          ↓
 Participant ID generated
          ↓
       Login
          ↓
 Participant Dashboard
          ↓
     View Games
          ↓
 Select available game
          ↓
     Register Game
          ↓
       Play Game
          ↓
    Submit Game
          ↓
 Score = 0 initially
          ↓
 Super Admin evaluates
          ↓
 Score updated
          ↓
 Points calculated
          ↓
 Leaderboard updated
          ↓
 Participant sees result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  46. Complete Admin Flow
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Super Admin Login
       ↓
Admin Dashboard
       ↓
Manage Participants
       ↓
Manage Games
       ↓
Participants Register
       ↓
Participants Submit Games
       ↓
Admin Views Submissions
       ↓
Admin Updates Scores
       ↓
Points Updated
       ↓
Leaderboard Updated
       ↓
Final Top 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  47. Event-Day Workflow
&lt;/h1&gt;

&lt;p&gt;The system should be designed for fast operation during the event.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before Event
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create games
Configure maximum scores
Check participant registration
Test admin dashboard
Test game registration
Test score updates
Take database backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  During Event
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant registers
        ↓
Participant joins game
        ↓
Participant submits game
        ↓
Admin checks submission
        ↓
Admin updates score
        ↓
Leaderboard updates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  After Event
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Close games
     ↓
Verify scores
     ↓
Verify leaderboard
     ↓
Confirm Top 3
     ↓
Distribute goodies
     ↓
Final database backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  48. Dashboard Statistics
&lt;/h1&gt;

&lt;p&gt;Super Admin should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Participants
Active Participants
Disabled Participants

Total Games
Active Games
Closed Games

Total Registrations
Total Submissions

Total Points
Top 3 Participants
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  49. Performance Requirements
&lt;/h1&gt;

&lt;p&gt;The system does not require complicated infrastructure.&lt;/p&gt;

&lt;p&gt;Expected scale:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participants: ~900
Games: ~10
Registrations: ~9,000 maximum
Results: ~9,000 maximum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A small PostgreSQL instance can easily handle this workload.&lt;/p&gt;

&lt;p&gt;The bigger concern is not database performance.&lt;/p&gt;

&lt;p&gt;The important things are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correct database constraints&lt;/li&gt;
&lt;li&gt;Good validation&lt;/li&gt;
&lt;li&gt;Reliable authentication&lt;/li&gt;
&lt;li&gt;Backups&lt;/li&gt;
&lt;li&gt;Stable hosting&lt;/li&gt;
&lt;li&gt;Simple admin UI&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  50. Recommended Infrastructure
&lt;/h1&gt;

&lt;p&gt;Simple production setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                Internet
                   │
                   ↓
             Web Application
                   │
                   ↓
             Node.js API
                   │
                   ↓
              PostgreSQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Optional:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant Photo
       ↓
Cloudinary

Email
       ↓
Email Provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this event, avoid unnecessary services such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RabbitMQ       ❌
Redis          ❌
Kafka          ❌
Microservices  ❌
Kubernetes     ❌
Elasticsearch  ❌
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple application is easier to maintain and safer during an event.&lt;/p&gt;




&lt;h1&gt;
  
  
  51. Backup Strategy
&lt;/h1&gt;

&lt;p&gt;Because this system contains participant and game results, backups are important.&lt;/p&gt;

&lt;p&gt;Recommended:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before Event
     ↓
Database Backup
     ↓
During Event
     ↓
Periodic Backup
     ↓
After Event
     ↓
Final Backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At minimum, keep a reliable database backup before the event begins.&lt;/p&gt;




&lt;h1&gt;
  
  
  52. Security
&lt;/h1&gt;

&lt;p&gt;The system should include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTPS&lt;/li&gt;
&lt;li&gt;Password hashing&lt;/li&gt;
&lt;li&gt;Secure authentication tokens/cookies&lt;/li&gt;
&lt;li&gt;Role-based authorization&lt;/li&gt;
&lt;li&gt;Input validation&lt;/li&gt;
&lt;li&gt;Rate limiting for authentication&lt;/li&gt;
&lt;li&gt;Server-side score validation&lt;/li&gt;
&lt;li&gt;Unique database constraints&lt;/li&gt;
&lt;li&gt;Secure environment variables&lt;/li&gt;
&lt;li&gt;Database backups&lt;/li&gt;
&lt;li&gt;Protection against unauthorized admin access&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Never put:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DATABASE_URL
JWT_SECRET
EMAIL_PASSWORD
CLOUDINARY_SECRET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;inside frontend code.&lt;/p&gt;




&lt;h1&gt;
  
  
  53. What Participants Can See
&lt;/h1&gt;

&lt;p&gt;Participants should have a clean experience.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dashboard
│
├── My Profile
│
├── Available Games
│
├── My Games
│
├── My Results
│
└── Leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They should not see admin functionality.&lt;/p&gt;




&lt;h1&gt;
  
  
  54. What Super Admin Can See
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Admin Dashboard
│
├── Participants
│
├── Games
│
├── Registrations
│
├── Submissions
│
├── Scores
│
└── Leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  55. Important UX Rules
&lt;/h1&gt;

&lt;p&gt;Because this will be used during a live event:&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep registration fast
&lt;/h3&gt;

&lt;p&gt;Avoid unnecessary fields.&lt;/p&gt;

&lt;h3&gt;
  
  
  Show clear status
&lt;/h3&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Registered ✓
Submitted ✓
Score Pending
Score: 85
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Prevent accidental actions
&lt;/h3&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Are you sure you want to disable this participant?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Make scores obvious
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current Score: 85 / 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Make leaderboard easy to understand
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Rank | Name | Games | Points
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  56. Error Handling
&lt;/h1&gt;

&lt;p&gt;The system should show simple messages.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UNIQUE_CONSTRAINT_VIOLATION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are already registered for this game.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FORBIDDEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You don't have permission to perform this action.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BAD_REQUEST
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show the actual problem.&lt;/p&gt;




&lt;h1&gt;
  
  
  57. Development Plan
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Phase 1 — Project Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend
Backend
PostgreSQL
Prisma
Environment configuration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 2 — Authentication
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Register
Login
Logout
Role management
Protected routes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 3 — Participants
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participant profile
Participant ID
Admin participant management
Enable/disable participant
Search
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 4 — Games
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create game
Edit game
Game status
Maximum score
Game listing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 5 — Game Registration
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Register for game
Duplicate protection
My games
Registration status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 6 — Game Submission
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Submit game
Submission status
Default score = 0
Admin submission list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 7 — Scores
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Admin score update
Score validation
Points calculation
Score update history
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 8 — Leaderboard
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total points
Ranking
Tie-breaker
Top 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 9 — Dashboard
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Admin statistics
Participant dashboard
Game statistics
Recent activity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 10 — Testing
&lt;/h2&gt;

&lt;p&gt;Test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Registration
Login
Participant permissions
Admin permissions
Game registration
Duplicate registration
Game submission
Score update
Invalid score
Leaderboard
Disabled participant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Phase 11 — Deployment
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Production database
Production backend
Production frontend
HTTPS
Environment variables
Backups
Monitoring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  58. Final Architecture
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    ┌───────────────────────┐
                    │       WEBSITE         │
                    │   React / Next.js     │
                    └───────────┬───────────┘
                                │
                                │ HTTPS
                                ↓
                    ┌───────────────────────┐
                    │       BACKEND         │
                    │ Node.js + TypeScript  │
                    │       Express         │
                    └───────────┬───────────┘
                                │
                                ↓
                    ┌───────────────────────┐
                    │      PostgreSQL       │
                    │                       │
                    │ Users                 │
                    │ Participants          │
                    │ Games                 │
                    │ Registrations         │
                    │ Results               │
                    │ Score Logs             │
                    └───────────────────────┘
                         │             │
                         │             │
                         ↓             ↓
                    Cloudinary       Email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  59. Final Role Structure
&lt;/h1&gt;

&lt;p&gt;There are only &lt;strong&gt;two roles&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SUPER ADMIN
│
├── Manage Participants
│   ├── View
│   ├── Search
│   ├── Edit
│   ├── Disable
│   └── Enable
│
├── Manage Games
│   ├── Create
│   ├── Edit
│   ├── Activate
│   └── Close
│
├── Manage Registrations
│
├── Manage Submissions
│
├── Update Scores
│
└── View Leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PARTICIPANT
│
├── Register
├── Login
├── View Profile
├── View Games
├── Register for Games
├── Submit Games
├── View Own Games
├── View Own Scores
├── View Total Points
└── View Leaderboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  60. Final Feature Checklist
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Super Admin
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[x] Login&lt;/li&gt;
&lt;li&gt;[x] Dashboard&lt;/li&gt;
&lt;li&gt;[x] Manage participants&lt;/li&gt;
&lt;li&gt;[x] Edit participants&lt;/li&gt;
&lt;li&gt;[x] Disable participants&lt;/li&gt;
&lt;li&gt;[x] Enable participants&lt;/li&gt;
&lt;li&gt;[x] Search participants&lt;/li&gt;
&lt;li&gt;[x] Create games&lt;/li&gt;
&lt;li&gt;[x] Manage games&lt;/li&gt;
&lt;li&gt;[x] Activate/close games&lt;/li&gt;
&lt;li&gt;[x] View registrations&lt;/li&gt;
&lt;li&gt;[x] View submissions&lt;/li&gt;
&lt;li&gt;[x] Update scores&lt;/li&gt;
&lt;li&gt;[x] Score defaults to 0&lt;/li&gt;
&lt;li&gt;[x] Score validation&lt;/li&gt;
&lt;li&gt;[x] Score update history&lt;/li&gt;
&lt;li&gt;[x] View leaderboard&lt;/li&gt;
&lt;li&gt;[x] Final Top 3&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Participant
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[x] Self registration&lt;/li&gt;
&lt;li&gt;[x] Login&lt;/li&gt;
&lt;li&gt;[x] Participant ID&lt;/li&gt;
&lt;li&gt;[x] Profile&lt;/li&gt;
&lt;li&gt;[x] View available games&lt;/li&gt;
&lt;li&gt;[x] Register for games&lt;/li&gt;
&lt;li&gt;[x] Submit games&lt;/li&gt;
&lt;li&gt;[x] View registered games&lt;/li&gt;
&lt;li&gt;[x] View submitted games&lt;/li&gt;
&lt;li&gt;[x] View individual scores&lt;/li&gt;
&lt;li&gt;[x] View total games&lt;/li&gt;
&lt;li&gt;[x] View total points&lt;/li&gt;
&lt;li&gt;[x] View leaderboard&lt;/li&gt;
&lt;li&gt;[x] View current rank&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  61. Final Recommended Stack
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend
React / Next.js
TypeScript

Backend
Node.js
Express
TypeScript

Database
PostgreSQL

ORM
Prisma

Authentication
JWT / Secure Cookie
Argon2 or bcrypt

Images
Cloudinary

Email
Resend / Brevo / SMTP

Hosting
Small VPS / Render / Similar

Version Control
Git + GitHub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The architecture should remain a &lt;strong&gt;single application&lt;/strong&gt; initially.&lt;/p&gt;




&lt;h1&gt;
  
  
  62. Core Principle
&lt;/h1&gt;

&lt;p&gt;The most important principle for this project is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Keep the system simple enough that the GDG Ranchi team can operate it easily during the event.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We do not need a complicated distributed architecture for approximately 900 participants.&lt;/p&gt;

&lt;p&gt;The core system is simply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Participants
      ↓
Games
      ↓
Registrations
      ↓
Submissions
      ↓
Scores
      ↓
Points
      ↓
Leaderboard
      ↓
Top 3 Winners
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything else exists to make this flow secure, reliable, and easy to manage.&lt;/p&gt;




&lt;h1&gt;
  
  
  63. Final System Summary
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                GDG RANCHI DEVFEST 2026
                         │
              Participant Registration
                         │
                         ↓
                  Participant ID
                         │
                         ↓
                  Participant Login
                         │
              ┌──────────┴──────────┐
              ↓                     ↓
        View Available Games    View Leaderboard
              │
              ↓
        Register for Game
              │
              ↓
          Play Game
              │
              ↓
        Submit Game
              │
              ↓
        Score = 0 initially
              │
              ↓
         SUPER ADMIN
              │
              ↓
         Update Score
              │
              ↓
        Calculate Points
              │
              ↓
          Leaderboard
              │
              ↓
          ┌───┴───┐
          ↓       ↓
       Rank 1   Rank 2   Rank 3
          │       │       │
          └───────┴───────┘
                  ↓
             TOP 3 WINNERS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Scope
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;2 roles&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6 core database concepts&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Users
Participants
Games
Registrations
Results
Score Logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1 backend&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 PostgreSQL database&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 participant flow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 leaderboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No unnecessary microservices.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Linked List Mistakes Every Beginner Makes (Including Me)</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Mon, 31 Aug 2026 10:17:19 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/linked-list-mistakes-every-beginner-makes-including-me-3dcm</link>
      <guid>https://dev.to/abhishek-nexgen-dev/linked-list-mistakes-every-beginner-makes-including-me-3dcm</guid>
      <description>&lt;p&gt;Today, I spent almost &lt;strong&gt;3–4 hours&lt;/strong&gt; solving a Medium-level Linked List problem on LeetCode: &lt;strong&gt;Swap Nodes in Pairs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At first, I thought the problem was simple.&lt;/p&gt;

&lt;p&gt;The task was basically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Convert it into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 1 → 4 → 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I thought:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Okay, I just need to swap every two nodes. How difficult can that be?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But once I started writing the code, things became confusing.&lt;/p&gt;

&lt;p&gt;I wrote the solution.&lt;/p&gt;

&lt;p&gt;Got an error.&lt;/p&gt;

&lt;p&gt;Dry-ran the code.&lt;/p&gt;

&lt;p&gt;Found another mistake.&lt;/p&gt;

&lt;p&gt;Changed the logic.&lt;/p&gt;

&lt;p&gt;Created more variables.&lt;/p&gt;

&lt;p&gt;Forgot to update a pointer.&lt;/p&gt;

&lt;p&gt;And suddenly, my entire logic became messy. 😅&lt;/p&gt;

&lt;p&gt;After spending hours on this one problem, I learned something important about Linked Lists.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Linked Lists are not difficult because of syntax. They are difficult because you need to understand references and pointers.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, I want to share the mistakes I made and the mistakes I think almost every beginner makes while learning Linked Lists.&lt;/p&gt;




&lt;h1&gt;
  
  
  First, What Actually Is a Linked List?
&lt;/h1&gt;

&lt;p&gt;Let's take a simple Linked List:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4 → null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each node contains two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A value&lt;/li&gt;
&lt;li&gt;A reference to the next node&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can visualize a node like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────┬──────────┐
│  Value  │   Next   │
└─────────┴──────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────┬───────┐
│   1   │   ●───┼──→ Node 2
└───────┴───────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last node points to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;head&lt;/code&gt; usually points to the first node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head
 ↓
1 → 2 → 3 → 4 → null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything starts from &lt;code&gt;head&lt;/code&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 1: Thinking a Variable Creates a New Node
&lt;/h1&gt;

&lt;p&gt;This is one of the first mistakes beginners make.&lt;/p&gt;

&lt;p&gt;Suppose we write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some beginners may think that &lt;code&gt;first&lt;/code&gt; now contains a copy of the first node.&lt;/p&gt;

&lt;p&gt;But that's not true.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;first&lt;/code&gt; is simply another reference to the same node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head ─────┐
          ↓
        [1] → [2] → [3]
          ↑
          │
first ────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;first&lt;/code&gt; point to the same node.&lt;/p&gt;

&lt;p&gt;So if you create another variable like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head ──────┐
current ───┼──→ [1] → [2] → [3]
           │
           └── Same Node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You did not create another Linked List.&lt;/p&gt;

&lt;p&gt;You just created another reference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Lesson
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A variable in a Linked List usually stores a reference to a node, not a copy of the node.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Understanding this makes many Linked List problems easier.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 2: Not Understanding the Difference Between Moving a Pointer and Changing a Link
&lt;/h1&gt;

&lt;p&gt;This is extremely important.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Currently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;current
   ↓
1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if we write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What happens?&lt;/p&gt;

&lt;p&gt;&lt;code&gt;current&lt;/code&gt; moves to the next node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
    ↑
 current
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice something important.&lt;/p&gt;

&lt;p&gt;The Linked List itself did &lt;strong&gt;not change&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Only the variable moved.&lt;/p&gt;




&lt;p&gt;But now look at this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes the actual connection between nodes.&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
↑
current
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After changing &lt;code&gt;current.next&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 ─────→ 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Node &lt;code&gt;2&lt;/code&gt; has been disconnected.&lt;/p&gt;

&lt;p&gt;So remember:&lt;/p&gt;

&lt;h3&gt;
  
  
  Moving a variable
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Move my reference.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Changing &lt;code&gt;.next&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;something&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Change the Linked List structure.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This difference is very important.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 3: Accessing &lt;code&gt;.next&lt;/code&gt; Without Checking for &lt;code&gt;null&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Suppose your Linked List is empty:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head = null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;second&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will cause an error because &lt;code&gt;head&lt;/code&gt; does not exist.&lt;/p&gt;

&lt;p&gt;Similarly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may get an error.&lt;/p&gt;

&lt;p&gt;Because:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head.next = null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And &lt;code&gt;null.next&lt;/code&gt; does not exist.&lt;/p&gt;

&lt;p&gt;This is why conditions are important.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Safe to work with two nodes&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before accessing a node's &lt;code&gt;.next&lt;/code&gt;, ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does this node actually exist?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Mistake 4: Forgetting to Save the Next Node
&lt;/h1&gt;

&lt;p&gt;This is one of the biggest mistakes when modifying a Linked List.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are currently at node &lt;code&gt;1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;current
   ↓
1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now imagine you change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;something&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The original connection might be lost.&lt;/p&gt;

&lt;p&gt;For example, if you overwrite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may lose your connection to node &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That is why, before changing a connection, it is often useful to save the next node.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;nextNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;current → 1 → 2 → 3 → 4
              ↑
           nextNode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even if you change &lt;code&gt;current.next&lt;/code&gt;, you still know where node &lt;code&gt;2&lt;/code&gt; is.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple Rule
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Before breaking a connection, make sure you have saved the node you need later.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This single habit can prevent many Linked List bugs.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 5: Forgetting to Update Pointers
&lt;/h1&gt;

&lt;p&gt;This was personally my biggest mistake.&lt;/p&gt;

&lt;p&gt;While solving &lt;strong&gt;Swap Nodes in Pairs&lt;/strong&gt;, I created pointers like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev
current
next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → 1 → 2 → 3 → 4
       ↑   ↑
   current next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I swapped &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After swapping:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → 2 → 1 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The swap is complete.&lt;/p&gt;

&lt;p&gt;But now comes the important question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where should my pointers go next?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many beginners, including me, focus completely on the swap but forget to move the pointers for the next iteration.&lt;/p&gt;

&lt;p&gt;After swapping:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → 2 → 1 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next pair is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So our pointers need to move accordingly.&lt;/p&gt;

&lt;p&gt;If you forget to update them, you might:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process the same nodes again&lt;/li&gt;
&lt;li&gt;Skip nodes&lt;/li&gt;
&lt;li&gt;Get stuck in an infinite loop&lt;/li&gt;
&lt;li&gt;Access the wrong node&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This taught me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Creating a pointer is easy. Updating it correctly is the difficult part.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After every operation, ask yourself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Where is prev now?
Where is current now?
Where is next now?
Which node should I process next?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Mistake 6: Updating Pointers in the Wrong Order
&lt;/h1&gt;

&lt;p&gt;In Linked Lists, the order of operations matters.&lt;/p&gt;

&lt;p&gt;Let's say we have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → first → second → remaining
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → second → first → remaining
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are multiple connections we need to change.&lt;/p&gt;

&lt;p&gt;If we randomly change pointers without thinking, we can lose part of the list.&lt;/p&gt;

&lt;p&gt;Instead, visualize every step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before swapping
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → first → second → remaining
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Connect &lt;code&gt;first&lt;/code&gt; to remaining
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;first.next = second.next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;first&lt;/code&gt; knows where the remaining list starts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect &lt;code&gt;second&lt;/code&gt; to &lt;code&gt;first&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;second.next = first
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;second → first → remaining
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Connect &lt;code&gt;prev&lt;/code&gt; to &lt;code&gt;second&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev.next = second
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Final structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev → second → first → remaining
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lesson here is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't just write pointer operations. Understand what every line does to the structure.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Mistake 7: Not Using a Dummy Node
&lt;/h1&gt;

&lt;p&gt;The first node of a Linked List is special because &lt;code&gt;head&lt;/code&gt; points to it.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head
 ↓
1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After swapping the first pair:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 1 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the &lt;code&gt;head&lt;/code&gt; needs to point to &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This creates an extra case.&lt;/p&gt;

&lt;p&gt;But we can simplify this using a &lt;strong&gt;dummy node&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dummy → 1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can treat the first pair just like every other pair.&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dummy → first → second
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dummy → second → first
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the end:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;dummy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dummy node is not part of the final answer.&lt;/p&gt;

&lt;p&gt;It is just a helper.&lt;/p&gt;

&lt;h3&gt;
  
  
  When should beginners consider a Dummy Node?
&lt;/h3&gt;

&lt;p&gt;Whenever:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The head might change&lt;/li&gt;
&lt;li&gt;You need a previous pointer before the first node&lt;/li&gt;
&lt;li&gt;You are deleting nodes&lt;/li&gt;
&lt;li&gt;You are inserting nodes&lt;/li&gt;
&lt;li&gt;You are swapping nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A dummy node can make the logic much cleaner.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 8: Creating Too Many Variables
&lt;/h1&gt;

&lt;p&gt;This is something I personally did.&lt;/p&gt;

&lt;p&gt;When I got confused, instead of simplifying the logic, I created more variables.&lt;/p&gt;

&lt;p&gt;Something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;second&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;previous&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;third&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then after some time, I forgot what each variable was supposed to do. 😅&lt;/p&gt;

&lt;p&gt;The logic became messy in my head.&lt;/p&gt;

&lt;p&gt;Instead, every pointer should have a clear responsibility.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev    → Node before the pair
first   → First node of the pair
second  → Second node of the pair
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;When creating a variable, ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why do I need this pointer?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you cannot answer that clearly, you probably don't need it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 9: Losing Part of the Linked List
&lt;/h1&gt;

&lt;p&gt;This is a very common problem.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4 → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are working with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But you also need to remember:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 → 4 → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;still exists.&lt;/p&gt;

&lt;p&gt;If you incorrectly modify pointers, you might accidentally get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 1 → null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the remaining nodes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 → 4 → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;become disconnected.&lt;/p&gt;

&lt;p&gt;The final answer will be wrong because you lost part of the list.&lt;/p&gt;

&lt;p&gt;Whenever modifying nodes, think about the Linked List in three parts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Previous | Current Nodes | Remaining Nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dummy → 1 → 2 | 3 → 4 → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your job is to modify the current nodes while keeping the remaining list connected.&lt;/p&gt;

&lt;p&gt;Always ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After changing this pointer, can I still reach the remaining nodes?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Mistake 10: Not Dry Running the Code
&lt;/h1&gt;

&lt;p&gt;This was probably the thing that finally helped me solve the problem.&lt;/p&gt;

&lt;p&gt;Initially, I was doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Think → Write Code → Run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Error.&lt;/p&gt;

&lt;p&gt;Then again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Think → Write Code → Run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another error.&lt;/p&gt;

&lt;p&gt;Eventually, I stopped writing code.&lt;/p&gt;

&lt;p&gt;I took a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And drew every pointer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dummy → 1 → 2 → 3 → 4
          ↑   ↑
        first second
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I executed one line at a time.&lt;/p&gt;

&lt;p&gt;After every line, I asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What does the Linked List look like now?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is extremely useful.&lt;/p&gt;

&lt;p&gt;For Linked List problems:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Dry running is often more important than immediately writing code.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take a pen and paper.&lt;/p&gt;

&lt;p&gt;Draw boxes.&lt;/p&gt;

&lt;p&gt;Draw arrows.&lt;/p&gt;

&lt;p&gt;Move pointers.&lt;/p&gt;

&lt;p&gt;You will understand the problem much faster.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 11: Forgetting How the Loop Moves Forward
&lt;/h1&gt;

&lt;p&gt;In arrays, movement is easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The index automatically moves.&lt;/p&gt;

&lt;p&gt;But in a Linked List, you need to manually move your pointers.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important line is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without it, &lt;code&gt;current&lt;/code&gt; stays in the same place.&lt;/p&gt;

&lt;p&gt;That can cause an infinite loop.&lt;/p&gt;

&lt;p&gt;Always ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which pointer is responsible for moving through the Linked List?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And after every iteration:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did that pointer actually move forward?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Mistake 12: Forgetting Edge Cases
&lt;/h1&gt;

&lt;p&gt;Before submitting a Linked List solution, test small inputs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Empty List
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  One Node
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Two Nodes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Odd Number of Nodes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Even Number of Nodes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small test cases reveal most pointer mistakes.&lt;/p&gt;

&lt;p&gt;For example, in &lt;strong&gt;Swap Nodes in Pairs&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The answer should be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 1 → 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last node should remain unchanged.&lt;/p&gt;

&lt;p&gt;If your code assumes there are always two nodes available, it may fail.&lt;/p&gt;




&lt;h1&gt;
  
  
  Mistake 13: Accidentally Creating an Infinite Loop
&lt;/h1&gt;

&lt;p&gt;Sometimes, while reconnecting nodes, beginners accidentally create a cycle.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3
    ↑     ↓
    └─────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you traverse the list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will never reach &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The program may run forever.&lt;/p&gt;

&lt;p&gt;This usually happens when pointers are connected incorrectly.&lt;/p&gt;

&lt;p&gt;After modifying a Linked List, always check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did I connect the correct nodes?&lt;/li&gt;
&lt;li&gt;Did I accidentally point backward?&lt;/li&gt;
&lt;li&gt;Can the traversal eventually reach &lt;code&gt;null&lt;/code&gt;?&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Mistake 14: Trying to Solve Everything in One Go
&lt;/h1&gt;

&lt;p&gt;Sometimes beginners look at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 → 3 → 4 → 5 → 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And try to understand the entire transformation at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 1 → 4 → 3 → 6 → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can be overwhelming.&lt;/p&gt;

&lt;p&gt;Instead, break the problem into one small operation.&lt;/p&gt;

&lt;p&gt;Focus only on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then move to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4 → 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5 → 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6 → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Linked List problems become easier when you focus on a small local structure.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Biggest Lesson I Learned
&lt;/h1&gt;

&lt;p&gt;After spending almost &lt;strong&gt;3–4 hours&lt;/strong&gt; on one problem, I realized something.&lt;/p&gt;

&lt;p&gt;My biggest problem wasn't the syntax.&lt;/p&gt;

&lt;p&gt;It wasn't JavaScript.&lt;/p&gt;

&lt;p&gt;It wasn't even the algorithm.&lt;/p&gt;

&lt;p&gt;My biggest problem was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;I didn't know exactly where my pointers were pointing after every operation.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I would write some code.&lt;/p&gt;

&lt;p&gt;Change connections.&lt;/p&gt;

&lt;p&gt;Move some variables.&lt;/p&gt;

&lt;p&gt;Then suddenly I would forget:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Where is current now?
Where is next now?
What happened to the previous node?
Which node should I process next?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once I started dry-running every step, things became clearer.&lt;/p&gt;




&lt;h1&gt;
  
  
  My New Mental Model for Linked Lists
&lt;/h1&gt;

&lt;p&gt;Now whenever I solve a Linked List problem, I divide it into three parts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Processed | Current | Remaining
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 2 | 3 → 4 | 5 → 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose I am currently working on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 → 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Processed       Current        Remaining

1 → 2      |    3 → 4    |    5 → 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My job is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Don't break the processed part.&lt;/li&gt;
&lt;li&gt;Modify the current nodes.&lt;/li&gt;
&lt;li&gt;Don't lose the remaining nodes.&lt;/li&gt;
&lt;li&gt;Move pointers to the next position.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This way of thinking has helped me a lot.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Simple Checklist for Linked List Problems
&lt;/h1&gt;

&lt;p&gt;Before writing code, I now ask myself:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What does each pointer represent?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prev = ?
current = ?
next = ?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Can the head change?
&lt;/h3&gt;

&lt;p&gt;If yes, maybe use a dummy node.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Can the list be empty?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head = null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Can there be only one node?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Will changing &lt;code&gt;.next&lt;/code&gt; disconnect part of the list?
&lt;/h3&gt;

&lt;p&gt;Save important references first.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. How will my pointers move forward?
&lt;/h3&gt;

&lt;p&gt;Every loop iteration should make progress.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. What is my stopping condition?
&lt;/h3&gt;

&lt;p&gt;Don't access &lt;code&gt;null.next&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Did I dry run small examples?
&lt;/h3&gt;

&lt;p&gt;Always test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[]
[1]
[1, 2]
[1, 2, 3]
[1, 2, 3, 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Today, one Medium LeetCode problem took me almost &lt;strong&gt;3–4 hours&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I got stuck multiple times.&lt;/p&gt;

&lt;p&gt;I wrote the code again and again.&lt;/p&gt;

&lt;p&gt;I made pointer mistakes.&lt;/p&gt;

&lt;p&gt;I forgot to update references.&lt;/p&gt;

&lt;p&gt;I made the logic complicated.&lt;/p&gt;

&lt;p&gt;But I kept dry-running the problem until I finally understood it.&lt;/p&gt;

&lt;p&gt;And honestly, I think spending those hours was worth it.&lt;/p&gt;

&lt;p&gt;Because I didn't just solve one problem.&lt;/p&gt;

&lt;p&gt;I learned how important it is to understand:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What is pointing where?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are a beginner learning Linked Lists, don't feel bad if they take time.&lt;/p&gt;

&lt;p&gt;Linked Lists require visualization.&lt;/p&gt;

&lt;p&gt;Take your time.&lt;/p&gt;

&lt;p&gt;Draw the nodes.&lt;/p&gt;

&lt;p&gt;Draw the arrows.&lt;/p&gt;

&lt;p&gt;Write down your pointers.&lt;/p&gt;

&lt;p&gt;Execute one line at a time.&lt;/p&gt;

&lt;p&gt;And always remember:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Before changing a pointer, understand what connection you are breaking. After changing it, understand where your pointers should move next.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the lesson I learned today. 🚀&lt;/p&gt;




&lt;h2&gt;
  
  
  Related Links
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;strong&gt;LeetCode Problem:&lt;/strong&gt; &lt;a href="https://dev.toYOUR_LEETCODE_PROBLEM_LINK"&gt;Swap Nodes in Pairs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;strong&gt;Solution 1:&lt;/strong&gt; [&lt;a href="https://leetcode.com/problems/swap-nodes-in-pairs/solutions/8493093/linked-list-pair-swapping-clean-optimal-ugwmp" rel="noopener noreferrer"&gt;https://leetcode.com/problems/swap-nodes-in-pairs/solutions/8493093/linked-list-pair-swapping-clean-optimal-ugwmp&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;📝 &lt;strong&gt;Solution 2:&lt;/strong&gt; [&lt;a href="https://leetcode.com/problems/swap-nodes-in-pairs/solutions/8493072/swap-adjacent-nodes-using-pointer-manipu-fewq" rel="noopener noreferrer"&gt;https://leetcode.com/problems/swap-nodes-in-pairs/solutions/8493072/swap-adjacent-nodes-using-pointer-manipu-fewq&lt;/a&gt;]&lt;/p&gt;




&lt;h1&gt;
  
  
  javascript #leetcode #dsa #datastructures #algorithms #linkedlist #programming #codingjourney #learninginpublic #beginners #100daysofcode
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>🏆 Software Engineering Roadmap (0 Monster)</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Wed, 15 Jul 2026 13:00:23 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/software-engineering-roadmap-0-monster-53el</link>
      <guid>https://dev.to/abhishek-nexgen-dev/software-engineering-roadmap-0-monster-53el</guid>
      <description>&lt;h2&gt;
  
  
  Complete Learning Sequence for SDE | Backend | Full Stack | System Design | FAANG+ | Product Companies
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Goal:&lt;/strong&gt; Learn every important Computer Science and Software Engineering topic in the correct order—from absolute beginner to advanced—so you can become a world-class Software Engineer.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🟢 Phase 0 — Foundation
&lt;/h1&gt;

&lt;p&gt;These subjects build your programming foundation.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Computer Fundamentals ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;History of Computers&lt;/li&gt;
&lt;li&gt;Computer Architecture Basics&lt;/li&gt;
&lt;li&gt;Hardware Components&lt;/li&gt;
&lt;li&gt;Software Types&lt;/li&gt;
&lt;li&gt;Number System&lt;/li&gt;
&lt;li&gt;Binary&lt;/li&gt;
&lt;li&gt;Hexadecimal&lt;/li&gt;
&lt;li&gt;Boolean Algebra&lt;/li&gt;
&lt;li&gt;Memory Units&lt;/li&gt;
&lt;li&gt;CPU&lt;/li&gt;
&lt;li&gt;RAM&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Input &amp;amp; Output Devices&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Programming Fundamentals ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Data Types&lt;/li&gt;
&lt;li&gt;Operators&lt;/li&gt;
&lt;li&gt;Input / Output&lt;/li&gt;
&lt;li&gt;Conditional Statements&lt;/li&gt;
&lt;li&gt;Loops&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Strings&lt;/li&gt;
&lt;li&gt;Recursion&lt;/li&gt;
&lt;li&gt;File Handling&lt;/li&gt;
&lt;li&gt;Exception Handling&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Object-Oriented Programming ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Classes&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Constructors&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Encapsulation&lt;/li&gt;
&lt;li&gt;Abstraction&lt;/li&gt;
&lt;li&gt;Polymorphism&lt;/li&gt;
&lt;li&gt;Composition&lt;/li&gt;
&lt;li&gt;Association&lt;/li&gt;
&lt;li&gt;Interfaces&lt;/li&gt;
&lt;li&gt;Generics&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Git &amp;amp; GitHub ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Git Basics&lt;/li&gt;
&lt;li&gt;Repository&lt;/li&gt;
&lt;li&gt;Clone&lt;/li&gt;
&lt;li&gt;Commit&lt;/li&gt;
&lt;li&gt;Branch&lt;/li&gt;
&lt;li&gt;Merge&lt;/li&gt;
&lt;li&gt;Rebase&lt;/li&gt;
&lt;li&gt;Cherry Pick&lt;/li&gt;
&lt;li&gt;Pull Requests&lt;/li&gt;
&lt;li&gt;GitHub Flow&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Linux ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Linux Basics&lt;/li&gt;
&lt;li&gt;File System&lt;/li&gt;
&lt;li&gt;Permissions&lt;/li&gt;
&lt;li&gt;Users&lt;/li&gt;
&lt;li&gt;Groups&lt;/li&gt;
&lt;li&gt;Shell&lt;/li&gt;
&lt;li&gt;Bash&lt;/li&gt;
&lt;li&gt;Process Management&lt;/li&gt;
&lt;li&gt;Networking Commands&lt;/li&gt;
&lt;li&gt;Package Managers&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔵 Phase 1 — Problem Solving
&lt;/h1&gt;

&lt;h2&gt;
  
  
  6. Mathematics ⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set Theory&lt;/li&gt;
&lt;li&gt;Logic&lt;/li&gt;
&lt;li&gt;Number Theory&lt;/li&gt;
&lt;li&gt;Probability&lt;/li&gt;
&lt;li&gt;Combinatorics&lt;/li&gt;
&lt;li&gt;Big-O Mathematics&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. Aptitude ⭐⭐⭐⭐
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Quantitative Aptitude
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Number System&lt;/li&gt;
&lt;li&gt;Simplification&lt;/li&gt;
&lt;li&gt;Percentage&lt;/li&gt;
&lt;li&gt;Profit &amp;amp; Loss&lt;/li&gt;
&lt;li&gt;Discount&lt;/li&gt;
&lt;li&gt;Ratio &amp;amp; Proportion&lt;/li&gt;
&lt;li&gt;Partnership&lt;/li&gt;
&lt;li&gt;Average&lt;/li&gt;
&lt;li&gt;Age Problems&lt;/li&gt;
&lt;li&gt;Time &amp;amp; Work&lt;/li&gt;
&lt;li&gt;Pipes &amp;amp; Cistern&lt;/li&gt;
&lt;li&gt;Time, Speed &amp;amp; Distance&lt;/li&gt;
&lt;li&gt;Boats &amp;amp; Streams&lt;/li&gt;
&lt;li&gt;Trains&lt;/li&gt;
&lt;li&gt;Simple Interest&lt;/li&gt;
&lt;li&gt;Compound Interest&lt;/li&gt;
&lt;li&gt;Permutation &amp;amp; Combination&lt;/li&gt;
&lt;li&gt;Probability&lt;/li&gt;
&lt;li&gt;Mixture &amp;amp; Allegation&lt;/li&gt;
&lt;li&gt;Logarithms&lt;/li&gt;
&lt;li&gt;Progressions&lt;/li&gt;
&lt;li&gt;Geometry&lt;/li&gt;
&lt;li&gt;Mensuration&lt;/li&gt;
&lt;li&gt;Coordinate Geometry&lt;/li&gt;
&lt;li&gt;Trigonometry&lt;/li&gt;
&lt;li&gt;Data Interpretation&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8. Logical Reasoning ⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Coding-Decoding&lt;/li&gt;
&lt;li&gt;Blood Relations&lt;/li&gt;
&lt;li&gt;Direction Sense&lt;/li&gt;
&lt;li&gt;Seating Arrangement&lt;/li&gt;
&lt;li&gt;Puzzles&lt;/li&gt;
&lt;li&gt;Calendar&lt;/li&gt;
&lt;li&gt;Clock&lt;/li&gt;
&lt;li&gt;Ranking&lt;/li&gt;
&lt;li&gt;Series&lt;/li&gt;
&lt;li&gt;Missing Numbers&lt;/li&gt;
&lt;li&gt;Odd One Out&lt;/li&gt;
&lt;li&gt;Syllogism&lt;/li&gt;
&lt;li&gt;Statement &amp;amp; Conclusion&lt;/li&gt;
&lt;li&gt;Cause &amp;amp; Effect&lt;/li&gt;
&lt;li&gt;Decision Making&lt;/li&gt;
&lt;li&gt;Critical Reasoning&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  9. Verbal Ability ⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reading Comprehension&lt;/li&gt;
&lt;li&gt;Grammar&lt;/li&gt;
&lt;li&gt;Vocabulary&lt;/li&gt;
&lt;li&gt;Synonyms&lt;/li&gt;
&lt;li&gt;Antonyms&lt;/li&gt;
&lt;li&gt;Sentence Correction&lt;/li&gt;
&lt;li&gt;Error Detection&lt;/li&gt;
&lt;li&gt;Para Jumbles&lt;/li&gt;
&lt;li&gt;Cloze Test&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟣 Phase 2 — Data Structures &amp;amp; Algorithms ⭐⭐⭐⭐⭐
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Data Structures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Strings&lt;/li&gt;
&lt;li&gt;Linked Lists&lt;/li&gt;
&lt;li&gt;Stack&lt;/li&gt;
&lt;li&gt;Queue&lt;/li&gt;
&lt;li&gt;Hash Table&lt;/li&gt;
&lt;li&gt;Heap&lt;/li&gt;
&lt;li&gt;Tree&lt;/li&gt;
&lt;li&gt;BST&lt;/li&gt;
&lt;li&gt;Trie&lt;/li&gt;
&lt;li&gt;Graph&lt;/li&gt;
&lt;li&gt;Disjoint Set&lt;/li&gt;
&lt;li&gt;Segment Tree&lt;/li&gt;
&lt;li&gt;Fenwick Tree&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Algorithms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Searching&lt;/li&gt;
&lt;li&gt;Binary Search&lt;/li&gt;
&lt;li&gt;Sliding Window&lt;/li&gt;
&lt;li&gt;Two Pointers&lt;/li&gt;
&lt;li&gt;Prefix Sum&lt;/li&gt;
&lt;li&gt;Recursion&lt;/li&gt;
&lt;li&gt;Backtracking&lt;/li&gt;
&lt;li&gt;Greedy&lt;/li&gt;
&lt;li&gt;Divide &amp;amp; Conquer&lt;/li&gt;
&lt;li&gt;Dynamic Programming&lt;/li&gt;
&lt;li&gt;Bit Manipulation&lt;/li&gt;
&lt;li&gt;Graph Algorithms&lt;/li&gt;
&lt;li&gt;String Algorithms&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟠 Phase 3 — Core Computer Science
&lt;/h1&gt;

&lt;h2&gt;
  
  
  10. Operating Systems ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Threads&lt;/li&gt;
&lt;li&gt;Scheduling&lt;/li&gt;
&lt;li&gt;Synchronization&lt;/li&gt;
&lt;li&gt;Mutex&lt;/li&gt;
&lt;li&gt;Semaphore&lt;/li&gt;
&lt;li&gt;Deadlocks&lt;/li&gt;
&lt;li&gt;Memory Management&lt;/li&gt;
&lt;li&gt;Virtual Memory&lt;/li&gt;
&lt;li&gt;Paging&lt;/li&gt;
&lt;li&gt;Segmentation&lt;/li&gt;
&lt;li&gt;File Systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  11. Computer Networks ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Network Fundamentals&lt;/li&gt;
&lt;li&gt;OSI&lt;/li&gt;
&lt;li&gt;TCP/IP&lt;/li&gt;
&lt;li&gt;IP Addressing&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;DNS&lt;/li&gt;
&lt;li&gt;HTTP&lt;/li&gt;
&lt;li&gt;HTTPS&lt;/li&gt;
&lt;li&gt;TLS&lt;/li&gt;
&lt;li&gt;TCP&lt;/li&gt;
&lt;li&gt;UDP&lt;/li&gt;
&lt;li&gt;WebSockets&lt;/li&gt;
&lt;li&gt;CDN&lt;/li&gt;
&lt;li&gt;Load Balancing&lt;/li&gt;
&lt;li&gt;Reverse Proxy&lt;/li&gt;
&lt;li&gt;Cloud Networking&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  12. Database Management Systems ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;h3&gt;
  
  
  SQL
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  NoSQL
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Cassandra&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;ACID&lt;/li&gt;
&lt;li&gt;Indexing&lt;/li&gt;
&lt;li&gt;Replication&lt;/li&gt;
&lt;li&gt;Sharding&lt;/li&gt;
&lt;li&gt;Partitioning&lt;/li&gt;
&lt;li&gt;CAP Theorem&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔴 Phase 4 — Software Engineering
&lt;/h1&gt;

&lt;h2&gt;
  
  
  13. Software Engineering Principles ⭐⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SDLC&lt;/li&gt;
&lt;li&gt;Agile&lt;/li&gt;
&lt;li&gt;Scrum&lt;/li&gt;
&lt;li&gt;SOLID&lt;/li&gt;
&lt;li&gt;DRY&lt;/li&gt;
&lt;li&gt;KISS&lt;/li&gt;
&lt;li&gt;YAGNI&lt;/li&gt;
&lt;li&gt;Design Principles&lt;/li&gt;
&lt;li&gt;Clean Code&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  14. Design Patterns ⭐⭐⭐⭐
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Factory&lt;/li&gt;
&lt;li&gt;Singleton&lt;/li&gt;
&lt;li&gt;Builder&lt;/li&gt;
&lt;li&gt;Strategy&lt;/li&gt;
&lt;li&gt;Observer&lt;/li&gt;
&lt;li&gt;Adapter&lt;/li&gt;
&lt;li&gt;Decorator&lt;/li&gt;
&lt;li&gt;Repository&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟡 Phase 5 — Backend Development ⭐⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;REST APIs&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Authorization&lt;/li&gt;
&lt;li&gt;JWT&lt;/li&gt;
&lt;li&gt;OAuth&lt;/li&gt;
&lt;li&gt;GraphQL&lt;/li&gt;
&lt;li&gt;gRPC&lt;/li&gt;
&lt;li&gt;File Upload&lt;/li&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟢 Phase 6 — Frontend (Optional for Backend) ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Accessibility&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔵 Phase 7 — Cloud &amp;amp; DevOps ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Docker
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Kubernetes
&lt;/h2&gt;

&lt;h2&gt;
  
  
  AWS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;EC2&lt;/li&gt;
&lt;li&gt;S3&lt;/li&gt;
&lt;li&gt;IAM&lt;/li&gt;
&lt;li&gt;VPC&lt;/li&gt;
&lt;li&gt;Lambda&lt;/li&gt;
&lt;li&gt;CloudFront&lt;/li&gt;
&lt;li&gt;Route53&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CI/CD
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;Jenkins&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟣 Phase 8 — System Design ⭐⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Capacity Estimation&lt;/li&gt;
&lt;li&gt;Request Lifecycle&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;CDN&lt;/li&gt;
&lt;li&gt;API Design&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Load Balancing&lt;/li&gt;
&lt;li&gt;Message Queues&lt;/li&gt;
&lt;li&gt;Distributed Systems&lt;/li&gt;
&lt;li&gt;Reliability&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Microservices&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Observability&lt;/li&gt;
&lt;li&gt;LLD&lt;/li&gt;
&lt;li&gt;HLD&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟠 Phase 9 — Distributed Systems ⭐⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;CAP&lt;/li&gt;
&lt;li&gt;PACELC&lt;/li&gt;
&lt;li&gt;CQRS&lt;/li&gt;
&lt;li&gt;Event Sourcing&lt;/li&gt;
&lt;li&gt;Saga&lt;/li&gt;
&lt;li&gt;Outbox&lt;/li&gt;
&lt;li&gt;Raft&lt;/li&gt;
&lt;li&gt;Paxos&lt;/li&gt;
&lt;li&gt;Service Mesh&lt;/li&gt;
&lt;li&gt;Distributed Locks&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔴 Phase 10 — Security ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;HTTPS&lt;/li&gt;
&lt;li&gt;TLS&lt;/li&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;Hashing&lt;/li&gt;
&lt;li&gt;OAuth&lt;/li&gt;
&lt;li&gt;OWASP Top 10&lt;/li&gt;
&lt;li&gt;XSS&lt;/li&gt;
&lt;li&gt;CSRF&lt;/li&gt;
&lt;li&gt;SQL Injection&lt;/li&gt;
&lt;li&gt;CORS&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟡 Phase 11 — Testing ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Unit Testing&lt;/li&gt;
&lt;li&gt;Integration Testing&lt;/li&gt;
&lt;li&gt;API Testing&lt;/li&gt;
&lt;li&gt;E2E Testing&lt;/li&gt;
&lt;li&gt;Performance Testing&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟢 Phase 12 — Performance Engineering ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Profiling&lt;/li&gt;
&lt;li&gt;Bottleneck Analysis&lt;/li&gt;
&lt;li&gt;Load Testing&lt;/li&gt;
&lt;li&gt;Stress Testing&lt;/li&gt;
&lt;li&gt;Capacity Planning&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔵 Phase 13 — Observability ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;li&gt;Metrics&lt;/li&gt;
&lt;li&gt;Tracing&lt;/li&gt;
&lt;li&gt;Prometheus&lt;/li&gt;
&lt;li&gt;Grafana&lt;/li&gt;
&lt;li&gt;OpenTelemetry&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟣 Phase 14 — Engineering Excellence ⭐⭐⭐⭐
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;ADR&lt;/li&gt;
&lt;li&gt;RFC&lt;/li&gt;
&lt;li&gt;Code Reviews&lt;/li&gt;
&lt;li&gt;Debugging&lt;/li&gt;
&lt;li&gt;Incident Response&lt;/li&gt;
&lt;li&gt;Technical Debt&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🟠 Phase 15 — Projects ⭐⭐⭐⭐⭐
&lt;/h1&gt;

&lt;p&gt;Build progressively:&lt;/p&gt;

&lt;h3&gt;
  
  
  Beginner
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Calculator&lt;/li&gt;
&lt;li&gt;Todo App&lt;/li&gt;
&lt;li&gt;Blog API&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Intermediate
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Authentication System&lt;/li&gt;
&lt;li&gt;Chat Application&lt;/li&gt;
&lt;li&gt;URL Shortener&lt;/li&gt;
&lt;li&gt;File Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Payment Gateway&lt;/li&gt;
&lt;li&gt;Notification Service&lt;/li&gt;
&lt;li&gt;Search Engine&lt;/li&gt;
&lt;li&gt;Ride Sharing Backend&lt;/li&gt;
&lt;li&gt;Video Streaming Platform&lt;/li&gt;
&lt;li&gt;Distributed Cache&lt;/li&gt;
&lt;li&gt;Analytics Platform&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔴 Phase 16 — Interview Preparation ⭐⭐⭐⭐⭐
&lt;/h1&gt;

&lt;h2&gt;
  
  
  DSA
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;300–500 Quality Problems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  LLD
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;30–50 Problems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HLD
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;30–50 Designs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Behavioral
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;STAR Method&lt;/li&gt;
&lt;li&gt;Leadership Principles&lt;/li&gt;
&lt;li&gt;Communication&lt;/li&gt;
&lt;li&gt;Resume&lt;/li&gt;
&lt;li&gt;Mock Interviews&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🏁 Final Learning Order
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Computer Fundamentals
2. Programming Fundamentals
3. Object-Oriented Programming
4. Git &amp;amp; GitHub
5. Linux
6. Mathematics
7. Aptitude
8. Logical Reasoning
9. Verbal Ability
10. Data Structures
11. Algorithms
12. Operating Systems
13. Computer Networks
14. Database Management Systems
15. Software Engineering Principles
16. Design Patterns
17. Backend Development
18. Frontend (Optional)
19. Cloud Computing
20. Docker
21. Kubernetes
22. DevOps &amp;amp; CI/CD
23. System Design
24. Distributed Systems
25. Security
26. Testing
27. Performance Engineering
28. Observability
29. Engineering Excellence
30. Production Projects
31. Interview Preparation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Master AI: From Beginner to Advanced 🚀</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Fri, 10 Jul 2026 04:40:21 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/master-ai-from-beginner-to-advanced-333a</link>
      <guid>https://dev.to/abhishek-nexgen-dev/master-ai-from-beginner-to-advanced-333a</guid>
      <description>&lt;p&gt;Hello everyone! 👋&lt;/p&gt;

&lt;p&gt;Have you ever used AI tools like &lt;strong&gt;ChatGPT, Gemini, Claude, GitHub Copilot, Perplexity, Microsoft Copilot&lt;/strong&gt;, or others?&lt;/p&gt;

&lt;p&gt;Today, AI is becoming a part of our daily lives. Students use it for learning, developers use it to write code, designers use it to generate images, and businesses use it to automate work.&lt;/p&gt;

&lt;p&gt;But have you ever wondered...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How does AI actually work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can it answer our questions in just a few seconds?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can AI answer every question in the world?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this series, we'll learn everything about &lt;strong&gt;Generative AI&lt;/strong&gt;, starting from the basics and gradually moving to advanced concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤖 What is Artificial Intelligence (AI)?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Artificial Intelligence (AI)&lt;/strong&gt; is a technology that enables computers and machines to perform tasks that normally require human intelligence.&lt;/p&gt;

&lt;p&gt;These tasks include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning from data&lt;/li&gt;
&lt;li&gt;Understanding language&lt;/li&gt;
&lt;li&gt;Solving problems&lt;/li&gt;
&lt;li&gt;Recognizing images&lt;/li&gt;
&lt;li&gt;Writing content&lt;/li&gt;
&lt;li&gt;Answering questions&lt;/li&gt;
&lt;li&gt;Making predictions&lt;/li&gt;
&lt;li&gt;Assisting humans in decision-making&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In simple words,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI is a system that learns from data and uses what it has learned to solve problems or generate responses.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧠 How Does AI Learn?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftiqa0tdj4ftmapglqau2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftiqa0tdj4ftmapglqau2.png" alt=" " width="800" height="538"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before an AI tool like &lt;strong&gt;ChatGPT, Gemini, Claude, or GitHub Copilot&lt;/strong&gt; can answer your questions, it first needs to &lt;strong&gt;learn&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But unlike humans, AI doesn't go to school, attend classes, or read books like we do.&lt;/p&gt;

&lt;p&gt;Instead, AI learns by being trained on a &lt;strong&gt;huge amount of data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This data can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📚 Books&lt;/li&gt;
&lt;li&gt;📰 Articles&lt;/li&gt;
&lt;li&gt;🌐 Websites&lt;/li&gt;
&lt;li&gt;📄 Research papers&lt;/li&gt;
&lt;li&gt;💻 Programming code&lt;/li&gt;
&lt;li&gt;📘 Documentation&lt;/li&gt;
&lt;li&gt;💬 Public conversations&lt;/li&gt;
&lt;li&gt;🖼️ Images&lt;/li&gt;
&lt;li&gt;🎥 Videos&lt;/li&gt;
&lt;li&gt;🎧 Audio&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can think of this as giving AI access to a &lt;strong&gt;very large digital library&lt;/strong&gt; with information on many different topics.&lt;/p&gt;

&lt;p&gt;During training, AI reads and analyzes all this data.&lt;/p&gt;

&lt;p&gt;It doesn't try to memorize every sentence or every answer.&lt;/p&gt;

&lt;p&gt;Instead, it learns &lt;strong&gt;patterns&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, it learns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How people write and speak.&lt;/li&gt;
&lt;li&gt;How grammar works.&lt;/li&gt;
&lt;li&gt;How to solve different types of problems.&lt;/li&gt;
&lt;li&gt;How programming languages are written.&lt;/li&gt;
&lt;li&gt;How different ideas are connected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The more high-quality data AI learns from, the better it becomes at understanding questions and generating useful answers.&lt;/p&gt;




&lt;h3&gt;
  
  
  📌 In Simple Words
&lt;/h3&gt;

&lt;p&gt;Imagine you've read &lt;strong&gt;1,000 books&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When someone asks you a question, you don't remember every word from those books.&lt;/p&gt;

&lt;p&gt;Instead, you use the knowledge you've gained to think and answer.&lt;/p&gt;

&lt;p&gt;AI works in a similar way.&lt;/p&gt;

&lt;p&gt;It learns from a huge amount of information and then uses what it has learned to generate the best possible response.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI doesn't simply memorize answers—it learns from lots of data, finds patterns, and uses those patterns to answer new questions.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  👦 Let's Understand AI with a Simple Example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1u1pur3fopjqf0vhmyy8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1u1pur3fopjqf0vhmyy8.png" alt=" " width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine there's a boy named &lt;strong&gt;Ram&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Ram studies in a school where he learns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mathematics&lt;/li&gt;
&lt;li&gt;Science&lt;/li&gt;
&lt;li&gt;English&lt;/li&gt;
&lt;li&gt;Social Studies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, his school does &lt;strong&gt;not&lt;/strong&gt; have a Computer Science subject.&lt;/p&gt;

&lt;p&gt;After school, Ram also doesn't watch computer tutorials, read programming books, or learn from the internet.&lt;/p&gt;

&lt;p&gt;Now imagine someone asks Ram:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What is JavaScript?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"How does a computer work?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Can Ram answer these questions?&lt;/p&gt;

&lt;h3&gt;
  
  
  The answer is &lt;strong&gt;No.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because Ram has never learned anything about computers.&lt;/p&gt;

&lt;p&gt;He cannot answer questions about a topic he has never studied.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤖 AI Learns in a Similar Way
&lt;/h2&gt;

&lt;p&gt;AI learns in a way that's similar to how humans learn.&lt;/p&gt;

&lt;p&gt;If an AI has never learned about a particular topic during its training, it may not be able to give the correct answer.&lt;/p&gt;

&lt;p&gt;For example, if you ask it about something completely new that wasn't part of its training data, it might give an incorrect answer or say that it doesn't know.&lt;/p&gt;

&lt;p&gt;However, modern AI is much more powerful than a simple question-and-answer machine.&lt;/p&gt;

&lt;p&gt;Instead of memorizing answers, it learns &lt;strong&gt;patterns&lt;/strong&gt; from the data it was trained on.&lt;/p&gt;

&lt;p&gt;This allows AI to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧠 Understand your question.&lt;/li&gt;
&lt;li&gt;🔗 Connect different pieces of knowledge.&lt;/li&gt;
&lt;li&gt;💡 Use logic to answer questions it has never seen before.&lt;/li&gt;
&lt;li&gt;🌐 Sometimes use the internet or other tools (if available) to find up-to-date information.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📌 In Simple Words
&lt;/h3&gt;

&lt;p&gt;Think of AI as a student who has studied millions of books.&lt;/p&gt;

&lt;p&gt;Even if the student has never seen your exact question before, they can often use what they've learned to think, connect ideas, and give a meaningful answer.&lt;/p&gt;

&lt;p&gt;That's why AI can answer many new questions—but it can still make mistakes, especially when the information is missing, unclear, or outside what it has learned.&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 Does AI Know Everything?
&lt;/h2&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;AI does &lt;strong&gt;not&lt;/strong&gt; know everything.&lt;/p&gt;

&lt;p&gt;It has limitations.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It may not know very recent events if it hasn't been updated or connected to live information.&lt;/li&gt;
&lt;li&gt;It can make mistakes or "hallucinate" incorrect information.&lt;/li&gt;
&lt;li&gt;It may misunderstand unclear questions.&lt;/li&gt;
&lt;li&gt;It can only answer based on what it has learned and the information available to it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's why it's always a good idea to verify important information from trusted sources.&lt;/p&gt;




&lt;p&gt;Here's a beginner-friendly section with a simple ASCII diagram that explains the complete flow from a user's prompt to an AI's response. It also clarifies what LLMs and SLMs are.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 How Does AI Answer Your Questions?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fazgfar1xs7e52vrw72eu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fazgfar1xs7e52vrw72eu.png" alt=" " width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you ask a question to an AI like &lt;strong&gt;ChatGPT, Gemini, Claude, or GitHub Copilot&lt;/strong&gt;, a lot happens behind the scenes.&lt;/p&gt;

&lt;p&gt;Let's understand the complete process step by step.&lt;/p&gt;




&lt;h3&gt;
  
  
  📌 Step 1: You Give a Prompt
&lt;/h3&gt;

&lt;p&gt;Everything starts with a &lt;strong&gt;Prompt&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A prompt is simply the instruction, question, or message you give to the AI.&lt;/p&gt;

&lt;h4&gt;
  
  
  Examples
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is Artificial Intelligence?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="n"&gt;program&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain Newton's First Law in simple words.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The better your prompt is, the better the AI can understand what you want.&lt;/p&gt;




&lt;h3&gt;
  
  
  📌 Step 2: AI Understands Your Prompt
&lt;/h3&gt;

&lt;p&gt;After receiving your prompt, the AI analyzes it.&lt;/p&gt;

&lt;p&gt;It tries to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are you asking?&lt;/li&gt;
&lt;li&gt;What information do you need?&lt;/li&gt;
&lt;li&gt;What language should it respond in?&lt;/li&gt;
&lt;li&gt;Should it explain, summarize, write code, or solve a problem?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This step helps the AI determine the best way to answer your request.&lt;/p&gt;




&lt;h3&gt;
  
  
  📌 Step 3: AI Uses What It Learned During Training
&lt;/h3&gt;

&lt;p&gt;Before AI can answer questions, it must first be &lt;strong&gt;trained&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;During training, it learns from a huge amount of data, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📚 Books&lt;/li&gt;
&lt;li&gt;🌐 Websites&lt;/li&gt;
&lt;li&gt;📰 Articles&lt;/li&gt;
&lt;li&gt;📄 Research papers&lt;/li&gt;
&lt;li&gt;💻 Programming code&lt;/li&gt;
&lt;li&gt;📘 Documentation&lt;/li&gt;
&lt;li&gt;💬 Public conversations&lt;/li&gt;
&lt;li&gt;🖼️ Images&lt;/li&gt;
&lt;li&gt;🎥 Videos&lt;/li&gt;
&lt;li&gt;🎧 Audio&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of memorizing every sentence, the AI learns &lt;strong&gt;patterns&lt;/strong&gt;, &lt;strong&gt;relationships&lt;/strong&gt;, and &lt;strong&gt;how language works&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you ask a question, it uses those learned patterns to generate the most appropriate response.&lt;/p&gt;




&lt;h3&gt;
  
  
  📌 Step 4: AI Generates a Response
&lt;/h3&gt;

&lt;p&gt;Finally, the AI predicts the next words one by one until it forms a complete answer.&lt;/p&gt;

&lt;p&gt;It doesn't search through a giant list of stored answers.&lt;/p&gt;

&lt;p&gt;Instead, it &lt;strong&gt;creates a new response&lt;/strong&gt; based on everything it learned during training.&lt;/p&gt;

&lt;p&gt;This is why AI can answer questions it has never seen before.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤔 What is an LLM?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;LLM&lt;/strong&gt; stands for &lt;strong&gt;Large Language Model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;An LLM is an AI model trained on a &lt;strong&gt;very large amount of text data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ChatGPT (GPT models)&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;li&gt;Claude&lt;/li&gt;
&lt;li&gt;Llama&lt;/li&gt;
&lt;li&gt;DeepSeek&lt;/li&gt;
&lt;li&gt;Mistral&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because they learn from vast amounts of data, they can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Answer questions&lt;/li&gt;
&lt;li&gt;Write code&lt;/li&gt;
&lt;li&gt;Translate languages&lt;/li&gt;
&lt;li&gt;Summarize documents&lt;/li&gt;
&lt;li&gt;Generate emails&lt;/li&gt;
&lt;li&gt;Explain concepts&lt;/li&gt;
&lt;li&gt;Solve many different tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of an LLM as a student who has read &lt;strong&gt;millions of books and documents&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤏 What is an SLM?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SLM&lt;/strong&gt; stands for &lt;strong&gt;Small Language Model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It works the same way as an LLM, but it has &lt;strong&gt;fewer parameters&lt;/strong&gt; and is trained to be smaller and more efficient.&lt;/p&gt;

&lt;p&gt;SLMs are designed for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📱 Mobile phones&lt;/li&gt;
&lt;li&gt;💻 Laptops&lt;/li&gt;
&lt;li&gt;🤖 Edge devices&lt;/li&gt;
&lt;li&gt;🚗 Smart devices&lt;/li&gt;
&lt;li&gt;Offline AI applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because they are smaller, they:&lt;/p&gt;

&lt;p&gt;✅ Use less memory&lt;/p&gt;

&lt;p&gt;✅ Are faster&lt;/p&gt;

&lt;p&gt;✅ Cost less to run&lt;/p&gt;

&lt;p&gt;But they may not perform as well as large models on very complex tasks.&lt;/p&gt;

&lt;p&gt;Examples include Microsoft's Phi family and Google's Gemma family (smaller variants).&lt;/p&gt;




&lt;h3&gt;
  
  
  📊 LLM vs SLM
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;LLM (Large Language Model)&lt;/th&gt;
&lt;th&gt;SLM (Small Language Model)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model Size&lt;/td&gt;
&lt;td&gt;Very Large&lt;/td&gt;
&lt;td&gt;Small&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Training Data&lt;/td&gt;
&lt;td&gt;Huge&lt;/td&gt;
&lt;td&gt;Smaller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parameters&lt;/td&gt;
&lt;td&gt;Billions (sometimes trillions in mixtures)&lt;/td&gt;
&lt;td&gt;Millions to a few billion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accuracy&lt;/td&gt;
&lt;td&gt;Usually higher&lt;/td&gt;
&lt;td&gt;Good for many tasks, but generally lower on complex reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Slower&lt;/td&gt;
&lt;td&gt;Faster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory Usage&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Higher&lt;/td&gt;
&lt;td&gt;Lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best For&lt;/td&gt;
&lt;td&gt;Complex reasoning, coding, research, writing&lt;/td&gt;
&lt;td&gt;Mobile apps, edge AI, offline assistants&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  🚀 What Can AI Do?
&lt;/h2&gt;

&lt;p&gt;Artificial Intelligence (AI) can perform many tasks that normally require human intelligence. It can understand information, learn patterns, solve problems, and help people work faster and smarter.&lt;/p&gt;

&lt;p&gt;Here are some of the most common things AI can do:&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 1. Answer Questions
&lt;/h3&gt;

&lt;p&gt;AI can answer questions on almost any topic, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Science&lt;/li&gt;
&lt;li&gt;Mathematics&lt;/li&gt;
&lt;li&gt;History&lt;/li&gt;
&lt;li&gt;Geography&lt;/li&gt;
&lt;li&gt;Programming&lt;/li&gt;
&lt;li&gt;Business&lt;/li&gt;
&lt;li&gt;Health (general information)&lt;/li&gt;
&lt;li&gt;Technology&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is Artificial Intelligence?&lt;/p&gt;

&lt;p&gt;Explain Newton's First Law.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  ✍️ 2. Write Content
&lt;/h3&gt;

&lt;p&gt;AI can generate different types of written content, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blogs&lt;/li&gt;
&lt;li&gt;Articles&lt;/li&gt;
&lt;li&gt;Emails&lt;/li&gt;
&lt;li&gt;Essays&lt;/li&gt;
&lt;li&gt;Stories&lt;/li&gt;
&lt;li&gt;Reports&lt;/li&gt;
&lt;li&gt;LinkedIn posts&lt;/li&gt;
&lt;li&gt;Social media captions&lt;/li&gt;
&lt;li&gt;Product descriptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a LinkedIn post about Machine Learning.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  💻 3. Write and Explain Code
&lt;/h3&gt;

&lt;p&gt;AI can help developers by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writing code&lt;/li&gt;
&lt;li&gt;Fixing bugs&lt;/li&gt;
&lt;li&gt;Explaining code&lt;/li&gt;
&lt;li&gt;Optimizing programs&lt;/li&gt;
&lt;li&gt;Building websites&lt;/li&gt;
&lt;li&gt;Creating APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It supports many programming languages, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;li&gt;SQL&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🌍 4. Translate Languages
&lt;/h3&gt;

&lt;p&gt;AI can translate text between many languages.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;English → Hindi&lt;/li&gt;
&lt;li&gt;Hindi → English&lt;/li&gt;
&lt;li&gt;English → French&lt;/li&gt;
&lt;li&gt;English → Japanese&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It can also explain difficult words in simple language.&lt;/p&gt;




&lt;h3&gt;
  
  
  📄 5. Summarize Documents
&lt;/h3&gt;

&lt;p&gt;AI can quickly read long documents and provide a short, easy-to-understand summary.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Research papers&lt;/li&gt;
&lt;li&gt;PDFs&lt;/li&gt;
&lt;li&gt;Books&lt;/li&gt;
&lt;li&gt;Reports&lt;/li&gt;
&lt;li&gt;Meeting notes&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📊 6. Analyze Data
&lt;/h3&gt;

&lt;p&gt;AI can analyze large amounts of data and identify patterns.&lt;/p&gt;

&lt;p&gt;It can help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sales analysis&lt;/li&gt;
&lt;li&gt;Business reports&lt;/li&gt;
&lt;li&gt;Customer insights&lt;/li&gt;
&lt;li&gt;Predictions&lt;/li&gt;
&lt;li&gt;Trend analysis&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🖼️ 7. Generate Images
&lt;/h3&gt;

&lt;p&gt;Modern AI can create images from text descriptions.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Create an image of a futuristic smart city."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It can also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit photos&lt;/li&gt;
&lt;li&gt;Remove backgrounds&lt;/li&gt;
&lt;li&gt;Change image styles&lt;/li&gt;
&lt;li&gt;Create logos&lt;/li&gt;
&lt;li&gt;Design posters&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎥 8. Generate Videos
&lt;/h3&gt;

&lt;p&gt;AI can create videos from text or images.&lt;/p&gt;

&lt;p&gt;It can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate animations&lt;/li&gt;
&lt;li&gt;Create educational videos&lt;/li&gt;
&lt;li&gt;Produce marketing videos&lt;/li&gt;
&lt;li&gt;Create AI avatars&lt;/li&gt;
&lt;li&gt;Generate short clips&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎙️ 9. Understand and Generate Speech
&lt;/h3&gt;

&lt;p&gt;AI can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convert speech into text&lt;/li&gt;
&lt;li&gt;Convert text into speech&lt;/li&gt;
&lt;li&gt;Recognize different voices&lt;/li&gt;
&lt;li&gt;Translate spoken language&lt;/li&gt;
&lt;li&gt;Create natural-sounding voices&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🤖 10. Build AI Assistants
&lt;/h3&gt;

&lt;p&gt;AI can work as a personal assistant that helps with daily tasks.&lt;/p&gt;

&lt;p&gt;For example, it can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Schedule meetings&lt;/li&gt;
&lt;li&gt;Answer emails&lt;/li&gt;
&lt;li&gt;Set reminders&lt;/li&gt;
&lt;li&gt;Search for information&lt;/li&gt;
&lt;li&gt;Organize tasks&lt;/li&gt;
&lt;li&gt;Help manage projects&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎓 11. Help Students Learn
&lt;/h3&gt;

&lt;p&gt;AI is an excellent learning companion.&lt;/p&gt;

&lt;p&gt;It can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explain difficult topics&lt;/li&gt;
&lt;li&gt;Solve math problems&lt;/li&gt;
&lt;li&gt;Generate quizzes&lt;/li&gt;
&lt;li&gt;Create study notes&lt;/li&gt;
&lt;li&gt;Prepare interview questions&lt;/li&gt;
&lt;li&gt;Help with assignments&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏥 12. Help Different Industries
&lt;/h3&gt;

&lt;p&gt;AI is used in many industries, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🏥 Healthcare&lt;/li&gt;
&lt;li&gt;🏦 Banking&lt;/li&gt;
&lt;li&gt;🛒 E-commerce&lt;/li&gt;
&lt;li&gt;🚗 Automotive&lt;/li&gt;
&lt;li&gt;🎮 Gaming&lt;/li&gt;
&lt;li&gt;📚 Education&lt;/li&gt;
&lt;li&gt;✈️ Travel&lt;/li&gt;
&lt;li&gt;🎬 Entertainment&lt;/li&gt;
&lt;li&gt;🌾 Agriculture&lt;/li&gt;
&lt;li&gt;🏭 Manufacturing&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚡ 13. Automate Repetitive Tasks
&lt;/h3&gt;

&lt;p&gt;AI can save time by automating repetitive work.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data entry&lt;/li&gt;
&lt;li&gt;Email replies&lt;/li&gt;
&lt;li&gt;Customer support&lt;/li&gt;
&lt;li&gt;Invoice processing&lt;/li&gt;
&lt;li&gt;Report generation&lt;/li&gt;
&lt;li&gt;Document classification&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 In Simple Words
&lt;/h2&gt;

&lt;p&gt;Think of AI as a &lt;strong&gt;smart assistant&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📖 Learn from data&lt;/li&gt;
&lt;li&gt;💬 Answer questions&lt;/li&gt;
&lt;li&gt;✍️ Write content&lt;/li&gt;
&lt;li&gt;💻 Write code&lt;/li&gt;
&lt;li&gt;🌍 Translate languages&lt;/li&gt;
&lt;li&gt;📄 Summarize information&lt;/li&gt;
&lt;li&gt;📊 Analyze data&lt;/li&gt;
&lt;li&gt;🖼️ Generate images&lt;/li&gt;
&lt;li&gt;🎥 Create videos&lt;/li&gt;
&lt;li&gt;🎙️ Understand speech&lt;/li&gt;
&lt;li&gt;🤖 Automate tasks&lt;/li&gt;
&lt;li&gt;🎓 Help you learn&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧠 Examples of AI Around Us
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdgeqgsvxe4qv4kdw4i16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdgeqgsvxe4qv4kdw4i16.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🧪 Practice Activity: Compare Different AI Models
&lt;/h1&gt;

&lt;p&gt;Now it's time for a fun activity! 🎉&lt;/p&gt;

&lt;p&gt;Don't just read about AI—&lt;strong&gt;experience it yourself.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open any &lt;strong&gt;three&lt;/strong&gt; AI tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🤖 ChatGPT&lt;/li&gt;
&lt;li&gt;💎 Gemini&lt;/li&gt;
&lt;li&gt;🧠 Claude&lt;/li&gt;
&lt;li&gt;🇮🇳 Sarvam AI&lt;/li&gt;
&lt;li&gt;💻 GitHub Copilot (for coding)&lt;/li&gt;
&lt;li&gt;🔍 Perplexity AI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now copy the &lt;strong&gt;same prompt&lt;/strong&gt; into each AI and compare their answers.&lt;/p&gt;

&lt;p&gt;You'll notice something interesting...&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Every AI gives a different answer!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's see why.&lt;/p&gt;




&lt;h1&gt;
  
  
  📝 Prompt 1: Learning
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain Artificial Intelligence in simple words with a real-life example.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which AI gives the simplest explanation?&lt;/li&gt;
&lt;li&gt;Which one gives the best example?&lt;/li&gt;
&lt;li&gt;Which answer is easiest to understand?&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  💻 Prompt 2: Coding
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a Python program to check whether a number is prime and explain each line of code.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which AI writes cleaner code?&lt;/li&gt;
&lt;li&gt;Which explanation is easier to understand?&lt;/li&gt;
&lt;li&gt;Which one teaches you better?&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  ✍️ Prompt 3: Creative Writing
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a short motivational story about a student who learns AI from scratch and becomes an AI Engineer.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which story is more creative?&lt;/li&gt;
&lt;li&gt;Which one feels more inspiring?&lt;/li&gt;
&lt;li&gt;Which writing style do you like the most?&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🤔 Why Does Every AI Give a Different Answer?
&lt;/h1&gt;

&lt;p&gt;This is one of the most common questions beginners ask.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"If I asked the same question, why didn't every AI give the same answer?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer is simple.&lt;/p&gt;

&lt;p&gt;Every AI is built differently.&lt;/p&gt;

&lt;p&gt;Think of it like this...&lt;/p&gt;

&lt;p&gt;Imagine &lt;strong&gt;three students&lt;/strong&gt; preparing for the same exam.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student A studies from &lt;strong&gt;Book A&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Student B studies from &lt;strong&gt;Book B&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Student C studies from &lt;strong&gt;Book C&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now ask all three students the same question.&lt;/p&gt;

&lt;p&gt;Will they all give &lt;strong&gt;exactly the same answer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even though the question is the same, each student explains it differently because they learned from different books and have different ways of understanding the topic.&lt;/p&gt;

&lt;p&gt;AI works in a very similar way.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤖 Why Are AI Models Different?
&lt;/h2&gt;

&lt;p&gt;There are several reasons:&lt;/p&gt;

&lt;h3&gt;
  
  
  📚 1. Different Training Data
&lt;/h3&gt;

&lt;p&gt;Every AI learns from different collections of data.&lt;/p&gt;

&lt;p&gt;Some models learn more from programming content.&lt;/p&gt;

&lt;p&gt;Some learn more from books.&lt;/p&gt;

&lt;p&gt;Some are better at conversations.&lt;/p&gt;

&lt;p&gt;So each model gains different strengths.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 2. Different Model Design
&lt;/h3&gt;

&lt;p&gt;Every company builds its AI differently.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI built ChatGPT.&lt;/li&gt;
&lt;li&gt;Google built Gemini.&lt;/li&gt;
&lt;li&gt;Anthropic built Claude.&lt;/li&gt;
&lt;li&gt;Sarvam AI is developed with a focus on Indian languages and use cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each company uses its own technology and methods to train its model.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚙️ 3. Different Training Methods
&lt;/h3&gt;

&lt;p&gt;After learning from data, companies continue improving their AI.&lt;/p&gt;

&lt;p&gt;They teach it how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow instructions better&lt;/li&gt;
&lt;li&gt;Write more naturally&lt;/li&gt;
&lt;li&gt;Solve problems&lt;/li&gt;
&lt;li&gt;Write code&lt;/li&gt;
&lt;li&gt;Stay safe and helpful&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's why some AI models give short answers, while others give detailed explanations.&lt;/p&gt;




&lt;h3&gt;
  
  
  🌐 4. Different Features
&lt;/h3&gt;

&lt;p&gt;Some AI models can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search the internet&lt;/li&gt;
&lt;li&gt;Read PDFs&lt;/li&gt;
&lt;li&gt;Understand images&lt;/li&gt;
&lt;li&gt;Generate images&lt;/li&gt;
&lt;li&gt;Write code&lt;/li&gt;
&lt;li&gt;Analyze files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Others may not support all of these features.&lt;/p&gt;

&lt;p&gt;This also affects the quality and style of their answers.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Which AI Is the Best?
&lt;/h2&gt;

&lt;p&gt;There is &lt;strong&gt;no single "best" AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Every AI has its own strengths.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🤖 ChatGPT is excellent for coding, learning, and detailed explanations.&lt;/li&gt;
&lt;li&gt;💎 Gemini works well with Google's ecosystem and multimodal tasks.&lt;/li&gt;
&lt;li&gt;🧠 Claude is known for long documents and thoughtful writing.&lt;/li&gt;
&lt;li&gt;💻 GitHub Copilot is specialized for programming.&lt;/li&gt;
&lt;li&gt;🇮🇳 Sarvam AI focuses on Indian languages and local AI applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best AI depends on &lt;strong&gt;what you want to do&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Your Challenge
&lt;/h2&gt;

&lt;p&gt;Try all three prompts using &lt;strong&gt;three different AI models&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Then compare:&lt;/p&gt;

&lt;p&gt;✅ Which AI explained the topic better?&lt;/p&gt;

&lt;p&gt;✅ Which AI wrote the best code?&lt;/p&gt;

&lt;p&gt;✅ Which AI was the most creative?&lt;/p&gt;

&lt;p&gt;✅ Which answer did you understand the most?&lt;/p&gt;

&lt;p&gt;There is no right or wrong answer.&lt;/p&gt;

&lt;p&gt;The goal is to understand that &lt;strong&gt;every AI model has its own strengths and limitations&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The more AI tools you explore, the better you'll understand &lt;strong&gt;how Generative AI really works&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Don't rely on just one AI model. Try different models, compare their responses, and choose the one that best fits your task. That's what experienced AI users do!&lt;/strong&gt; 🚀&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>System Design Expert</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Thu, 09 Jul 2026 04:42:41 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/system-design-expert-gcb</link>
      <guid>https://dev.to/abhishek-nexgen-dev/system-design-expert-gcb</guid>
      <description>&lt;p&gt;If your goal is to become a &lt;strong&gt;Senior Software Engineer&lt;/strong&gt;, &lt;strong&gt;System Design Expert&lt;/strong&gt;, or crack interviews at &lt;strong&gt;Google, Amazon, Microsoft, Meta, Uber, Netflix&lt;/strong&gt;, then you should follow a structured roadmap.&lt;/p&gt;

&lt;p&gt;The biggest mistake people make is directly jumping to "Design YouTube" or "Design WhatsApp."&lt;/p&gt;

&lt;p&gt;Instead, System Design should be learned exactly like mathematics:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn Numbers → Addition → Multiplication → Algebra → Calculus&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Similarly,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn Basics → Components → LLD → HLD → Distributed Systems → Real World Projects&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🚀 Complete System Design Roadmap (0 → Monster)
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    SYSTEM DESIGN
                           │
        ┌──────────────────┴──────────────────┐
        │                                     │
      LLD                                 HLD
        │                                     │
        └──────────────┬──────────────────────┘
                       │
              Distributed Systems
                       │
              Real World Architectures
                       │
               Top Company Interviews
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  📚 PHASE 0 — Prerequisites
&lt;/h1&gt;

&lt;p&gt;Before learning System Design, you should know:&lt;/p&gt;

&lt;h2&gt;
  
  
  Programming
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Loops&lt;/li&gt;
&lt;li&gt;OOP&lt;/li&gt;
&lt;li&gt;Exception Handling&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Data Structures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Array&lt;/li&gt;
&lt;li&gt;Linked List&lt;/li&gt;
&lt;li&gt;Stack&lt;/li&gt;
&lt;li&gt;Queue&lt;/li&gt;
&lt;li&gt;Tree&lt;/li&gt;
&lt;li&gt;Graph&lt;/li&gt;
&lt;li&gt;Heap&lt;/li&gt;
&lt;li&gt;HashMap&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Algorithms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Searching&lt;/li&gt;
&lt;li&gt;BFS&lt;/li&gt;
&lt;li&gt;DFS&lt;/li&gt;
&lt;li&gt;Dynamic Programming (Basic)&lt;/li&gt;
&lt;li&gt;Greedy&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Database Basics
&lt;/h2&gt;

&lt;p&gt;Learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL&lt;/li&gt;
&lt;li&gt;NoSQL&lt;/li&gt;
&lt;li&gt;Primary Key&lt;/li&gt;
&lt;li&gt;Foreign Key&lt;/li&gt;
&lt;li&gt;Index&lt;/li&gt;
&lt;li&gt;Joins&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Networking Basics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTTP&lt;/li&gt;
&lt;li&gt;HTTPS&lt;/li&gt;
&lt;li&gt;REST API&lt;/li&gt;
&lt;li&gt;TCP&lt;/li&gt;
&lt;li&gt;UDP&lt;/li&gt;
&lt;li&gt;IP Address&lt;/li&gt;
&lt;li&gt;Port&lt;/li&gt;
&lt;li&gt;DNS&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  📖 PHASE 1 — System Design Fundamentals
&lt;/h1&gt;

&lt;p&gt;This is the foundation.&lt;/p&gt;

&lt;p&gt;Without this, nothing will make sense.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 1
&lt;/h2&gt;

&lt;p&gt;Introduction to System Design&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is System Design&lt;/li&gt;
&lt;li&gt;Why learn System Design&lt;/li&gt;
&lt;li&gt;DSA vs System Design&lt;/li&gt;
&lt;li&gt;Client Server Architecture&lt;/li&gt;
&lt;li&gt;Real World Examples&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Chapter 2
&lt;/h2&gt;

&lt;p&gt;How Internet Works&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   │
DNS
   │
Load Balancer
   │
Server
   │
Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser&lt;/li&gt;
&lt;li&gt;Client&lt;/li&gt;
&lt;li&gt;DNS&lt;/li&gt;
&lt;li&gt;IP Address&lt;/li&gt;
&lt;li&gt;Server&lt;/li&gt;
&lt;li&gt;Database&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Chapter 3
&lt;/h2&gt;

&lt;p&gt;Scalability&lt;/p&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vertical Scaling&lt;/li&gt;
&lt;li&gt;Horizontal Scaling&lt;/li&gt;
&lt;li&gt;Peak Hours&lt;/li&gt;
&lt;li&gt;Traffic&lt;/li&gt;
&lt;li&gt;Resources&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Chapter 4
&lt;/h2&gt;

&lt;p&gt;Availability&lt;/p&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downtime&lt;/li&gt;
&lt;li&gt;High Availability&lt;/li&gt;
&lt;li&gt;Redundancy&lt;/li&gt;
&lt;li&gt;Failover&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Chapter 5
&lt;/h2&gt;

&lt;p&gt;Single Point of Failure&lt;/p&gt;

&lt;p&gt;Restaurant Example&lt;/p&gt;

&lt;p&gt;One Chef ❌&lt;/p&gt;

&lt;p&gt;One Server ❌&lt;/p&gt;

&lt;p&gt;One Database ❌&lt;/p&gt;

&lt;p&gt;Solutions&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backup&lt;/li&gt;
&lt;li&gt;Replication&lt;/li&gt;
&lt;li&gt;Multiple Servers&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  📖 PHASE 2 — Core Components
&lt;/h1&gt;

&lt;p&gt;Now start learning the building blocks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Load Balancer
&lt;/h2&gt;

&lt;p&gt;Learn&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Round Robin&lt;/li&gt;
&lt;li&gt;Least Connection&lt;/li&gt;
&lt;li&gt;Health Check&lt;/li&gt;
&lt;li&gt;Reverse Proxy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Diagram&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Users
   │
Load Balancer
   │
──────────────
│     │      │
S1    S2     S3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Database
&lt;/h2&gt;

&lt;p&gt;Learn&lt;/p&gt;

&lt;h3&gt;
  
  
  SQL
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  NoSQL
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;Cassandra&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Index&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;Sharding&lt;/li&gt;
&lt;li&gt;Replication&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Cache
&lt;/h2&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Memcached&lt;/li&gt;
&lt;li&gt;Cache Aside&lt;/li&gt;
&lt;li&gt;Write Through&lt;/li&gt;
&lt;li&gt;Write Back&lt;/li&gt;
&lt;li&gt;TTL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Diagram&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User

↓

Server

↓

Redis

↓

Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Queue
&lt;/h2&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RabbitMQ&lt;/li&gt;
&lt;li&gt;Kafka&lt;/li&gt;
&lt;li&gt;SQS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Learn&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Producer&lt;/li&gt;
&lt;li&gt;Consumer&lt;/li&gt;
&lt;li&gt;Dead Letter Queue&lt;/li&gt;
&lt;li&gt;Retry&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  CDN
&lt;/h2&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static Assets&lt;/li&gt;
&lt;li&gt;Edge Server&lt;/li&gt;
&lt;li&gt;Global Delivery&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Storage
&lt;/h2&gt;

&lt;p&gt;Learn&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object Storage&lt;/li&gt;
&lt;li&gt;File Storage&lt;/li&gt;
&lt;li&gt;Blob Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;Amazon S3&lt;/p&gt;




&lt;h2&gt;
  
  
  Search Engine
&lt;/h2&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Elasticsearch&lt;/li&gt;
&lt;li&gt;OpenSearch&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  API Gateway
&lt;/h2&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Rate Limiting&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  📖 PHASE 3 — Database Design
&lt;/h1&gt;

&lt;p&gt;Topics&lt;/p&gt;

&lt;p&gt;ER Diagram&lt;/p&gt;

&lt;p&gt;Normalization&lt;/p&gt;

&lt;p&gt;Denormalization&lt;/p&gt;

&lt;p&gt;Indexes&lt;/p&gt;

&lt;p&gt;Partitioning&lt;/p&gt;

&lt;p&gt;Replication&lt;/p&gt;

&lt;p&gt;CAP Theorem&lt;/p&gt;

&lt;p&gt;ACID&lt;/p&gt;

&lt;p&gt;BASE&lt;/p&gt;

&lt;p&gt;Consistency&lt;/p&gt;

&lt;p&gt;Availability&lt;/p&gt;

&lt;p&gt;Partition Tolerance&lt;/p&gt;




&lt;h1&gt;
  
  
  📖 PHASE 4 — Low Level Design (LLD)
&lt;/h1&gt;

&lt;p&gt;Now start object-oriented design.&lt;/p&gt;




&lt;h2&gt;
  
  
  OOP Revision
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Class&lt;/li&gt;
&lt;li&gt;Object&lt;/li&gt;
&lt;li&gt;Encapsulation&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Abstraction&lt;/li&gt;
&lt;li&gt;Polymorphism&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  SOLID Principles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;S&lt;/li&gt;
&lt;li&gt;O&lt;/li&gt;
&lt;li&gt;L&lt;/li&gt;
&lt;li&gt;I&lt;/li&gt;
&lt;li&gt;D&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Design Principles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;DRY&lt;/li&gt;
&lt;li&gt;KISS&lt;/li&gt;
&lt;li&gt;YAGNI&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  UML Diagrams
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Class Diagram&lt;/li&gt;
&lt;li&gt;Sequence Diagram&lt;/li&gt;
&lt;li&gt;Activity Diagram&lt;/li&gt;
&lt;li&gt;State Diagram&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Design Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Creational
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Singleton&lt;/li&gt;
&lt;li&gt;Factory&lt;/li&gt;
&lt;li&gt;Builder&lt;/li&gt;
&lt;li&gt;Prototype&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Structural
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Adapter&lt;/li&gt;
&lt;li&gt;Facade&lt;/li&gt;
&lt;li&gt;Decorator&lt;/li&gt;
&lt;li&gt;Composite&lt;/li&gt;
&lt;li&gt;Proxy&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Behavioral
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Strategy&lt;/li&gt;
&lt;li&gt;Observer&lt;/li&gt;
&lt;li&gt;Command&lt;/li&gt;
&lt;li&gt;State&lt;/li&gt;
&lt;li&gt;Iterator&lt;/li&gt;
&lt;li&gt;Chain of Responsibility&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  LLD Problems
&lt;/h2&gt;

&lt;p&gt;Design&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parking Lot&lt;/li&gt;
&lt;li&gt;ATM&lt;/li&gt;
&lt;li&gt;Library&lt;/li&gt;
&lt;li&gt;Hotel&lt;/li&gt;
&lt;li&gt;Cab Booking&lt;/li&gt;
&lt;li&gt;Elevator&lt;/li&gt;
&lt;li&gt;Snake Game&lt;/li&gt;
&lt;li&gt;Chess&lt;/li&gt;
&lt;li&gt;Cricbuzz&lt;/li&gt;
&lt;li&gt;Splitwise&lt;/li&gt;
&lt;li&gt;Vending Machine&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  📖 PHASE 5 — High Level Design (HLD)
&lt;/h1&gt;

&lt;p&gt;Now architecture.&lt;/p&gt;

&lt;p&gt;Topics&lt;/p&gt;




&lt;p&gt;Scalability&lt;/p&gt;

&lt;p&gt;Availability&lt;/p&gt;

&lt;p&gt;Reliability&lt;/p&gt;

&lt;p&gt;Maintainability&lt;/p&gt;

&lt;p&gt;Fault Tolerance&lt;/p&gt;

&lt;p&gt;Performance&lt;/p&gt;

&lt;p&gt;Latency&lt;/p&gt;

&lt;p&gt;Throughput&lt;/p&gt;

&lt;p&gt;Consistency&lt;/p&gt;

&lt;p&gt;Durability&lt;/p&gt;




&lt;p&gt;Architecture&lt;/p&gt;

&lt;p&gt;Monolith&lt;/p&gt;

&lt;p&gt;Microservices&lt;/p&gt;

&lt;p&gt;Serverless&lt;/p&gt;

&lt;p&gt;Event Driven&lt;/p&gt;

&lt;p&gt;Layered Architecture&lt;/p&gt;

&lt;p&gt;Hexagonal Architecture&lt;/p&gt;

&lt;p&gt;Clean Architecture&lt;/p&gt;




&lt;p&gt;Communication&lt;/p&gt;

&lt;p&gt;REST&lt;/p&gt;

&lt;p&gt;GraphQL&lt;/p&gt;

&lt;p&gt;gRPC&lt;/p&gt;

&lt;p&gt;WebSocket&lt;/p&gt;

&lt;p&gt;Message Queue&lt;/p&gt;




&lt;p&gt;Deployment&lt;/p&gt;

&lt;p&gt;Docker&lt;/p&gt;

&lt;p&gt;Kubernetes&lt;/p&gt;

&lt;p&gt;Nginx&lt;/p&gt;

&lt;p&gt;CI/CD&lt;/p&gt;

&lt;p&gt;Blue Green Deployment&lt;/p&gt;

&lt;p&gt;Canary Deployment&lt;/p&gt;

&lt;p&gt;Rolling Update&lt;/p&gt;




&lt;p&gt;Observability&lt;/p&gt;

&lt;p&gt;Logging&lt;/p&gt;

&lt;p&gt;Monitoring&lt;/p&gt;

&lt;p&gt;Tracing&lt;/p&gt;

&lt;p&gt;Metrics&lt;/p&gt;

&lt;p&gt;Alerting&lt;/p&gt;




&lt;p&gt;Security&lt;/p&gt;

&lt;p&gt;JWT&lt;/p&gt;

&lt;p&gt;OAuth&lt;/p&gt;

&lt;p&gt;Rate Limiting&lt;/p&gt;

&lt;p&gt;API Gateway&lt;/p&gt;

&lt;p&gt;Encryption&lt;/p&gt;

&lt;p&gt;HTTPS&lt;/p&gt;

&lt;p&gt;CORS&lt;/p&gt;

&lt;p&gt;CSRF&lt;/p&gt;

&lt;p&gt;XSS&lt;/p&gt;

&lt;p&gt;SQL Injection&lt;/p&gt;




&lt;h1&gt;
  
  
  📖 PHASE 6 — Distributed Systems
&lt;/h1&gt;

&lt;p&gt;This is where most interviews happen.&lt;/p&gt;

&lt;p&gt;Topics&lt;/p&gt;




&lt;p&gt;Replication&lt;/p&gt;

&lt;p&gt;Master Slave&lt;/p&gt;

&lt;p&gt;Leader Follower&lt;/p&gt;

&lt;p&gt;Leader Election&lt;/p&gt;

&lt;p&gt;Consensus&lt;/p&gt;

&lt;p&gt;Paxos&lt;/p&gt;

&lt;p&gt;Raft&lt;/p&gt;

&lt;p&gt;ZooKeeper&lt;/p&gt;




&lt;p&gt;Sharding&lt;/p&gt;

&lt;p&gt;Horizontal Partitioning&lt;/p&gt;

&lt;p&gt;Vertical Partitioning&lt;/p&gt;

&lt;p&gt;Hash Based Sharding&lt;/p&gt;

&lt;p&gt;Range Based Sharding&lt;/p&gt;




&lt;p&gt;CAP Theorem&lt;/p&gt;

&lt;p&gt;Consistency&lt;/p&gt;

&lt;p&gt;Availability&lt;/p&gt;

&lt;p&gt;Partition Tolerance&lt;/p&gt;




&lt;p&gt;Distributed Cache&lt;/p&gt;

&lt;p&gt;Redis Cluster&lt;/p&gt;




&lt;p&gt;Distributed Lock&lt;/p&gt;

&lt;p&gt;Redis Lock&lt;/p&gt;

&lt;p&gt;ZooKeeper Lock&lt;/p&gt;




&lt;p&gt;Event Driven Architecture&lt;/p&gt;

&lt;p&gt;Producer&lt;/p&gt;

&lt;p&gt;Consumer&lt;/p&gt;

&lt;p&gt;Queue&lt;/p&gt;

&lt;p&gt;Retry&lt;/p&gt;

&lt;p&gt;DLQ&lt;/p&gt;




&lt;p&gt;Streaming&lt;/p&gt;

&lt;p&gt;Kafka&lt;/p&gt;

&lt;p&gt;Pulsar&lt;/p&gt;

&lt;p&gt;Event Streaming&lt;/p&gt;




&lt;h1&gt;
  
  
  📖 PHASE 7 — Cloud
&lt;/h1&gt;

&lt;p&gt;AWS&lt;/p&gt;

&lt;p&gt;Azure&lt;/p&gt;

&lt;p&gt;Google Cloud&lt;/p&gt;




&lt;p&gt;Learn&lt;/p&gt;

&lt;p&gt;EC2&lt;/p&gt;

&lt;p&gt;S3&lt;/p&gt;

&lt;p&gt;Lambda&lt;/p&gt;

&lt;p&gt;CloudFront&lt;/p&gt;

&lt;p&gt;RDS&lt;/p&gt;

&lt;p&gt;DynamoDB&lt;/p&gt;

&lt;p&gt;EKS&lt;/p&gt;

&lt;p&gt;ECS&lt;/p&gt;

&lt;p&gt;IAM&lt;/p&gt;

&lt;p&gt;VPC&lt;/p&gt;

&lt;p&gt;CloudWatch&lt;/p&gt;




&lt;h1&gt;
  
  
  📖 PHASE 8 — DevOps
&lt;/h1&gt;

&lt;p&gt;Git&lt;/p&gt;

&lt;p&gt;GitHub&lt;/p&gt;

&lt;p&gt;Docker&lt;/p&gt;

&lt;p&gt;Docker Compose&lt;/p&gt;

&lt;p&gt;Linux&lt;/p&gt;

&lt;p&gt;Nginx&lt;/p&gt;

&lt;p&gt;CI/CD&lt;/p&gt;

&lt;p&gt;GitHub Actions&lt;/p&gt;

&lt;p&gt;Terraform (Optional)&lt;/p&gt;




&lt;h1&gt;
  
  
  📖 PHASE 9 — Real World Architectures
&lt;/h1&gt;

&lt;p&gt;Design these systems.&lt;/p&gt;

&lt;p&gt;Easy&lt;/p&gt;

&lt;p&gt;✅ URL Shortener&lt;/p&gt;

&lt;p&gt;✅ Pastebin&lt;/p&gt;

&lt;p&gt;✅ TinyURL&lt;/p&gt;




&lt;p&gt;Medium&lt;/p&gt;

&lt;p&gt;✅ Chat Application&lt;/p&gt;

&lt;p&gt;✅ Food Delivery&lt;/p&gt;

&lt;p&gt;✅ Cab Booking&lt;/p&gt;

&lt;p&gt;✅ Hotel Booking&lt;/p&gt;

&lt;p&gt;✅ Instagram Feed&lt;/p&gt;

&lt;p&gt;✅ Notification Service&lt;/p&gt;




&lt;p&gt;Advanced&lt;/p&gt;

&lt;p&gt;✅ WhatsApp&lt;/p&gt;

&lt;p&gt;✅ YouTube&lt;/p&gt;

&lt;p&gt;✅ Netflix&lt;/p&gt;

&lt;p&gt;✅ Google Drive&lt;/p&gt;

&lt;p&gt;✅ Dropbox&lt;/p&gt;

&lt;p&gt;✅ Uber&lt;/p&gt;

&lt;p&gt;✅ Google Maps&lt;/p&gt;

&lt;p&gt;✅ Twitter/X&lt;/p&gt;

&lt;p&gt;✅ Facebook&lt;/p&gt;

&lt;p&gt;✅ Discord&lt;/p&gt;

&lt;p&gt;✅ Zoom&lt;/p&gt;




&lt;p&gt;Monster&lt;/p&gt;

&lt;p&gt;✅ Amazon&lt;/p&gt;

&lt;p&gt;✅ Google Search&lt;/p&gt;

&lt;p&gt;✅ Payment Gateway&lt;/p&gt;

&lt;p&gt;✅ Banking System&lt;/p&gt;

&lt;p&gt;✅ Kubernetes Control Plane&lt;/p&gt;




&lt;h1&gt;
  
  
  📖 PHASE 10 — Interview Preparation
&lt;/h1&gt;

&lt;p&gt;Top interview questions.&lt;/p&gt;

&lt;p&gt;Design&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TinyURL&lt;/li&gt;
&lt;li&gt;Instagram&lt;/li&gt;
&lt;li&gt;YouTube&lt;/li&gt;
&lt;li&gt;WhatsApp&lt;/li&gt;
&lt;li&gt;Uber&lt;/li&gt;
&lt;li&gt;BookMyShow&lt;/li&gt;
&lt;li&gt;Paytm&lt;/li&gt;
&lt;li&gt;Google Drive&lt;/li&gt;
&lt;li&gt;Dropbox&lt;/li&gt;
&lt;li&gt;Twitter&lt;/li&gt;
&lt;li&gt;Notification System&lt;/li&gt;
&lt;li&gt;Rate Limiter&lt;/li&gt;
&lt;li&gt;API Gateway&lt;/li&gt;
&lt;li&gt;Distributed Cache&lt;/li&gt;
&lt;li&gt;Messaging Queue&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  📖 PHASE 11 — Become a Monster
&lt;/h1&gt;

&lt;p&gt;Read production-level topics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event Sourcing&lt;/li&gt;
&lt;li&gt;CQRS&lt;/li&gt;
&lt;li&gt;Saga Pattern&lt;/li&gt;
&lt;li&gt;Outbox Pattern&lt;/li&gt;
&lt;li&gt;Idempotency&lt;/li&gt;
&lt;li&gt;Circuit Breaker&lt;/li&gt;
&lt;li&gt;Bulkhead Pattern&lt;/li&gt;
&lt;li&gt;Service Mesh&lt;/li&gt;
&lt;li&gt;Kubernetes&lt;/li&gt;
&lt;li&gt;Multi Region Deployment&lt;/li&gt;
&lt;li&gt;Disaster Recovery&lt;/li&gt;
&lt;li&gt;Zero Downtime Deployment&lt;/li&gt;
&lt;li&gt;Blue Green Deployment&lt;/li&gt;
&lt;li&gt;Canary Deployment&lt;/li&gt;
&lt;li&gt;Feature Flags&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🎯 Complete Learning Path (Visual Roadmap)
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                           SYSTEM DESIGN
                                  │
                     ┌────────────┴────────────┐
                     │                         │
              Fundamentals                 Networking
                     │                         │
                     └────────────┬────────────┘
                                  │
                          Core Components
                                  │
       ┌──────────────┬────────────┬─────────────┐
       │              │            │             │
   Database         Cache       Queue      Load Balancer
       │              │            │             │
       └──────────────┴────────────┴─────────────┘
                                  │
                           Database Design
                                  │
                           Low Level Design
                                  │
                          Design Patterns
                                  │
                          Object-Oriented Design
                                  │
                          High Level Design
                                  │
                        Distributed Systems
                                  │
                       Cloud + DevOps + Security
                                  │
                     Real World System Design
                                  │
                    FAANG Interview Preparation
                                  │
                           Senior Engineer
                                  │
                           Staff Engineer
                                  │
                        Software Architect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  📚 If You Want to Write the "World's Best System Design Notes"
&lt;/h1&gt;

&lt;p&gt;I recommend organizing the notes into &lt;strong&gt;30 sequential chapters&lt;/strong&gt;, moving from beginner to advanced:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Chapter&lt;/th&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Introduction to System Design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;How the Internet Works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Networking Fundamentals&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Scalability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Load Balancers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Databases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Database Indexing &amp;amp; Query Optimization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Caching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;Message Queues&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Distributed Systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;CAP Theorem &amp;amp; Consistency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;Storage Systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;API Design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;Authentication &amp;amp; Authorization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;Low-Level Design (LLD)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;SOLID Principles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;Design Patterns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;UML &amp;amp; Object Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;High-Level Design (HLD)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;Microservices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;Event-Driven Architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;Logging, Monitoring &amp;amp; Observability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;Docker &amp;amp; Kubernetes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;Cloud Architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;Security in Distributed Systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;Reliability &amp;amp; Fault Tolerance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;Performance Optimization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;Real-World Case Studies (Netflix, WhatsApp, YouTube, Uber, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;Top Product-Based Company Interview Questions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;Complete System Design Interview Playbook &amp;amp; Revision Notes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This progression mirrors how experienced engineers learn: &lt;strong&gt;fundamentals first, then components, then design principles, followed by architecture, distributed systems, cloud, and finally real-world interview problems&lt;/strong&gt;. It builds a strong foundation instead of memorizing solutions.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🚀 Streaming AI Responses with Groq SDK in Node.js (Llama 3.3 70B)</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Thu, 02 Jul 2026 04:43:39 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/streaming-ai-responses-with-groq-sdk-in-nodejs-llama-33-70b-4h04</link>
      <guid>https://dev.to/abhishek-nexgen-dev/streaming-ai-responses-with-groq-sdk-in-nodejs-llama-33-70b-4h04</guid>
      <description>&lt;p&gt;Artificial Intelligence feels much more natural when responses appear &lt;strong&gt;word by word&lt;/strong&gt; instead of waiting for the complete answer.&lt;/p&gt;

&lt;p&gt;Groq provides one of the fastest inference APIs available today, making streaming responses incredibly smooth.&lt;/p&gt;

&lt;p&gt;In this article, we'll build a simple streaming chatbot using the &lt;strong&gt;Groq SDK&lt;/strong&gt; and the &lt;strong&gt;Llama 3.3 70B Versatile&lt;/strong&gt; model.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Installation
&lt;/h2&gt;

&lt;p&gt;Install the official SDK.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;groq-sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔑 Configure API Key
&lt;/h2&gt;

&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GROQ_API_KEY=your_api_key_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install dotenv if you haven't already.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📝 Complete Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Groq&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;groq-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv/config&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;groq&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Groq&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GROQ_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chatCompletion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;groq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;llama-3.3-70b-versatile&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Explain Artificial Intelligence in simple words.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;max_completion_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;top_p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;chatCompletion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  📖 Understanding the Code
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Import the SDK
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Groq&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;groq-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This imports the official Groq client.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Create the Client
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;groq&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Groq&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GROQ_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK authenticates using your API key.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Send a Chat Request
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chatCompletion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;groq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;llama-3.3-70b-versatile&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Explain Artificial Intelligence in simple words.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we specify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model&lt;/li&gt;
&lt;li&gt;User message&lt;/li&gt;
&lt;li&gt;Streaming enabled&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Read the Stream
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;chatCompletion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of waiting for the whole response, each token is printed immediately.&lt;/p&gt;

&lt;p&gt;Output looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Artificial Intelligence (AI) is...
...technology that allows...
...computers to learn...
...and solve problems...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a ChatGPT-like typing effect.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚙️ Parameters Explained
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;AI model to use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;messages&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Conversation history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;temperature&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Controls creativity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;top_p&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Controls token sampling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;max_completion_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Maximum output length&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stream&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Enables real-time streaming&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  💡 Why Use Streaming?
&lt;/h1&gt;

&lt;p&gt;Streaming provides several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚡ Faster perceived response time&lt;/li&gt;
&lt;li&gt;😊 Better user experience&lt;/li&gt;
&lt;li&gt;💬 ChatGPT-like interface&lt;/li&gt;
&lt;li&gt;📉 Reduced waiting time&lt;/li&gt;
&lt;li&gt;🔄 Real-time updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For chat applications, streaming is almost always the preferred approach.&lt;/p&gt;




&lt;h1&gt;
  
  
  🏗️ Perfect For
&lt;/h1&gt;

&lt;p&gt;This pattern works great for building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI Chatbots&lt;/li&gt;
&lt;li&gt;Customer Support Assistants&lt;/li&gt;
&lt;li&gt;Coding Assistants&lt;/li&gt;
&lt;li&gt;AI Terminal Applications&lt;/li&gt;
&lt;li&gt;Documentation Assistants&lt;/li&gt;
&lt;li&gt;AI Agents&lt;/li&gt;
&lt;li&gt;Personal Assistants&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🚀 Example Output
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User:
What is Machine Learning?

AI:
Machine Learning is a branch of Artificial Intelligence that enables computers to learn patterns from data without being explicitly programmed...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The text appears progressively as the model generates it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🚀 Sarvam AI Complete Guide for Beginners (JavaScript + Python)</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Thu, 02 Jul 2026 04:12:54 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/sarvam-ai-complete-guide-for-beginners-javascript-python-kkk</link>
      <guid>https://dev.to/abhishek-nexgen-dev/sarvam-ai-complete-guide-for-beginners-javascript-python-kkk</guid>
      <description>&lt;h2&gt;
  
  
  What is Sarvam AI?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sarvam AI&lt;/strong&gt; is an Indian Generative AI platform that provides Large Language Models (LLMs), speech AI, translation, voice agents, and AI APIs for developers.&lt;/p&gt;

&lt;p&gt;Think of Sarvam AI as India's version of services like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI&lt;/li&gt;
&lt;li&gt;Anthropic&lt;/li&gt;
&lt;li&gt;Google Gemini&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using Sarvam APIs, developers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build AI chatbots&lt;/li&gt;
&lt;li&gt;Generate text&lt;/li&gt;
&lt;li&gt;Summarize documents&lt;/li&gt;
&lt;li&gt;Translate Indian languages&lt;/li&gt;
&lt;li&gt;Create voice assistants&lt;/li&gt;
&lt;li&gt;Build customer support systems&lt;/li&gt;
&lt;li&gt;Integrate AI into websites and mobile apps&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Why Use Sarvam AI?
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Benefits
&lt;/h3&gt;

&lt;p&gt;✅ Indian Language Support&lt;/p&gt;

&lt;p&gt;✅ Simple API Integration&lt;/p&gt;

&lt;p&gt;✅ Fast Response&lt;/p&gt;

&lt;p&gt;✅ Production Ready&lt;/p&gt;

&lt;p&gt;✅ Multiple AI Models&lt;/p&gt;

&lt;p&gt;✅ Voice and Speech Capabilities&lt;/p&gt;

&lt;p&gt;✅ Developer Friendly SDKs&lt;/p&gt;




&lt;h1&gt;
  
  
  Architecture Overview
&lt;/h1&gt;

&lt;p&gt;User → Your Application → Sarvam API → AI Model → Response&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;User asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Explain Artificial Intelligence"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your backend sends request to Sarvam.&lt;/p&gt;

&lt;p&gt;Sarvam processes the request using an LLM.&lt;/p&gt;

&lt;p&gt;The AI generates an answer.&lt;/p&gt;

&lt;p&gt;The answer is returned to your application.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1: Create a Sarvam Account
&lt;/h1&gt;

&lt;p&gt;Visit:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sarvam.ai?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Sarvam AI Platform&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create an account using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Login&lt;/li&gt;
&lt;li&gt;Email Login&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After verification, access the developer dashboard.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2: Generate an API Key
&lt;/h1&gt;

&lt;p&gt;After login:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Dashboard&lt;/li&gt;
&lt;li&gt;Go to API Keys&lt;/li&gt;
&lt;li&gt;Click Create API Key&lt;/li&gt;
&lt;li&gt;Copy the generated key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sk_xxxxxxxxxxxxxxxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Never expose your API key publicly.&lt;/p&gt;

&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sk_xxxxxxxxx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SARVAM_API_KEY=sk_xxxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 3: Install SDK
&lt;/h1&gt;

&lt;h2&gt;
  
  
  JavaScript / Node.js
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;sarvamai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add sarvamai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Python
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;sarvamai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Understanding Chat Completions
&lt;/h1&gt;

&lt;p&gt;A Chat Completion API allows you to send messages to an AI model and receive a response.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User:
What is Machine Learning?

AI:
Machine Learning is a branch of AI...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  JavaScript Example
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Basic Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;SarvamAIClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvamai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SarvamAIClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiSubscriptionKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SARVAM_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Complete Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;SarvamAIClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvamai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SarvamAIClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiSubscriptionKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SARVAM_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvam-30b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Explain the significance of the Indian monsoon season.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="na"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;top_p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Understanding Every Parameter
&lt;/h1&gt;

&lt;h2&gt;
  
  
  model
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvam-30b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specifies which AI model to use.&lt;/p&gt;

&lt;p&gt;Think of it as selecting the AI brain.&lt;/p&gt;




&lt;h2&gt;
  
  
  messages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conversation history sent to the AI.&lt;/p&gt;




&lt;h2&gt;
  
  
  role
&lt;/h2&gt;

&lt;p&gt;Three common roles:&lt;/p&gt;

&lt;h3&gt;
  
  
  user
&lt;/h3&gt;

&lt;p&gt;Question from user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;What is AI?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  assistant
&lt;/h3&gt;

&lt;p&gt;Previous AI response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AI stands for Artificial Intelligence.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  system
&lt;/h3&gt;

&lt;p&gt;Instructions for AI behavior.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;system&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;You are a helpful teacher.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  temperature
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Controls creativity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Low Temperature
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More factual and predictable.&lt;/p&gt;




&lt;h3&gt;
  
  
  Medium Temperature
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Balanced output.&lt;/p&gt;




&lt;h3&gt;
  
  
  High Temperature
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More creative responses.&lt;/p&gt;




&lt;h2&gt;
  
  
  top_p
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;top_p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Controls how many probable words can be selected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Predictions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Coffee = 40%
Tea = 30%
Milk = 20%
Water = 10%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;top_p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI may only consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Coffee
Tea
Milk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  max_tokens
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Maximum response length.&lt;/p&gt;

&lt;p&gt;Higher value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Longer answers&lt;/li&gt;
&lt;li&gt;Higher cost&lt;/li&gt;
&lt;li&gt;More tokens consumed&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Multi-Turn Conversation
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvam-30b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;system&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;You are a helpful coding mentor.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;What is JavaScript?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JavaScript is a programming language.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Give me an example.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AI remembers previous messages in the conversation.&lt;/p&gt;




&lt;h1&gt;
  
  
  Python Example
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Basic Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sarvamai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SarvamAIClient&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SarvamAIClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_subscription_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SARVAM_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Complete Python Example
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sarvamai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SarvamAIClient&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SarvamAIClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_subscription_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SARVAM_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sarvam-30b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Explain Artificial Intelligence&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;top_p&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Express.js API Example
&lt;/h1&gt;

&lt;p&gt;Create your own AI endpoint.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;SarvamAIClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvamai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SarvamAIClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiSubscriptionKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SARVAM_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/chat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvam-30b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Error Handling
&lt;/h1&gt;

&lt;p&gt;Always use try-catch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sarvam-30b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common errors:&lt;/p&gt;

&lt;h3&gt;
  
  
  Invalid API Key
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;401 Unauthorized
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rate Limit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;429 Too Many Requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Server Error
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;500 Internal Server Error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Best Practices
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Use Environment Variables
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SARVAM_API_KEY=your_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Validate Input
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Message required&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Limit Token Usage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prevents unnecessary cost.&lt;/p&gt;




&lt;h3&gt;
  
  
  Add Logging
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Request received&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for debugging.&lt;/p&gt;




&lt;h1&gt;
  
  
  Real-World Use Cases
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Customer Support Bot
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User → Question
AI → Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Internal Company Assistant
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employees → Ask Questions
AI → Company Knowledge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  FAQ Generator
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Document → AI
AI → FAQ List
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Content Generation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Topic → AI
AI → Blog Post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Education Platform
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Student Question → AI
AI → Explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How YouTube Recommends Videos: Learn Machine Learning Without Writing Code</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Thu, 25 Jun 2026 07:59:59 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/how-youtube-recommends-videos-learn-machine-learning-without-writing-code-127</link>
      <guid>https://dev.to/abhishek-nexgen-dev/how-youtube-recommends-videos-learn-machine-learning-without-writing-code-127</guid>
      <description>&lt;h2&gt;
  
  
  🎯 Goal
&lt;/h2&gt;

&lt;p&gt;After this activity, you should understand:&lt;/p&gt;

&lt;p&gt;✅ What is Data&lt;/p&gt;

&lt;p&gt;✅ What is a Dataset&lt;/p&gt;

&lt;p&gt;✅ What is Training Data&lt;/p&gt;

&lt;p&gt;✅ What is a Feature&lt;/p&gt;

&lt;p&gt;✅ What is Training&lt;/p&gt;

&lt;p&gt;✅ What is Prediction&lt;/p&gt;

&lt;p&gt;✅ Why ML needs lots of examples&lt;/p&gt;

&lt;p&gt;✅ How YouTube recommends videos&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqg36t3xzgvt8gw63du97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqg36t3xzgvt8gw63du97.png" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1 — Ask a Simple Question
&lt;/h1&gt;

&lt;p&gt;Imagine you open YouTube.&lt;/p&gt;

&lt;p&gt;You watch:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python Tutorial&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A few seconds later, YouTube suggests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React Tutorial&lt;/li&gt;
&lt;li&gt;JavaScript Course&lt;/li&gt;
&lt;li&gt;Node.js Crash Course&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How did YouTube know that you might like React?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Did an Engineer Write This?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Abhishek&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;recommend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;React Tutorial&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;That would never work.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because YouTube has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Billions of users&lt;/li&gt;
&lt;li&gt;Millions of videos&lt;/li&gt;
&lt;li&gt;Billions of views every day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No engineer can write rules for every person.&lt;/p&gt;

&lt;p&gt;Machine Learning solves this problem.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2 — What Does YouTube Collect?
&lt;/h1&gt;

&lt;p&gt;Machine Learning needs examples.&lt;/p&gt;

&lt;p&gt;These examples come from data.&lt;/p&gt;

&lt;p&gt;YouTube collects things like:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Information&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Video watched&lt;/td&gt;
&lt;td&gt;Python Basics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Watch time&lt;/td&gt;
&lt;td&gt;15 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Like&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Comment&lt;/td&gt;
&lt;td&gt;Nice video&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Search&lt;/td&gt;
&lt;td&gt;React Tutorial&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Device&lt;/td&gt;
&lt;td&gt;Mobile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Country&lt;/td&gt;
&lt;td&gt;India&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subscribed&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Think Like a Teacher
&lt;/h2&gt;

&lt;p&gt;A teacher teaches students using examples.&lt;/p&gt;

&lt;p&gt;Machine Learning also learns from examples.&lt;/p&gt;

&lt;p&gt;The only difference is:&lt;/p&gt;

&lt;p&gt;Teacher → Students&lt;/p&gt;

&lt;p&gt;Data → Machine&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3 — Give Data to the Machine
&lt;/h1&gt;

&lt;p&gt;This is called &lt;strong&gt;Training Data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We are teaching YouTube.&lt;/p&gt;

&lt;p&gt;Dataset:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User&lt;/th&gt;
&lt;th&gt;Watched Video&lt;/th&gt;
&lt;th&gt;Next Video&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;User1&lt;/td&gt;
&lt;td&gt;Python Basics&lt;/td&gt;
&lt;td&gt;React Tutorial&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User2&lt;/td&gt;
&lt;td&gt;Python Basics&lt;/td&gt;
&lt;td&gt;React Tutorial&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User3&lt;/td&gt;
&lt;td&gt;Python Basics&lt;/td&gt;
&lt;td&gt;Node.js&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User4&lt;/td&gt;
&lt;td&gt;Python Basics&lt;/td&gt;
&lt;td&gt;React Tutorial&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User5&lt;/td&gt;
&lt;td&gt;Cricket Match&lt;/td&gt;
&lt;td&gt;Highlights&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User6&lt;/td&gt;
&lt;td&gt;AI News&lt;/td&gt;
&lt;td&gt;ChatGPT Tutorial&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User7&lt;/td&gt;
&lt;td&gt;AI News&lt;/td&gt;
&lt;td&gt;Prompt Engineering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User8&lt;/td&gt;
&lt;td&gt;Cooking Pasta&lt;/td&gt;
&lt;td&gt;Cake Recipe&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Important Idea
&lt;/h2&gt;

&lt;p&gt;This table is called a &lt;strong&gt;Dataset&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Machine Learning studies this dataset.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4 — Become the Machine
&lt;/h1&gt;

&lt;p&gt;Forget computers.&lt;/p&gt;

&lt;p&gt;You are now the ML model.&lt;/p&gt;

&lt;p&gt;Look only at Python.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;Python → React&lt;/p&gt;

&lt;p&gt;Python → React&lt;/p&gt;

&lt;p&gt;Python → Node.js&lt;/p&gt;

&lt;p&gt;Python → React&lt;/p&gt;

&lt;p&gt;Count them.&lt;/p&gt;

&lt;p&gt;React = 3 times&lt;/p&gt;

&lt;p&gt;Node.js = 1 time&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 5 — Learn the Pattern
&lt;/h1&gt;

&lt;p&gt;Machine says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I noticed something.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;People who watch Python usually watch React.&lt;/p&gt;

&lt;p&gt;Pattern learned:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Python
   ↓
React
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 6 — Training
&lt;/h1&gt;

&lt;p&gt;Training simply means:&lt;/p&gt;

&lt;p&gt;Study examples.&lt;/p&gt;

&lt;p&gt;Again.&lt;/p&gt;

&lt;p&gt;Again.&lt;/p&gt;

&lt;p&gt;Again.&lt;/p&gt;

&lt;p&gt;Until patterns become clear.&lt;/p&gt;

&lt;p&gt;Machine Learning Training = Studying examples.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 7 — Prediction
&lt;/h1&gt;

&lt;p&gt;A new user comes.&lt;/p&gt;

&lt;p&gt;Watched:&lt;/p&gt;

&lt;p&gt;Python Basics&lt;/p&gt;

&lt;p&gt;Machine asks:&lt;/p&gt;

&lt;p&gt;What did similar people watch?&lt;/p&gt;

&lt;p&gt;Answer:&lt;/p&gt;

&lt;p&gt;React Tutorial&lt;/p&gt;

&lt;p&gt;Recommendation:&lt;/p&gt;

&lt;p&gt;🎯 React Tutorial&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 8 — Confidence
&lt;/h1&gt;

&lt;p&gt;Machine may think:&lt;/p&gt;

&lt;p&gt;React = 80%&lt;/p&gt;

&lt;p&gt;Node.js = 15%&lt;/p&gt;

&lt;p&gt;Angular = 5%&lt;/p&gt;

&lt;p&gt;Best choice?&lt;/p&gt;

&lt;p&gt;React.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 9 — More Data Makes Better ML
&lt;/h1&gt;

&lt;p&gt;Suppose we train with:&lt;/p&gt;

&lt;p&gt;10 users&lt;/p&gt;

&lt;p&gt;Model is okay.&lt;/p&gt;

&lt;p&gt;Train with:&lt;/p&gt;

&lt;p&gt;10 million users&lt;/p&gt;

&lt;p&gt;Model becomes much smarter.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 10 — Real YouTube
&lt;/h1&gt;

&lt;p&gt;Real YouTube studies:&lt;/p&gt;

&lt;p&gt;Billions of videos watched&lt;/p&gt;

&lt;p&gt;Likes&lt;/p&gt;

&lt;p&gt;Comments&lt;/p&gt;

&lt;p&gt;Searches&lt;/p&gt;

&lt;p&gt;Subscriptions&lt;/p&gt;

&lt;p&gt;Watch time&lt;/p&gt;

&lt;p&gt;Devices&lt;/p&gt;

&lt;p&gt;Countries&lt;/p&gt;

&lt;p&gt;Age groups&lt;/p&gt;

&lt;p&gt;Trending topics&lt;/p&gt;

&lt;p&gt;Then ML learns patterns automatically.&lt;/p&gt;




&lt;h1&gt;
  
  
  Student Activities
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Activity 1
&lt;/h2&gt;

&lt;p&gt;Open Excel.&lt;/p&gt;

&lt;p&gt;Create the dataset.&lt;/p&gt;

&lt;p&gt;Count recommendations.&lt;/p&gt;




&lt;h2&gt;
  
  
  Activity 2
&lt;/h2&gt;

&lt;p&gt;Add 20 more users.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Python → Vue&lt;/p&gt;

&lt;p&gt;Python → Angular&lt;/p&gt;

&lt;p&gt;Python → React&lt;/p&gt;

&lt;p&gt;See what changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Activity 3
&lt;/h2&gt;

&lt;p&gt;Predict recommendations.&lt;/p&gt;

&lt;p&gt;User watched:&lt;/p&gt;

&lt;p&gt;AI News&lt;/p&gt;

&lt;p&gt;Recommend what?&lt;/p&gt;




&lt;h2&gt;
  
  
  Activity 4
&lt;/h2&gt;

&lt;p&gt;Create your own recommendation system.&lt;/p&gt;

&lt;p&gt;Topics:&lt;/p&gt;

&lt;p&gt;Sports&lt;/p&gt;

&lt;p&gt;Music&lt;/p&gt;

&lt;p&gt;Movies&lt;/p&gt;

&lt;p&gt;Travel&lt;/p&gt;

&lt;p&gt;Gaming&lt;/p&gt;

&lt;p&gt;Teach the machine.&lt;/p&gt;




&lt;h1&gt;
  
  
  Questions for Students
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Q1
&lt;/h3&gt;

&lt;p&gt;What is Data?&lt;/p&gt;




&lt;h3&gt;
  
  
  Q2
&lt;/h3&gt;

&lt;p&gt;What is a Dataset?&lt;/p&gt;




&lt;h3&gt;
  
  
  Q3
&lt;/h3&gt;

&lt;p&gt;Why does ML need examples?&lt;/p&gt;




&lt;h3&gt;
  
  
  Q4
&lt;/h3&gt;

&lt;p&gt;What is Training?&lt;/p&gt;




&lt;h3&gt;
  
  
  Q5
&lt;/h3&gt;

&lt;p&gt;What is Prediction?&lt;/p&gt;




&lt;h3&gt;
  
  
  Q6
&lt;/h3&gt;

&lt;p&gt;Why can't YouTube use if-else statements?&lt;/p&gt;




&lt;h3&gt;
  
  
  Q7
&lt;/h3&gt;

&lt;p&gt;Does more data improve recommendations?&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;




&lt;h1&gt;
  
  
  MCQs
&lt;/h1&gt;

&lt;h3&gt;
  
  
  1. What does Machine Learning learn from?
&lt;/h3&gt;

&lt;p&gt;A) Luck&lt;/p&gt;

&lt;p&gt;B) Examples&lt;/p&gt;

&lt;p&gt;C) Guessing&lt;/p&gt;

&lt;p&gt;D) Passwords&lt;/p&gt;

&lt;p&gt;✅ Answer: &lt;strong&gt;B&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  2. What is a Dataset?
&lt;/h3&gt;

&lt;p&gt;A) A game&lt;/p&gt;

&lt;p&gt;B) A collection of examples&lt;/p&gt;

&lt;p&gt;C) A password&lt;/p&gt;

&lt;p&gt;D) A website&lt;/p&gt;

&lt;p&gt;✅ Answer: &lt;strong&gt;B&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  3. What is Training?
&lt;/h3&gt;

&lt;p&gt;A) Writing code&lt;/p&gt;

&lt;p&gt;B) Studying examples&lt;/p&gt;

&lt;p&gt;C) Buying GPUs&lt;/p&gt;

&lt;p&gt;D) Guessing answers&lt;/p&gt;

&lt;p&gt;✅ Answer: &lt;strong&gt;B&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  The Most Important Lesson
&lt;/h1&gt;

&lt;p&gt;Traditional Programming:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Human writes rules
        ↓
Computer follows rules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Machine Learning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Examples
   ↓
Find patterns
   ↓
Learn relationships
   ↓
Make predictions
   ↓
Improve with more data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  One Sentence to Remember
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Machine Learning is simply teaching a computer by showing it many examples, just like teaching a child by showing many pictures, videos, or experiences.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>How One Linked List Problem Challenged Everything I Thought I Knew</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Tue, 23 Jun 2026 18:34:37 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/how-one-linked-list-problem-challenged-everything-i-thought-i-knew-48n1</link>
      <guid>https://dev.to/abhishek-nexgen-dev/how-one-linked-list-problem-challenged-everything-i-thought-i-knew-48n1</guid>
      <description>&lt;p&gt;Today, I spent several hours debugging a Linked List problem, and by the end of it, I gained a much deeper understanding of references, pointers, and why some patterns exist in the first place.&lt;/p&gt;

&lt;p&gt;🔗 Current Problem: Merge Two Sorted Lists&lt;/p&gt;

&lt;p&gt;Before starting this problem, I was feeling confident because I had already solved &lt;strong&gt;Add Two Numbers&lt;/strong&gt; by directly modifying the original linked list instead of creating a completely new one.&lt;/p&gt;

&lt;p&gt;My solution:&lt;br&gt;
&lt;a href="https://leetcode.com/problems/add-two-numbers/solutions/8345486/add-two-numbers-using-in-place-modificat-no1j" rel="noopener noreferrer"&gt;https://leetcode.com/problems/add-two-numbers/solutions/8345486/add-two-numbers-using-in-place-modificat-no1j&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In that problem, I reused the existing nodes, updated values in-place, and only created new nodes when absolutely necessary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;List1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the list ended and there was still a carry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;prev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ListNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The approach worked beautifully.&lt;/p&gt;

&lt;p&gt;The solution was accepted, and more importantly, I understood why it worked.&lt;/p&gt;

&lt;p&gt;So when I started &lt;strong&gt;Merge Two Sorted Lists&lt;/strong&gt;, my first thought was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why create a dummy node? I already solved Add Two Numbers by modifying the original linked list. I should be able to do the same thing here."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That assumption sent me into one of the longest debugging sessions I've had recently.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Initial Approach
&lt;/h2&gt;

&lt;p&gt;Given:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = 1 -&amp;gt; 2 -&amp;gt; 4
list2 = 1 -&amp;gt; 3 -&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 -&amp;gt; 1 -&amp;gt; 2 -&amp;gt; 3 -&amp;gt; 4 -&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My plan seemed straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traverse both lists.&lt;/li&gt;
&lt;li&gt;Compare values.&lt;/li&gt;
&lt;li&gt;Insert nodes where necessary.&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;list1&lt;/code&gt; directly.&lt;/li&gt;
&lt;li&gt;Return the modified list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple.&lt;/p&gt;

&lt;p&gt;At least that's what I thought.&lt;/p&gt;




&lt;h2&gt;
  
  
  Hours of Debugging Later...
&lt;/h2&gt;

&lt;p&gt;I wrote the code.&lt;/p&gt;

&lt;p&gt;Ran test cases.&lt;/p&gt;

&lt;p&gt;Failed.&lt;/p&gt;

&lt;p&gt;Added logs.&lt;/p&gt;

&lt;p&gt;Failed again.&lt;/p&gt;

&lt;p&gt;Added more logs.&lt;/p&gt;

&lt;p&gt;Still failed.&lt;/p&gt;

&lt;p&gt;Then I started manually dry-running every iteration.&lt;/p&gt;

&lt;p&gt;I opened Excalidraw and literally drew:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every node&lt;/li&gt;
&lt;li&gt;Every pointer&lt;/li&gt;
&lt;li&gt;Every insertion&lt;/li&gt;
&lt;li&gt;Every reference update&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that's when I finally noticed what was actually happening.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Mistake Wasn't In My Logic
&lt;/h2&gt;

&lt;p&gt;The mistake was in my understanding.&lt;/p&gt;

&lt;p&gt;While traversing the linked list, I kept moving my pointers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;head1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;head2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was using the same variable for two completely different responsibilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keeping track of the original head.&lt;/li&gt;
&lt;li&gt;Traversing the list.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head1
 ↓
1 -&amp;gt; 2 -&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;head1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head1
 ↓
2 -&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;head1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head1
 ↓
4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;head1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;head1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head1
 ↓
null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At that moment, I realized something important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I had completely lost the reference to the beginning of the list.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And once a reference is lost in a linked list, there's no way to magically get it back.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why My Add Two Numbers Approach Worked
&lt;/h2&gt;

&lt;p&gt;This was the breakthrough moment.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Add Two Numbers&lt;/strong&gt;, I wasn't changing the structure of the linked list.&lt;/p&gt;

&lt;p&gt;I was only modifying values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;List1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The nodes stayed connected.&lt;/p&gt;

&lt;p&gt;The original head never changed.&lt;/p&gt;

&lt;p&gt;The linked list structure remained intact.&lt;/p&gt;

&lt;p&gt;So modifying the original list worked perfectly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why The Same Idea Fails Here
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;Merge Two Sorted Lists&lt;/strong&gt;, the situation is completely different.&lt;/p&gt;

&lt;p&gt;We are not simply updating values.&lt;/p&gt;

&lt;p&gt;We are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connecting nodes from two different linked lists.&lt;/li&gt;
&lt;li&gt;Rearranging node relationships.&lt;/li&gt;
&lt;li&gt;Managing multiple references.&lt;/li&gt;
&lt;li&gt;Building an entirely new traversal path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means reference management becomes more important than the comparison logic itself.&lt;/p&gt;

&lt;p&gt;A single lost reference can disconnect part of the list.&lt;/p&gt;

&lt;p&gt;A single incorrect pointer update can break the entire structure.&lt;/p&gt;

&lt;p&gt;That's exactly what I was running into during debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Moment Dummy Nodes Finally Made Sense
&lt;/h2&gt;

&lt;p&gt;Earlier, I used to think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Dummy nodes are just an extra step."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now I understand why they're one of the most common patterns in Linked List problems.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;dummy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ListNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dummy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dummy node provides a permanent starting point.&lt;/p&gt;

&lt;p&gt;No matter how many times I move pointers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can always access the merged list through:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;dummy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;/p&gt;

&lt;p&gt;✅ Never lose the head reference&lt;/p&gt;

&lt;p&gt;✅ No special handling for the first node&lt;/p&gt;

&lt;p&gt;✅ Cleaner insertion logic&lt;/p&gt;

&lt;p&gt;✅ Easier debugging&lt;/p&gt;

&lt;p&gt;✅ Cleaner interview solution&lt;/p&gt;




&lt;h2&gt;
  
  
  Biggest Lessons From Today
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Technical Lessons
&lt;/h3&gt;

&lt;p&gt;✅ Difference between modifying node values and modifying node connections&lt;/p&gt;

&lt;p&gt;✅ Why preserving references is critical in Linked Lists&lt;/p&gt;

&lt;p&gt;✅ Why Add Two Numbers and Merge Two Sorted Lists require different thinking&lt;/p&gt;

&lt;p&gt;✅ How easily a head pointer can be lost&lt;/p&gt;

&lt;p&gt;✅ Why Dummy Nodes are used so frequently&lt;/p&gt;

&lt;p&gt;✅ The importance of visual dry runs&lt;/p&gt;

&lt;h3&gt;
  
  
  Non-Technical Lessons
&lt;/h3&gt;

&lt;p&gt;Today reminded me that solving problems isn't always about writing more code.&lt;/p&gt;

&lt;p&gt;Sometimes progress looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writing code&lt;/li&gt;
&lt;li&gt;Failing&lt;/li&gt;
&lt;li&gt;Debugging&lt;/li&gt;
&lt;li&gt;Drawing diagrams&lt;/li&gt;
&lt;li&gt;Questioning assumptions&lt;/li&gt;
&lt;li&gt;Understanding why your approach doesn't work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most valuable part of today's session wasn't finding the answer.&lt;/p&gt;

&lt;p&gt;It was understanding why my original answer failed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tomorrow's Goal 🎯
&lt;/h2&gt;

&lt;p&gt;Tomorrow I'll solve &lt;strong&gt;Merge Two Sorted Lists&lt;/strong&gt; again, this time using the Dummy Node pattern and building the merged linked list step by step while preserving all references correctly.&lt;/p&gt;

&lt;p&gt;I didn't get an accepted solution today.&lt;/p&gt;

&lt;p&gt;But I gained something more valuable:&lt;/p&gt;

&lt;p&gt;A much deeper understanding of how Linked Lists actually work under the hood.&lt;/p&gt;

&lt;p&gt;And that's a win I'll happily take.&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #Day747 #LeetCode #DSA #JavaScript #LinkedList #Debugging #ProblemSolving #SoftwareEngineering #CodingJourney #LearnInPublic #WebDevelopment
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>🚀 React Hook Form: From Beginner to Monster — Everything You Need to Know</title>
      <dc:creator>Abhishek Gupta </dc:creator>
      <pubDate>Mon, 22 Jun 2026 06:33:37 +0000</pubDate>
      <link>https://dev.to/abhishek-nexgen-dev/react-hook-form-from-beginner-to-monster-everything-you-need-to-know-4j9b</link>
      <guid>https://dev.to/abhishek-nexgen-dev/react-hook-form-from-beginner-to-monster-everything-you-need-to-know-4j9b</guid>
      <description>&lt;p&gt;I spent several days debugging React Hook Form, understanding why some components rerender while others don't, learning about subscriptions, Proxies, Controllers, FormProvider, useFormState, and the internals that make RHF one of the fastest form libraries in the React ecosystem.&lt;/p&gt;

&lt;p&gt;This article contains everything I wish someone had explained when I started.&lt;/p&gt;

&lt;p&gt;If you understand all of these concepts, you'll not only become productive with RHF but also gain a deeper understanding of React rendering, subscriptions, and state management.&lt;/p&gt;

&lt;p&gt;Let's begin.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why React Hook Form Exists
&lt;/h1&gt;

&lt;p&gt;Most React developers start with this approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works fine for a few fields.&lt;/p&gt;

&lt;p&gt;But imagine building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login Form&lt;/li&gt;
&lt;li&gt;Signup Form&lt;/li&gt;
&lt;li&gt;Admin Dashboard&lt;/li&gt;
&lt;li&gt;Course Creation Page&lt;/li&gt;
&lt;li&gt;E-commerce Product Form&lt;/li&gt;
&lt;li&gt;Job Portal&lt;/li&gt;
&lt;li&gt;CMS&lt;/li&gt;
&lt;li&gt;Dynamic Forms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suddenly you have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;setEmail&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;setPassword&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;setErrors&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isDirty&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;setDirty&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;touched&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;setTouched&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code becomes messy.&lt;/p&gt;

&lt;p&gt;Every keystroke rerenders components.&lt;/p&gt;

&lt;p&gt;Validation logic becomes difficult.&lt;/p&gt;

&lt;p&gt;Performance suffers.&lt;/p&gt;

&lt;p&gt;React Hook Form solves these problems.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why React Hook Form is Fast
&lt;/h1&gt;

&lt;p&gt;Most libraries use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RHF uses:&lt;/p&gt;

&lt;h3&gt;
  
  
  Uncontrolled Components
&lt;/h3&gt;

&lt;p&gt;Instead of storing every keystroke inside React State,&lt;/p&gt;

&lt;p&gt;RHF stores values inside refs.&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;p&gt;Typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a
ab
abc
abcd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;does NOT rerender the entire component tree.&lt;/p&gt;

&lt;p&gt;This is the secret sauce.&lt;/p&gt;




&lt;h1&gt;
  
  
  useForm()
&lt;/h1&gt;

&lt;p&gt;The most important hook.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;methods&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useForm&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;register&lt;/span&gt;
&lt;span class="nx"&gt;handleSubmit&lt;/span&gt;
&lt;span class="nx"&gt;watch&lt;/span&gt;
&lt;span class="nx"&gt;control&lt;/span&gt;
&lt;span class="nx"&gt;formState&lt;/span&gt;
&lt;span class="nx"&gt;reset&lt;/span&gt;
&lt;span class="nx"&gt;setValue&lt;/span&gt;
&lt;span class="nx"&gt;getValues&lt;/span&gt;
&lt;span class="nx"&gt;trigger&lt;/span&gt;
&lt;span class="nx"&gt;setError&lt;/span&gt;
&lt;span class="nx"&gt;clearErrors&lt;/span&gt;
&lt;span class="nx"&gt;resetField&lt;/span&gt;
&lt;span class="nx"&gt;setFocus&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  register()
&lt;/h1&gt;

&lt;p&gt;Simplest way to connect an input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;

&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nf"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RHF internally adds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;value&lt;/span&gt;

&lt;span class="nx"&gt;onChange&lt;/span&gt;

&lt;span class="nx"&gt;onBlur&lt;/span&gt;

&lt;span class="nx"&gt;ref&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Automatically.&lt;/p&gt;




&lt;h1&gt;
  
  
  Validation
&lt;/h1&gt;

&lt;p&gt;Simple validation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Advanced&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name required&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="na"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;

&lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Minimum 3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Zod Integration
&lt;/h1&gt;

&lt;p&gt;Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i zod
npm i @hookform/resolvers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Schema&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Required&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hook&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useForm&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="na"&gt;resolver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="nf"&gt;zodResolver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="nx"&gt;Schema&lt;/span&gt;

&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  handleSubmit()
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;submit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;};&lt;/span&gt;



&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;

&lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;

&lt;span class="nf"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="nx"&gt;submit&lt;/span&gt;

&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Error callback&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onError&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;};&lt;/span&gt;



&lt;span class="nf"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="nx"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="nx"&gt;onError&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  watch()
&lt;/h1&gt;

&lt;p&gt;Subscribe to field values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

&lt;span class="nf"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;courseName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When title changes,&lt;/p&gt;

&lt;p&gt;Component rerenders.&lt;/p&gt;




&lt;h1&gt;
  
  
  useWatch()
&lt;/h1&gt;

&lt;p&gt;Optimized version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;useWatch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="nx"&gt;control&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;courseName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only rerenders for this field.&lt;/p&gt;

&lt;p&gt;Best for large applications.&lt;/p&gt;




&lt;h1&gt;
  
  
  getValues()
&lt;/h1&gt;

&lt;p&gt;Read values.&lt;/p&gt;

&lt;p&gt;No rerender.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;getValues&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Single&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;getValues&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  setValue()
&lt;/h1&gt;

&lt;p&gt;Programmatically update.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Abhishek&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Options&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="na"&gt;shouldValidate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="na"&gt;shouldDirty&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="na"&gt;shouldTouch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  reset()
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  trigger()
&lt;/h1&gt;

&lt;p&gt;Validate manually.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specific&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  setError()
&lt;/h1&gt;

&lt;p&gt;Custom validation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Email exists&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  clearErrors()
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;clearErrors&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specific&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;clearErrors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Controller()
&lt;/h1&gt;

&lt;p&gt;For custom components.&lt;/p&gt;

&lt;p&gt;Bad&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Input&lt;/span&gt;

&lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Controller&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"title"&lt;/span&gt;

&lt;span class="na"&gt;control&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;control&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="na"&gt;render&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;

&lt;span class="si"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="nx"&gt;fieldState&lt;/span&gt;

&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;(


&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Input&lt;/span&gt;


&lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fieldState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;


&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;

)

}

/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  fieldState
&lt;/h1&gt;

&lt;p&gt;Inside Controller&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;fieldState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;


&lt;span class="nx"&gt;fieldState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;invalid&lt;/span&gt;


&lt;span class="nx"&gt;fieldState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isTouched&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Automatic subscription.&lt;/p&gt;




&lt;h1&gt;
  
  
  useFieldArray()
&lt;/h1&gt;

&lt;p&gt;Dynamic forms.&lt;/p&gt;

&lt;p&gt;Perfect for:&lt;/p&gt;

&lt;p&gt;Skills&lt;/p&gt;

&lt;p&gt;Projects&lt;/p&gt;

&lt;p&gt;Education&lt;/p&gt;

&lt;p&gt;Requirements&lt;/p&gt;

&lt;p&gt;Admission Criteria&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="nx"&gt;append&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="nx"&gt;remove&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

&lt;span class="nf"&gt;useFieldArray&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="nx"&gt;control&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;skills&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  FormProvider
&lt;/h1&gt;

&lt;p&gt;Best architecture.&lt;/p&gt;

&lt;p&gt;Wrapper&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;FormProvider&lt;/span&gt;

&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;FormProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consume&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

&lt;span class="nf"&gt;useFormContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  The Biggest Confusion: formState
&lt;/h1&gt;

&lt;p&gt;Everyone writes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="na"&gt;formState&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;

&lt;span class="nx"&gt;errors&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sometimes&lt;/p&gt;

&lt;p&gt;Errors update.&lt;/p&gt;

&lt;p&gt;Sometimes&lt;/p&gt;

&lt;p&gt;Component doesn't rerender.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;




&lt;h1&gt;
  
  
  formState is NOT Normal State
&lt;/h1&gt;

&lt;p&gt;It's a&lt;/p&gt;

&lt;p&gt;Proxy.&lt;/p&gt;

&lt;p&gt;Something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;

&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RHF only rerenders subscribers.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why My Component Didn't Rerender?
&lt;/h1&gt;

&lt;p&gt;I had:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

&lt;span class="nf"&gt;useCourseFormContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;



&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

&lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;

&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Validation happened.&lt;/p&gt;

&lt;p&gt;Errors existed.&lt;/p&gt;

&lt;p&gt;But component never rerendered.&lt;/p&gt;




&lt;h1&gt;
  
  
  Solution
&lt;/h1&gt;

&lt;p&gt;Subscribe.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;errors&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

&lt;span class="nf"&gt;useFormState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="nx"&gt;control&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now&lt;/p&gt;

&lt;p&gt;Errors change&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;Component rerenders&lt;/p&gt;

&lt;p&gt;Instantly.&lt;/p&gt;




&lt;h1&gt;
  
  
  useFormState()
&lt;/h1&gt;

&lt;p&gt;Perfect for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;


&lt;span class="nx"&gt;isDirty&lt;/span&gt;


&lt;span class="nx"&gt;isValid&lt;/span&gt;


&lt;span class="nx"&gt;dirtyFields&lt;/span&gt;


&lt;span class="nx"&gt;touchedFields&lt;/span&gt;


&lt;span class="nx"&gt;submitCount&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="nx"&gt;isDirty&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="nx"&gt;isValid&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

&lt;span class="nf"&gt;useFormState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

&lt;span class="nx"&gt;control&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Validation Modes
&lt;/h1&gt;

&lt;h3&gt;
  
  
  onSubmit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;onSubmit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only submit.&lt;/p&gt;




&lt;h3&gt;
  
  
  onChange
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;onChange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Validate every key.&lt;/p&gt;




&lt;h3&gt;
  
  
  onBlur
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;onBlur&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Validate after blur.&lt;/p&gt;




&lt;h3&gt;
  
  
  all
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;all&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything.&lt;/p&gt;




&lt;h1&gt;
  
  
  Performance Tips
&lt;/h1&gt;

&lt;p&gt;Use&lt;/p&gt;

&lt;p&gt;✅ register&lt;/p&gt;

&lt;p&gt;✅ Controller&lt;/p&gt;

&lt;p&gt;✅ fieldState&lt;/p&gt;

&lt;p&gt;✅ useWatch&lt;/p&gt;

&lt;p&gt;✅ useFormState&lt;/p&gt;

&lt;p&gt;✅ useFieldArray&lt;/p&gt;

&lt;p&gt;✅ FormProvider&lt;/p&gt;

&lt;p&gt;Avoid&lt;/p&gt;

&lt;p&gt;❌ watch everywhere&lt;/p&gt;

&lt;p&gt;❌ setValue everywhere&lt;/p&gt;

&lt;p&gt;❌ Multiple useForm()&lt;/p&gt;

&lt;p&gt;❌ Manual states&lt;/p&gt;

&lt;p&gt;❌ Copying RHF data into useState&lt;/p&gt;




&lt;h1&gt;
  
  
  Interview Questions
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Why is RHF fast?
&lt;/h3&gt;

&lt;p&gt;Because it uses uncontrolled components, refs, subscriptions, and Proxy-based formState instead of storing every field in React state.&lt;/p&gt;




&lt;h3&gt;
  
  
  Difference between watch and useWatch?
&lt;/h3&gt;

&lt;p&gt;watch rerenders the parent component.&lt;/p&gt;

&lt;p&gt;useWatch subscribes only to selected fields.&lt;/p&gt;




&lt;h3&gt;
  
  
  Difference between Controller and register?
&lt;/h3&gt;

&lt;p&gt;register works for native inputs.&lt;/p&gt;

&lt;p&gt;Controller is designed for custom controlled components.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why useFormState?
&lt;/h3&gt;

&lt;p&gt;To subscribe components to errors, dirty state, touched fields, and validity changes.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why FormProvider?
&lt;/h3&gt;

&lt;p&gt;To avoid prop drilling and share the same form instance across deeply nested components.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;React Hook Form isn't just another form library.&lt;/p&gt;

&lt;p&gt;It's a carefully designed subscription-based state management system optimized specifically for forms.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
