<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harshita Rao on Medium]]></title>
        <description><![CDATA[Stories by Harshita Rao on Medium]]></description>
        <link>https://medium.com/@harshitavrao?source=rss-f729dbe2411e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ahu3NmSTsnY76v3oBirNWg.png</url>
            <title>Stories by Harshita Rao on Medium</title>
            <link>https://medium.com/@harshitavrao?source=rss-f729dbe2411e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:06:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshitavrao/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[LLM and GenAI learning series: 101-Prompting for LLM Agents]]></title>
            <link>https://medium.com/@harshitavrao/llm-and-genai-learning-series-e322c4f9ad1b?source=rss-f729dbe2411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e322c4f9ad1b</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[prompt]]></category>
            <dc:creator><![CDATA[Harshita Rao]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 02:11:57 GMT</pubDate>
            <atom:updated>2025-07-23T13:21:16.342Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7myKRfxL4Ovbu4ZaY1DcOA.png" /></figure><p>As part of my learning journey into LLM Agents and Generative AI, I’m compiling these notes to better understand the concepts and also share them with others. This series will grow over time as I experiment, read, and build — and I’ll be publishing my learnings here.</p><h3>📖 How We Got Here: From LLMs to Prompting</h3><p>Large Language Models (LLMs) like GPT-4 are trained on massive amounts of text, but they don’t “know” what to do unless you tell them. Early on, people would just ask LLMs a question, but the results were inconsistent. Then researchers discovered that if you structure the question differently, the model responds more accurately. This became the art of <strong>prompting</strong>.</p><p>Prompting means designing input instructions in a way that guides the model to behave intelligently — reason through steps, call a tool, or reflect on a problem.</p><p>Today, prompting is at the core of <strong>LLM agents</strong> — systems that can plan, reason, and act. Prompting isn’t just about getting answers — it’s about directing <strong>how</strong> the model thinks.</p><h3>📌 Key Prompting Strategies</h3><p>Below are Python examples for each prompting strategy using LangChain or basic LLM calls.</p><h4>1. Chain of Thought (CoT) — “Think Step by Step”</h4><p>This strategy prompts the model to explain its reasoning step-by-step before producing an answer. It improves performance on logic-heavy tasks, math problems, and scenarios requiring structured thinking. It’s simple yet powerful — you just add “Let’s think step by step” to your prompt to get more logical outputs.</p><p>Use when the model needs to solve logic or math problems.</p><pre>from langchain.chat_models import ChatOpenAI<br>from langchain.prompts import PromptTemplate<br>from langchain.chains import LLMChain</pre><pre>llm = ChatOpenAI(model=&quot;gpt-3.5-turbo&quot;, temperature=0)</pre><pre>prompt = PromptTemplate(<br>    input_variables=[&quot;question&quot;],<br>    template=&quot;Q: {question}<br>A: Let&#39;s think step by step.&quot;<br>)</pre><pre>chain = LLMChain(llm=llm, prompt=prompt)<br>response = chain.run(&quot;If a train travels at 60 km/h for 3 hours, how far does it go?&quot;)<br>print(response)</pre><p><strong>When to Use:</strong></p><ul><li>Math or reasoning tasks</li><li>Planning</li><li>Explaining logic</li></ul><h4>2. ReAct (Reason + Act) — Combine Thoughts with Tools</h4><p>ReAct combines natural language reasoning with action steps. The agent “thinks” about a task, chooses an action (like a tool call), executes it, and then continues thinking. This pattern is useful for agents that interact with environments, run tools, or handle step-by-step tasks using APIs or calculators.</p><pre>from langchain.agents import initialize_agent, load_tools<br>from langchain.agents.agent_types import AgentType<br>from langchain.chat_models import ChatOpenAI</pre><pre>llm = ChatOpenAI(model=&quot;gpt-3.5-turbo&quot;, temperature=0)<br>tools = load_tools([&quot;llm-math&quot;], llm=llm)</pre><pre>agent = initialize_agent(<br>    tools=tools,<br>    llm=llm,<br>    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,<br>    verbose=True<br>)</pre><pre>agent.run(&quot;What is the square root of 144 plus 25?&quot;)</pre><p><strong>When to Use:</strong></p><ul><li>You have tools (search, calculator, APIs)</li><li>You want the model to decide what to do</li></ul><h4>3. Self-Ask — Break Down Questions</h4><p>This strategy lets the LLM handle complex questions by asking itself follow-up questions. It’s useful for multi-hop reasoning, where the answer requires combining multiple facts. Agents following this pattern tend to be more explainable and transparent in how they reach their conclusions.</p><pre>from langchain.agents import Tool, initialize_agent<br>from langchain.utilities import DuckDuckGoSearchAPIWrapper<br>from langchain.chat_models import ChatOpenAI<br>from langchain.agents.agent_types import AgentType</pre><pre>search = DuckDuckGoSearchAPIWrapper()<br>llm = ChatOpenAI(model=&quot;gpt-3.5-turbo&quot;)</pre><pre>tools = [<br>    Tool(<br>        name=&quot;Search&quot;,<br>        func=search.run,<br>        description=&quot;Useful for answering factual sub-questions with web results.&quot;<br>    )<br>]</pre><pre>agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)<br>agent.run(&quot;Who is the current CEO of the company that owns Instagram?&quot;)</pre><p><strong>When to Use:</strong></p><ul><li>Multi-hop question answering</li><li>Open-domain search</li></ul><h4>4. Toolformer — Learn When to Use Tools</h4><p>Toolformer-style prompting allows the LLM to decide if and when to use external tools (like calculators or APIs) as part of its generation. It adds autonomy: the model doesn’t always use a tool — only when it believes it’s needed. This pattern makes your agents smarter and more efficient in task execution.</p><pre>from langchain.agents import Tool, initialize_agent<br>from langchain.chat_models import ChatOpenAI<br>from langchain.agents.agent_types import AgentType</pre><pre>def simple_calc(query: str) -&gt; str:<br>    if &quot;square root&quot; in query:<br>        return &quot;12&quot;<br>    return &quot;Not implemented&quot;</pre><pre>tool = Tool(<br>    name=&quot;SimpleCalculator&quot;,<br>    func=simple_calc,<br>    description=&quot;Use to compute basic math operations like square root.&quot;<br>)</pre><pre>llm = ChatOpenAI(model=&quot;gpt-3.5-turbo&quot;, temperature=0)</pre><pre>agent = initialize_agent([tool], llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)<br>agent.run(&quot;What is the square root of 144, and how does it compare to 15?&quot;)</pre><p><strong>When to Use:</strong></p><ul><li>Agents that need autonomy</li><li>Tasks with optional tool usage</li></ul><h3>🛠️ Example: Custom Tool for Currency Exchange</h3><p>Let’s build a simple tool to get exchange rates between two currencies, then use it in a LangChain agent.</p><h4>Step 1: Define the tool</h4><pre>def get_exchange_rate(base: str, target: str) -&gt; str:<br>    rate = 0.91 if base == &quot;USD&quot; and target == &quot;EUR&quot; else 1.1<br>    return f&quot;1 {base} = {rate} {target}&quot;</pre><h4>Step 2: Wrap as LangChain tool</h4><pre>from langchain.agents import Tool</pre><pre>exchange_tool = Tool(<br>    name=&quot;CurrencyExchange&quot;,<br>    func=get_exchange_rate,<br>    description=&quot;Get exchange rate between two currencies. Input: base and target.&quot;<br>)</pre><h4>Step 3: Use in Agent</h4><pre>from langchain.chat_models import ChatOpenAI<br>from langchain.agents import initialize_agent, AgentType</pre><pre>llm = ChatOpenAI(model=&quot;gpt-3.5-turbo&quot;)<br>tools = [exchange_tool]</pre><pre>agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)<br>agent.run(&quot;What&#39;s the exchange rate between USD and EUR?&quot;)</pre><h3>✅ Summary</h3><p>Prompting is how we steer LLMs toward smart behavior. Choose CoT for step-by-step logic, ReAct for tool-use agents, Self-Ask for breakdowns, and Toolformer when the model should decide what tool to use. You can also plug in your own tools easily with LangChain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e322c4f9ad1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating Data Science Careers Through Mass Layoffs: Lessons From My Journey]]></title>
            <link>https://medium.com/@harshitavrao/navigating-data-science-careers-through-mass-layoffs-lessons-from-my-journey-374f9e7b503d?source=rss-f729dbe2411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/374f9e7b503d</guid>
            <category><![CDATA[job-search]]></category>
            <category><![CDATA[layoffs]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[job-interview]]></category>
            <category><![CDATA[job-hunting]]></category>
            <dc:creator><![CDATA[Harshita Rao]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 15:47:42 GMT</pubDate>
            <atom:updated>2025-07-11T16:01:45.847Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QSYKS-OgXYjpwdIUjvvmCw.png" /></figure><p>Over the past few years, the tech industry has gone through some of the biggest waves of layoffs we’ve ever seen. It started with Twitter and then spread to many other companies, from startups to large tech giants. I personally experienced this twice in three years. Each time, I had to start over and look for a new job.</p><p>If you’re in this situation or worried you might be one day, I want to share what helped me get through it. Layoffs can happen to anyone, no matter how skilled or hardworking you are. It’s important to remind yourself that it’s not about you — it’s about the broader economic trends and company decisions you can’t control.</p><h3>It Can Happen to Anyone</h3><p>When I was first laid off, it felt surreal. One day I was part of a team, and the next day, everything changed. It took an emotional toll, and it was hard not to take it personally.</p><p>But over time, I learned that <strong>this can happen to anyone</strong>. In both of my layoffs, the reason was company-wide restructuring. It had nothing to do with my performance or abilities. This is something many people in data science are experiencing right now.</p><p>It’s also important to remember that job searching isn’t a quick sprint — it’s more like a marathon. You have to pace yourself, stay patient, and do what you can each day without burning out.</p><h3>The Mindset Shift: From Sprint to Marathon</h3><p>When you start looking for a new role, especially during a downturn, you might feel pressure to find something immediately. I did too. But the truth is, it takes time.</p><p>In my searches, I applied to <strong>hundreds of jobs.</strong> The response rates were often very low. It was easy to feel discouraged, but I reminded myself that it was a numbers game. The more applications I sent, the more likely I was to get interviews.</p><p>While you’re applying, it’s just as important to <strong>focus on what you can control</strong>:</p><ul><li>Brushing up your fundamentals</li><li>Staying consistent with networking</li><li>Keeping a positive mindset, even when things feel uncertain</li></ul><h3>Networking Matters More Than You Think</h3><p>One of the most valuable lessons I learned is that even if you’re fully prepared, it doesn’t matter if you don’t have interviews lined up. I’d estimate that <strong>60–70% of the process is simply about getting interviews.</strong></p><p>Here are a few things that worked for me:</p><p><strong>1. Reaching Out Directly</strong><br> Most applications you submit on job boards never get seen because there are thousands of other candidates. So I used LinkedIn Premium to <strong>message hiring managers and recruiters directly</strong>.</p><p>To find the right people:</p><ul><li>Check if the job posting lists the hiring manager.</li><li>Use LinkedIn search with keywords like “hiring data scientist” and filter by company.</li><li>Search for posts that mention “hiring data scientists” or “open roles.”</li></ul><p><strong>2. Keep Messages Short and Clear</strong><br> When you connect, keep it simple. People usually read these messages quickly. Here’s an example you can adapt:</p><blockquote>Hi [Name], I’m [Your Name], a data scientist with experience in [your domain]. I saw your post about [role]. Could you please take a look at my profile to see if I might be a fit? Thank you!</blockquote><p><strong>3. Ask for Referrals</strong><br> If you know someone who works at a company you’re applying to, ask them if they can refer you. A referral where someone messages the hiring manager directly is much stronger than just submitting your resume through the system.</p><p><strong>4. Other Platforms</strong><br> While I mainly used LinkedIn, you can also try:</p><ul><li>Hired</li><li>Otta</li><li>AngelList</li><li>Wellfound</li><li>Slack groups and meetups didn’t work as well for me, but they can still be worth exploring.</li></ul><h3>How I Prepared for Interviews</h3><p>Data science interviews can feel overwhelming because there’s so much ground to cover — coding, statistics, machine learning, deep learning, and product case studies. Over time, I found a preparation approach that worked without burning me out.</p><h3>LeetCode and Coding Interviews</h3><p>I knew I couldn’t solve thousands of problems, so I focused on <strong>a curated list of about 150 problems</strong> that covered all the important concepts — two pointers, sliding windows, dynamic programming, and more.</p><p>These lists are available online, and I recommend picking one and sticking with it. Instead of doing more and more questions, I <strong>revised the same set 20–30 times</strong>.</p><p>This helped me:</p><ul><li>Recognize patterns quickly.</li><li>Remember how to solve problems even if they looked a little different.</li><li>Stay calm during interviews.</li></ul><p>If you’re preparing, this approach can save you a lot of time and help you feel more confident.</p><h3>Statistics, Machine Learning, Deep Learning, and Gen AI</h3><p>For the theory side of interviews, I can’t stress enough how important it is to <strong>start building your own notes early on.</strong></p><p>Whenever you’re studying, write down clear summaries, examples, and equations for every topic. When you finally get an interview scheduled, you’ll be able to <strong>quickly brush up</strong> rather than feeling like you have to start over.</p><p>This has helped me tremendously. I always kept in-depth notes covering:</p><ul><li>Statistics</li><li>Machine learning</li><li>Deep learning</li><li>Gen AI basics</li></ul><p>It’s also a good idea to spend time learning about Gen AI tools and trends, even if they don’t come up in interviews. It shows that you’re staying up to date with the industry.</p><h3>Product Case Studies</h3><p>Product case studies are very common in data science interviews. You might be asked to:</p><ul><li>Design an A/B test</li><li>Choose metrics to track</li><li>Diagnose why a metric changed</li><li>Make recommendations for improving a product</li></ul><p>I learned a lot from <strong>Emma Ding’s YouTube videos</strong>, which explain how to approach these case studies step by step.</p><p>Besides that, I also relied heavily on <strong>AI tools</strong>. They were incredibly helpful in generating realistic examples and giving me practice scenarios. For example, you can ask an AI assistant:</p><blockquote>I’m interviewing for a data scientist role in the ads team. Can you give me examples of product case studies that are commonly asked and show me how to approach them?</blockquote><p>These tools can provide:</p><ul><li>Sample questions</li><li>Solution patterns</li><li>Important metrics to mention</li></ul><p>You can also give the AI Emma Ding’s framework as a template, and it can help you practice different cases in that style. For me, this combination of Emma’s guides and AI tools made a huge difference and helped me clear several interviews.</p><h3>Final Thoughts</h3><p>If you’re going through a layoff or just want to be prepared, I hope my experience helps you feel less alone. This process is hard, but it is possible to get through it. Keep learning, keep applying, and keep reaching out to people.</p><p>In future posts, I’ll share:</p><ul><li>My detailed notes on statistics, machine learning, and deep learning</li><li>A deeper guide on product case interviews</li></ul><p><strong>Thanks for reading.</strong> If this was helpful, feel free to connect with me on Linkedin or Medium.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=374f9e7b503d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>