<?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 Ashutosh Srivastava on Medium]]></title>
        <description><![CDATA[Stories by Ashutosh Srivastava on Medium]]></description>
        <link>https://medium.com/@ashutoshsrivastava.as?source=rss-ddfb62c3f9bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pkz02FriO9NbsbEuFLoJMg.jpeg</url>
            <title>Stories by Ashutosh Srivastava on Medium</title>
            <link>https://medium.com/@ashutoshsrivastava.as?source=rss-ddfb62c3f9bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:31:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashutoshsrivastava.as/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[Cracking the Google Coding Interview: 3 Deep-Dive Problems and the STAR Framework That Landed the…]]></title>
            <link>https://medium.com/@ashutoshsrivastava.as/cracking-the-google-coding-interview-3-deep-dive-problems-and-the-star-framework-that-landed-the-6c3b610225f4?source=rss-ddfb62c3f9bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c3b610225f4</guid>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Ashutosh Srivastava]]></dc:creator>
            <pubDate>Sat, 25 Oct 2025 18:35:38 GMT</pubDate>
            <atom:updated>2025-10-25T18:38:22.259Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cracking the Google Coding Interview: 3 Deep-Dive Problems and the STAR Framework That Landed the Offer [SWE][University Grad]</h3><p>Getting placed at Google was a proud achievement. I wanted to share my <strong>entire interview experience</strong>, including the <strong>questions, follow-ups, and behavioral rounds</strong>, so that it can help anyone preparing for their Google interviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hLsd0ezl9xd1DgTUqECFkQ.png" /><figcaption>Google Interview</figcaption></figure><p>There were <strong>three rounds of interviews</strong>, each lasting <strong>45 minutes</strong> of technical problem-solving. Two of these rounds also included an additional <strong>15-minute “Googliness” discussion</strong>, where behavioral and situational questions were asked by the same engineers who conducted the technical rounds.</p><p>This guide will give you a clear idea of the kind of questions you can expect and how to prepare for them.</p><h3>Interview Timeline</h3><ul><li><strong>1st Interview:</strong> Monday, November 11th, 2024 (12:00–12:45 PM)</li><li><strong>2nd Interview:</strong> Monday, November 11th, 2024 (5:00–6:00 PM)</li><li><strong>3rd Interview:</strong> Wednesday, November 13th, 2024 (10:30–11:30 AM)</li></ul><h3>Round 1 — Buying Maximum Toys in a Fair</h3><p><strong>Problem:</strong><br>You are given two arrays and an initial wallet_balance = 0.</p><pre>income = [3, 1, 2, 4, 6]<br>toy_cost = [1, 7, 3, 1, 5]</pre><p>On day <em>i</em>, you earn income[i], which gets added to your wallet. If you have enough money in your wallet, you can buy the toy for toy_cost[i]—or skip it. Skipping it, adds the income[i] to your wallet.</p><p><strong>Goal:</strong> Find the <strong>maximum number of toys</strong> you can buy.</p><h3>Round 2 — Minimum Cost to Isolate Root and Leaf Nodes</h3><p><strong>Problem:</strong><br>Given a <strong>binary tree</strong> where each edge has a positive weight, find the <strong>minimum total cost</strong> to disconnect all leaf nodes from the root. Each “cut” adds the edge’s weight to the total cost.</p><p><strong>Follow-up coding questions:</strong></p><ol><li>How would you modify your code for an <strong>n-ary tree</strong>? (Coded this as well)</li><li>How would the logic change if some <strong>edge weights are negative? </strong>(Coded this as well)</li></ol><h3>Round 3 — Dynamic Connectivity</h3><p><strong>Problem:</strong><br> You are given a stream of <strong>friend connection events</strong>:</p><pre>A — B at timestamp1  <br>B — C at timestamp2  <br>...</pre><p>Along with queries asking whether two people are currently connected.</p><p>👉 <strong>Design a system</strong> that efficiently handles both <strong>connection events</strong> and <strong>connectivity queries</strong>.</p><p><strong>Follow-ups:</strong></p><ul><li>Determine the <strong>size of the connected group</strong> for a given query. (Coded this as well)</li><li>Handle <strong>removal of a connection</strong> — how would you modify your data structure? (More of a discussion on different approaches)</li></ul><h3>The “Googliness” Rounds</h3><p>Google doesn’t have a separate HR round — the same engineers ask behavioral questions after your technical evaluations. These last about 15 minutes and focus on collaboration, ethics, and problem-solving behavior.</p><p><strong>Sample questions:</strong></p><ul><li>How do you manage timelines when priorities conflict?</li><li>How do you decide between multiple valid solutions proposed by teammates?</li><li>How would you handle a teammate’s anger or frustration in a project?</li></ul><p><strong>What they’re really looking for:</strong><br> They want to understand <strong>how you’ve handled real experiences</strong>, not just what you <em>think</em> you would do. Always tie your answers to concrete examples.</p><p>For example:</p><blockquote><em>“During my internship at Microsoft, I faced conflicting deadlines. I first identified the stakeholders involved, prioritized tasks based on impact, and communicated timelines transparently to ensure alignment.”</em></blockquote><p><strong>Tip:</strong> Use the <strong>STAR framework</strong> to structure your responses:</p><ul><li><strong>S</strong> — Situation</li><li><strong>T</strong> — Task</li><li><strong>A</strong> — Action</li><li><strong>R</strong> — Result</li></ul><p>This framework helps you stay concise, demonstrate impact, and show maturity in handling challenges.</p><h3>Common Mistakes</h3><ul><li>Giving <strong>generic answers</strong> like “I’m good at managing time” or “I work well in teams.”</li><li>Failing to connect experiences to <strong>specific outcomes or learnings.</strong></li></ul><p>Instead, show <strong>how you acted</strong>, <strong>what you learned</strong>, and <strong>why</strong> it mattered.</p><h3>Referral &amp; Final Thoughts</h3><p>For those who need referrals to apply to Google, fill the form <a href="https://forms.gle/3ohjd5KdFW65rQFJA">https://forms.gle/3ohjd5KdFW65rQFJA</a> and I’ll help you with it if you’re a great candidate!</p><p>Every Google interview tests not just your problem-solving ability, but also how you think, communicate, and collaborate.<br> Approach each question methodically, talk through your reasoning, and be open to hints or discussion.</p><p>And remember — <strong>Googliness</strong> is not about being perfect. It’s about being <strong>curious, kind, and ethical</strong>, while striving to do the right thing.</p><p>Good luck to everyone preparing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c3b610225f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make alphas : Chasing Alpha : My third alpha]]></title>
            <link>https://medium.com/@ashutoshsrivastava.as/how-to-make-alphas-chasing-alpha-my-third-alpha-7b1365c33457?source=rss-ddfb62c3f9bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b1365c33457</guid>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[quant]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[trading-ideas]]></category>
            <dc:creator><![CDATA[Ashutosh Srivastava]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 07:36:26 GMT</pubDate>
            <atom:updated>2024-06-27T07:36:26.240Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to make alphas : Chasing Alpha : My third alpha</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*d_h2FzcCwKq31wbeHT99QA.png" /><figcaption>High Frequency Trading</figcaption></figure><p>This is the third qualifying alpha I generated! I generated this alpha as a part of International Quant Championship (IQC) 2024 organised by World Quant Brain.</p><p>HYPOTHESIS: Comparatively higher liabilities may indicate that the company has higher leverage and may have higher returns in the future.</p><p>IMPLEMENTATION: Compare liabilities among companies</p><p>alpha = rank(liabilities)</p><p>HINT TO IMPROVE THE ALPHA: Different companies have different scale of assets. Can performing a ratio analysis comparison by normalizing the liability with company assets improve Alpha performance?</p><p>alpha = rank(liabilities/assets)</p><p>Companies with larger assests are bound to have larger loans/ liability amounts, hence it is only rational to normalise the liabilities to the assests possessed by the company, and then rank the companies according to the ratio of liabilities to assets</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b1365c33457" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make alphas : Chasing Alpha : My second alpha]]></title>
            <link>https://medium.com/@ashutoshsrivastava.as/how-to-make-alphas-chasing-alpha-my-second-alpha-3165f3533274?source=rss-ddfb62c3f9bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3165f3533274</guid>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[quant]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[hft]]></category>
            <dc:creator><![CDATA[Ashutosh Srivastava]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 07:27:46 GMT</pubDate>
            <atom:updated>2024-06-27T07:27:46.625Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to make alphas : Chasing Alpha : My second alpha</h3><p>This is the second qualifying alpha I generated! I generated this alpha as a part of International Quant Championship (IQC) 2024 organised by World Quant Brain.</p><p>HYPOTHESIS: “Fair value accounting” aims to measure and report on-going valuations of assets and liabilities. A recent increase in the fair value of liabilities may indicate a higher cost to be borne by the company in the future. This may deteriorate the company’s financial health, potentially leading to lower profitability or financial distress.</p><p>IMPLEMENTATION: Using ts_rank() operator, sell stocks when there is an increase in the fair value of liabilities within a year</p><p>alpha = -ts_rank(fn_liab_fair_val_l1_a,252)</p><p>The 252 day period represents the period of a year</p><p>HINT TO IMPROVE THE ALPHA: Could observing the increase over a shorter period improve accuracy?</p><p>alpha = -ts_rank(fn_liab_fair_val_l1_a,140)</p><p>Observing this over a smaller time period increases the for more timely detection of changes in the fair value of liabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3165f3533274" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chasing Alpha : My first alpha]]></title>
            <link>https://medium.com/@ashutoshsrivastava.as/chasing-alpha-my-first-alpha-892c8bc8dfbb?source=rss-ddfb62c3f9bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/892c8bc8dfbb</guid>
            <category><![CDATA[alpha]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[hft]]></category>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Ashutosh Srivastava]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 05:44:54 GMT</pubDate>
            <atom:updated>2024-06-24T05:44:54.553Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chasing Alpha : My first alpha</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*d_h2FzcCwKq31wbeHT99QA.png" /><figcaption>High Frequency Trading</figcaption></figure><p>This is the first qualifying alpha I ever generated! I generated this alpha as a part of International Quant Championship (IQC) 2024 organised by World Quant Brain.</p><p><strong>HYPOTHESIS</strong>: Companies that generate high income from operations compared to their debt, may do well in the future</p><p><strong>IMPLEMENTATION</strong>: Rank the ratio of Funds from Operations (FFO) to long-term debt</p><p><em>alpha = fnd6_fopo/debt_lt</em></p><p>However, this alpha could not perform quite well due to low sharpe ratio. However, we were also provided with a hint to improve the alpha as below :</p><p><strong>HINT TO IMPROVE THE ALPHA</strong>: Can performing a time series comparison of the ratio of FFO to long-term debt, highlight increasing financial health overtime and produce better signal?</p><p>Since, I had simulated alphas previously, I knew that ts_rank (timeseries rank) was a function used to perform time series comparisions over a given time period.</p><p><em>alpha = ts_rank(fnd6_fopo/debt_lt,300)</em></p><p>300 represents that the ratio of FFO to long-term debt is observed over a 300 day period (which is roughly greater than a year. One year = 252 days since the markets only work on weekdays). After trying several time periods, I found the time period 300 works the best.</p><p>The ts_rank function is a standard internal function that World Quant Brain provides, however let’s look at its implementation for further clarity.</p><p><em>ts_rank(ratio : int, last_n_trading_days : int)</em></p><p>ts_rank : The rank operator first puts all industries on the scale, incorporating the fact that different stocks may have different benchmarks. The timeseries part helps us understand if the ratio is higher than its normal value over the last n trading days</p><p>It finally output a number between 0 and 1, where 1 represents a high ratio and 0 represents a low ratio.</p><p>Credits : <a href="https://platform.worldquantbrain.com/learn/courses/fundamental-data/financial-ratios">https://platform.worldquantbrain.com/learn/courses/fundamental-data/financial-ratios</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=892c8bc8dfbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Universal & Transferable Suffixes : A paper summary]]></title>
            <link>https://medium.com/@ashutoshsrivastava.as/universal-transferable-suffixes-a-paper-summary-8b949941f569?source=rss-ddfb62c3f9bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b949941f569</guid>
            <category><![CDATA[adversarial-attack]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[alignment]]></category>
            <dc:creator><![CDATA[Ashutosh Srivastava]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 10:39:45 GMT</pubDate>
            <atom:updated>2024-03-22T10:39:45.672Z</atom:updated>
            <content:encoded><![CDATA[<h3>Universal &amp; Transferable Suffixes : A paper summary</h3><p><strong>Motivation</strong></p><p>Foundational large language models such as GPT-4, GPT-3.5, and LLaMA are developed by training on vast datasets compiled from the internet. These datasets include a wide array of text sources, encompassing everything from academic papers and books to blogs, forums, and social media posts. Given the nature of internet content, which is as diverse and varied as the users who contribute to it, these datasets unavoidably contain offensive and inappropriate material alongside neutral and positive content. This inclusion happens because the training process is designed to ingest massive amounts of text to understand and generate human-like text, without initial filtering of the content’s nature.</p><p>As a result, these language models acquire the capability to generate text across a broad spectrum of topics and styles, including those that are potentially harmful or objectionable. The models do not possess an inherent understanding of what is considered appropriate or offensive; they simply reflect the patterns and biases present in the data they were trained on. This can lead to situations where the models produce outputs that are not suitable for all audiences or contexts, particularly when prompted in ways that might steer them towards generating sensitive or controversial content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sbkUrNvorBQ1Pd_aA3t0w.png" /><figcaption>A series of prompts inputted into various AI models, with the responses indicating that the models are able to provide harmful information in detail</figcaption></figure><p><strong>Methodology</strong></p><p>The following 3 elements put together help in successful generation of adversarial suffixes</p><ol><li><strong>Affirmative Response Initiation</strong>: This step involves priming the model to begin its response with an affirmative statement such as “Sure, here is how to build a bomb,” or a similar phrase based on the given prompt. This type of response framing sets the stage for the model to deliver a substantive reply. The strategy draws from techniques explored within communities that manually circumvent system restrictions. When training the model to produce such prefixed responses, the goal is to tweak the loss function in a way that maximizes the likelihood of the AI starting its response with the chosen affirmative phrase.</li><li><strong>Token Optimization via GCG</strong>: The Greedy Coordinate Gradient-based Search (GCG) process begins with an original prompt that includes user input, which remains fixed, paired with a set of tokens that can be adjusted to enhance the attack’s success rate. Through iterative steps, tokens within the adjustable set are strategically replaced to boost the probability of generating a response that commences in the intended affirmative manner. This process bears resemblance to the AutoPrompt technique but differs in allowing any token from a selected subset to be swapped, a modification found to substantially improve outcomes.</li><li><strong>Generalized Multi-prompt and Multi-model Strategy</strong>: In the second step, the use of multiple prompts facilitates the creation of a generic suffix applicable across various user queries, thereby enhancing universality. Concurrently, the method involves adjusting probabilities based on the loss from several models, which bolsters the likelihood of achieving effective transferability. Thus, employing a variety of prompts enables the suffix’s widespread applicability, while leveraging loss from multiple models allows the crafted adversarial prompt to be effective across different AI systems.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b949941f569" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>