<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Devansh</title><description>Devansh Shah&apos;s Portfolio Blog Notes Projects Experience Website.</description><link>https://devanshshah.dev/</link><item><title>Cringe is a Constraint</title><link>https://devanshshah.dev//posts/cringe-is-a-constraint/</link><guid isPermaLink="true">https://devanshshah.dev//posts/cringe-is-a-constraint/</guid><description>On questioning what such labels really mean.</description><pubDate>Sun, 30 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&gt; _Disclaimer: The views and opinions expressed in this blog are solely my own. They do not represent, reflect, or imply the views, positions, or policies of my employer, past or present._

My central claim is that **assigning things the label “cringe” often just adds more constraints to achieving a goal.**

I was, until recently, guilty of this myself, but once I realized this, it seemed obvious (in hindsight) that this was not a “useful” belief to hold and it would be much more prudent to drop such labels altogether.

“Useful&quot; here is anything that helps you achieve your goals. **If a belief / mindset helps you achieve your goal, then it’s useful and you should keep it, and if it doesn’t, then you shouldn’t.** As simple as that.

&gt; Story time: I was talking to my friends last night who asked me “Devansh, do you believe in free will? Do you believe we really have the freedom to make our own choices? Or is it all destiny?” I immediately replied “I choose to believe in free will and that we write our own destiny, not because I necessarily _know_ for sure that’s true but because it’s the more _useful_ approach. Imagine 2 worlds - one with free will (“world FW”), one with destiny (“world D”). If believing in free will makes you work harder and leaves you better off in world FW while not leaving you worse off in world D, then it’s strictly better to believe in free will, as long as there’s a non-zero chance that FW exists.”[^1]

Now, why do i think labels like “cringe” (and “lame”) are not useful?

Let’s consider the example of software engineering.

Imagine you are a software engineer. You’re trying to build a web application that solves some real-world problem (pick your favourite).

You start working on the project and use Cursor and Claude Code and all the fancy latest AI technology to help you speed up your project.

You find it to be very useful and it improves your productivity by 3x. You, being a responsible and competent software engineer, still take time to review the code because you know that AI can make mistakes.

About half-way through the project, I come up to you and say:

&gt; What?? You’re using AI to do your work? Aren’t you supposed to be a software engineer? How is vibe-coding “real work”? Anyone can do that! **Cringe**.

What do you do?[^2]

If you feel like using AI to help you with your work is like “cheating”, then it means that you care more about doing the work yourself than the end result of getting the work done.

You’re giving yourself bonus points for working hard, but, um, why? Why are you making things harder then they should be? There is nothing virtuous about it. There’s nothing noble about working hard purely to show that you’re working hard.

In this case, you should ask yourself: what is my goal here, _really_? What am I trying to achieve? Does it matter more _how_ I achieve it or _that_ I achieve it?

If you are emotionally attached to the code you write, you love your code, you feel better when you write your own code because you’re putting in more effort and working harder, then you’re more focused on the process of programming than the end result, the product itself.[^3]

(Simple test: If I gave you a magic wand that could build the entire project _exactly_ how you would in 1/10th of the time, would you use it?)

If you think that software engineering is about programming by yourself, then you might even look down on others who use AI to code. In the heat of the moment, you might pledge to never use AI because vibe-coding is for losers and you’re better than that.

But at the end of the day, you have to ask: what’s the point of it all?

In most cases, the final outcome matters more than how you got there.

And by not using the tools available out of pure spite or a superiority complex, you might just be making it harder for yourself.

Maybe a politer way to put this would be: **it’s easy to judge people and call them “cringe” for doing things in ways that you wouldn’t do, it’s much harder to have empathy and put aside your own preferences and see**_**why**_**they’re doing it a certain way, maybe even learn from that**.

The right way, in my humble opinion, to think about this would be: always pick the best tool for the problem at hand. For example, if you think vibe-coding is more effective for a certain project (or even a certain part of the project), do it. If you think it’s going to take you more time debugging the code that AI writes, then don’t use it. In any case, your decision to use a tool or not should be based on whether it helps you do the work better / faster or not, NOT by your feelings towards the tool or what you think it would reflect on you if you used it.[^4]

&gt; As an extreme example, think of how stupid it would be if someone called you out and said you were being lazy - and cringe, of course - for using google instead of going through physical books.

Another example would be if this were a 24-hour hackathon and you decided you were not going to use any AI tools because they are for losers. Yeah, sure, good for you, but do you think this is the most effective way to do things if your goal is to win a hackathon?

More importantly, if another team wins the hackathon and you found that they used AI (or even vibe-coded their entire project), are you going to call them out for that? If so, then you weren’t trying to win in the first place! You cared more about not doing things you found cringe than winning.

This same idea can be found in almost every domain.

Let me give a personal example.

Since my first year of university, I used to find the word “networking” ultra-cringe. I always thought of it as shallow and transactional, and a sign of duplicitous behaviour. I had the picture of a typical founder-bro in my head, who would go to networking events and try to make connections for his own benefit.

But ~3 months ago, I was attending a talk and heard the speaker say “personal relationships are key”. Somehow, I found myself much more receptive to this framing.

Instead of immediately dismissing the idea, I thought about it and realised that:

obviously, knowing the right people can help a lot - so personal relationships and connections can definitely help. i.e., it is clearly useful.

networking isn’t inherently duplicitous - the intent is pretty clear to both parties and it can be mutually beneficial if you find a win-win arrangement

I realized that my real issue was never with networking, but with people who had hidden agendas and ulterior motives on their mind while forming connections - and the two were not synonymous.

It was a big pretty moment for me as I overthrew / revised this belief…

To be clear, I don’t mean to say that you should do literally whatever it takes to win. There is such a thing as right and wrong. _And winning the right way is as important as winning itself._

But very often, **“cringe” just means that you find it uncomfortable, not that it’s useless.** Recognize this. And think from first-principles instead. Why do you find it cringe? Do you think it’s going to help you achieve your goals? If so, does it even matter if it is cringe or not? Or, are you just afraid to step outside your comfort zone and using this label as an excuse?

[^1]: astute readers might want to include the &quot;cost of hard work&quot; in this equation too, in which case, there is probably some threshold X such that if P(world FW) &lt; X then it does not remain rationally viable to continue working hard.

[^2]: of course, if your goal is to practice programming and software engineering, then yeah you might be better off doing the work yourself, without any help from AI, but let&apos;s assume that&apos;s not the case here. You&apos;re just trying to do the project.

[^3]: sure, if you&apos;re doing it for the love of programming and you have no deadline whatsoever, go ahead and do it.

[^4]: In fact maybe you shouldn&apos;t have any feelings towards tools…??</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>The Digital World in 2025</title><link>https://devanshshah.dev//posts/the-digital-world-in-2025/</link><guid isPermaLink="true">https://devanshshah.dev//posts/the-digital-world-in-2025/</guid><pubDate>Mon, 04 Aug 2025 00:00:00 GMT</pubDate><content:encoded>**1.**

A few weeks ago, I was having a discussion with someone (let&apos;s call him Bob) about AI safety and how I felt there wasn&apos;t enough being done in the area, at least relative to the magnitude of the problem we were facing and the consequences if we failed to align AI.[^1]

I said:[^2]

&gt; I know that some people are working on the problem actively but it seems to me that 1) the amount of resources being funnelled into alignment research is off by a few orders of magnitude right now (roughly ~100x), and 2) I&apos;m not sure why more people aren&apos;t feeling the same way and talking about it publicly, as compared to talking about latest AI developments in models and research.

And Bob said:

&gt; I don&apos;t agree with (2) at all. I hear and see so many people complaining about the threat of AI all the time on the internet. You ever think that the problem is just the kind of content _you_ consume?

I didn&apos;t realise how strong and generally applicable his point was until an hour later when I was replaying this in my head.

I had generalised from &quot;the people _I_ hear about on the internet&quot; to &quot;everyone in the world&quot; without a second thought. This might&apos;ve worked until ~15 years ago, before the age of recommendation systems.

Today, the amount of content available on the internet is beyond our wildest imaginations. Instagram has more than 1 billion reels, Youtube has more than 5 billion videos, Twitter[^3] has ~500 million tweets posted every single day. Yeah, crazy, I know.

And so naturally, the content that reaches our eyes and ears has been filtered many many times. We see a teeny-tiny fraction of what&apos;s out there on the Internet.

More importantly, we aren&apos;t actively choosing what we see on any of these platforms. It&apos;s all dictated by recommendation algorithms that somehow &quot;know&quot; what we want to watch / read. (More on this later.)

This leads to a equally astronomical selection bias in the content we consume.

To put it more precisely, from all the content that is out there, we are not observing samples that are chosen uniformly at random (if we did, then we would actually have a pretty holistic understanding of what everyone on the internet is consuming too, in the long-run and on average).

_We don&apos;t see things on the internet uniformly at random._

Instead, we are only exposed to a very _very_ small fraction of the content-space that is out there.

To use the example of Twitter: if you read ~1000 tweets today, that&apos;s 0.0002% of the total number of tweets posted today.

So, you&apos;re only observing 0.0002 % of the content and drawing inferences about everyone on twitter based on that. Huh.

And this fraction of content that you&apos;re consuming is drawn from a mathematically different distribution than the content I&apos;m consuming. I say _mathematically_ because the inputs to the recommendation system that decides what to show us are actually different numbers. (Tl;dr: The algorithm that shows you content has certain parameters and these parameters are different for each user, which causes the content we see to be different from each other.)

Everyone is seeing slightly different slices of this content-space. That is, the inputs that shape people&apos;s opinions and beliefs can be drastically different. And as a result, people&apos;s opinions and beliefs will be naturally drastically different.[^4]

Huh. Who would&apos;ve thought this would lead to any disagreements in what people think is &quot;out there&quot; on the internet?

All this to say that we&apos;re living in our own digital worlds. Your digital world is probably very different from mine. And since we both use this digital information to infer things about the world, _I can&apos;t assume that we share a common understanding of what&apos;s going on the world anymore._

Even news suffers from this same problem. Though we live in a shared physical world, the information about this shared physical world (aka news) we hear can be very different from each other. I might not even hear about a hurricane on the other side of the planet. I might know more about AI advancements than ongoing wars.

And so we end up giving importance to the things that have our attention, not the other way around. (If you hear about X and watch about X often enough, you&apos;re bound to give it more importance.) I&apos;m sure you can think of examples of this for yourself.

I think the best way to regain a solid understanding of reality, of what people actually believe / what&apos;s happening in the world is to rely on surveys, studies, reports, and polls done on the ground. There may be biases in them too, but at least we understand them and can correct for them far better than we can correct for the anecdotal &quot;oh i see this all the time on social media but how much of this is just because my feed favours such content and not because many people actually believe this&quot;.

As a simple example: if you see opinions for and against a given technology / policy / any topic in your feed in the ratio 9 : 1, does that mean that people, in general, are 9 : 1 in favour of the technology / policy / any topic?? How much should you even discount by? Is it 5 : 1? Or 1 : 1? Or, god forbid, 1 : 9???[^5]

It&apos;s impossible to know if you just rely on anecdotal evidence, because these numbers depend on the outputs of a recommendation system that is tailored to you specifically.

A less consequential but equally telling example: you might see a meme or a pop-culture reference based on recent events all over your feed and naturally think that this is &quot;all over the internet&quot; (when it&apos;s really just all over _your_ feed), and then be extremely surprised to find out that someone living right beside you has never heard of it.

It&apos;s hard to know you&apos;re living inside a bubble if that&apos;s your whole world.

But when someone points out that you&apos;re actually in a bubble, it can make for some really interesting conversations. And assuming it is actually a bubble, for the first time, you get to see the bubble from the outside.

**2.**

A few months ago, I stumbled upon this video of a candidate running for Mayor of NYC — Zohran Mamdani. It was the first time I&apos;d ever heard his name. It was the first I was ever hearing concrete news about mayoral elections in US at all — like, I know in theory that they happen but I usually don&apos;t keep up with them because there are more important things to keep up with.

It showed him as the voice of the middle class, the people&apos;s man, fighting against the rich and elite, by crowdsourcing funding for his election campaign. I was quite intrigued by this and watched it to the end.

Since then, for the next 2-3 weeks, I would see him appear on my feed almost every day.

Now, here&apos;s what&apos;s interesting: I don&apos;t live in US, let alone NYC. I can&apos;t vote to affect the outcome of the election. I know nothing about the other candidates&apos; policies other than what&apos;s mentioned in Mamdani&apos;s videos. I know just enough about Mamdani&apos;s policies (e.g. tax the rich, but not too much so they don&apos;t flee) to think they sound reasonable.

In short, 100% of my information about the NYC mayoral elections were from an obviously biased source — Mamdani himself. (I&apos;m not blaming him for being biased — it&apos;s his job to fight the election by showcasing his strengths and highlighting the flaws in his opponents!)

Yet, in an embarrassing moment of weakness, I felt something inside me supporting him. I felt like he was better than the other candidates.

I hadn&apos;t even given the other candidates a chance before coming to this conclusion. I had only heard their names from Mamdani&apos;s mouth, never even seen their faces. Even if I were going to decide on who to vote for based on pure charisma, I hadn&apos;t even seen the charisma of the other candidates before deciding!

In short, I had formed a belief based on completely biased information, even after knowing full well that the source of information is biased.

I had gone from a neutral stance to supporting one side, without ever waiting to hear from the other side.

And I wasn&apos;t alone in this. I checked the comments section to see that many people outside of US had heard of Mamdani for the first time through Instagram and began strongly supporting him without having any other source of information than Mamdani&apos;s own account.

Our default mode is to believe, not question. And social media doesn&apos;t just repeat our own beliefs back to us (i.e., it&apos;s not just an echo-chamber) but it also creates / plants new beliefs.

What does this all of this mean for politics and democracy?

Elections are going to be won on social media now, through social media campaigns, not through rallies in a stadium and long speeches that people don&apos;t have the attention span for. This was probably was a major factor even in the 2024 US elections too. (Do you remember the number of reels and memes you saw about a certain candidate who slipped down stairs, forgot what he was saying mid-sentence, got lost while walking around, rambled on for a minute without making any sense? Or was it just me? Maybe someone should do a poll on who has seen a certain meme so that we know the _actual proportion of people that have seen it_, because once you&apos;ve seen it, for some reason you assume everyone else has seen it too and knows what reference you&apos;re talking about.)

As more and more Gen-Zs start to become adults and vote, the importance of social media as a means to persuade and convince will increase. And it&apos;ll have to be in a form that appeals to minds have spent their entire adolescence watching TikTok or Instagram reels: short, catchy, attention-grabbing.

Long-drawn arguments and debates over policy will be too boring for most people to care about. We already live in a world where people watch a movie on TV and scroll through their feed on their phone at the same time, because just one isn&apos;t enough stimulus.

And in this scenario, when election results comes down to whoever gets the most views / attention on social media, the world turns into high school again and politics becomes a popularity contest. Not popularity of ideas and policies but just popularity in general. Politics becomes marketing. And in a world like that, The Algorithm becomes the king-maker.

There are real implications for the world as people spend more time on social media, and their attention span get shorter. It&apos;s not some abstract problem we face in the far-away future. It&apos;s already here.

**3.**

A couple of years ago, I observed that social media (specifically Instagram) was eroding my ability to think critically, to focus on things, to be thoughtful and nuanced, my attention span, my memory. Essentially, it was just lowering my cognitive abilities in general.

As a university student, I couldn&apos;t afford to not have Instagram because all my friends were there and it was how I stayed in touch with what was going on in people&apos;s lives. And the problem was not in looking at my friends&apos; posts and stories — that was, in fact, the whole point of Instagram (at least, to me).

The problem was that &lt; 5% of my time was actually spent on seeing what my friends were up to on Instagram. The rest was spent on watching random reels about the most random things on earth. It could barely be called &quot;entertainment&quot; in the usual sense but it did give me short-term gratification, the instant dopamine hit. (Social media was becoming less and less about the &quot;social&quot;, and more and more about the &quot;media&quot; and &quot;para-social&quot;)

And it was literally rotting my brain. The fact that such content is called &quot;brainrot&quot; is for good reason! It&apos;s like having a &quot;smoking is injurious to health&quot; label on cigarette packs. It&apos;s telling you exactly what&apos;s going to happen if you do it, and people do it nevertheless.

I sent a friend of mine a 40-second reel and he replied with &quot;omg why is this so long??

Even so, I naively thought the problem was with the kind of content I was consuming. So, I decided to try and &quot;curate&quot; my feed on Instagram. For a few days, I consciously and wilfully skipped brainrot reels and only liked / saved the stuff I actually wanted to want to watch.

Liking / saving / sharing / commenting were the only levers I could pull to control what I would watch in the future. It was the only way to tell The Almighty Algorithm my preferences and interests and pray that it would understand and listen to me. It was like trying to dig a tunnel through a mountain with a pickaxe and praying that the Dragon in the mountain would get out of your way when you asked it to. I just didn&apos;t have enough leverage to control things about my own feed.

Also, it probably takes into account what your friends are watching too (the hypothesis is that your friends and you probably have similar tastes and interests so it makes sense to show you stuff your friends have liked), which is out of your control. Maybe it takes the average of the model parameters of your 5 &quot;closest&quot; friends (based on how many reels you share with each other) as a feature? In that sense, maybe the adage &quot;you are the average of the 5 people you spend the most time with&quot; is true in a very real, and somewhat uncanny, sense.

Maybe this is something that other people _like_ about social media — that they can just sit back, relax and let the algorithm decide for you. I get the appeal. I get that it&apos;s easier. I get that this is meant as a form of relaxation and so people don&apos;t want to have to think much about it.

But if I&apos;m being honest, I don&apos;t find it particularly relaxing. I don&apos;t enjoy doomscrolling. I don&apos;t enjoy the feeling _after_ spending 30 mins scrolling through reels and not remembering anything. I didn&apos;t get anything out of it, not even happiness. I feel like i just wasted precious time.

Back to the story: even then, after all this effort, every now and then I would see the most random videos on my feed. It was The Algorithm&apos;s way of asking &quot;okay yes yes I know you only like videos about XYZ but do you also like 10-second clips of bloopers of a TV show made 20 years ago? c&apos;mon man you won&apos;t know unless you try it out? right? right?? right????&quot;

And since willpower is a limited resource, I inevitably used to suffer a relapse every few days and fall back into doomscrolling. It&apos;s hard to win when The Algorithm is working against you all the time.[^6]

The key epiphany I had was when I realised that the problem was not the kind of content I was consuming, but the _form_ of content. It&apos;s not what you&apos;re doomscrolling, it&apos;s _that_ you&apos;re doomscrolling. (So, trying to curate a good feed on an app designed for short-form content doesn&apos;t solve much.)

The problem is (the normalisation of) short-form content and overstimulation as a whole.

(As a corollary to this, I don&apos;t believe that those &quot;micro-learning&quot; apps where you scroll curated &quot;useful&quot; stuff like quotes from books or educational videos instead of brainrot content are any better. It&apos;s still going to impact your brain the same way and you aren&apos;t going to remember what you read / watched anyway.)

I now view doomscrolling roughly as the digital equivalent of smoking. Everyone knows its bad for them in the long-run but sometimes people can&apos;t help themselves.

To be clear, I don&apos;t think all social media is bad and technology is evil and we should go back and live in caves and start farming. Quite the opposite.

For example, I like that Youtube offers the option to turn off all recommendations by turning off the watch history. Which is exactly what I&apos;ve done. (And to me, youtube doesn&apos;t classify as short-form content — I&apos;m not talking about youtube shorts — most videos I watch are ~20-30 minutes long.)

I want to choose for myself what I think is better for me (or worth giving importance too) rather than giving up that agency to The Algorithm. So, I subscribe to the creators whose videos I enjoy and then just watch videos from the subscriptions tab.

As a result, all my time on Youtube is spent watching the things I genuinely am interested in, and it doesn&apos;t try as to try and lure me into watching something else that I know is a waste of time that I&apos;ll regret immediately after.

Entertainment[^7] without feeling guilty afterwards?? Yeah, it&apos;s possible.

**4.**

A few months ago, when Veo 3 (an AI model that can generate short realistic clips) launched, I came up with the natural business idea:

1. People watch all kinds of brainrot on the Internet, particularly in the form of short videos (aka reels).
2. Veo 3 can be used to generate more short-form brainrot at a much quicker pace, somewhat indistinguishable from human-generated brainrot.
3. I can use Veo 3 to create brainrot and post it online (anonymously, of course) and monetize the views and likes.

I also instantly realised that many other people would be thinking the same thing. Didn&apos;t matter because I could differentiate myself by picking a niche I was interested in — e.g. math / tech — and semi-brainrot-semi-useful ai-generated videos.

Something stopped me before I posted the first video.

Would I be proud of this? Would this make the world a better place or worse?

If I genuinely believed that doomscrolling is bad (which I did), then I was preying on people who were already &quot;addicted to&quot; doomscrolling and making money off them (it is their time and attention that I would indirectly monetize). Or, phrased less dramatically, making the internet a worse place in general by contributing to the problem.

I could&apos;ve rationalised it by saying &quot;oh I&apos;m just serving a market need&quot; or &quot;someone is going to do it anyway, so it might as well be me&quot;. But deep down, I knew it wasn&apos;t right.

I knew there were better ways to make money that actually added real value to the world, even using this same technology of AI video generation.

And so, I didn&apos;t do it.

What I instead did was spend that time (aka this summer) learning. I started reading more books, watching some online lecture series on youtube, and studying textbooks For the first time in forever, I actually bought physical textbooks!.

I genuinely enjoyed spending my time re-learning things I&apos;d learned in university, but this time much more in-depth and internalising them. I finally understood _why_ things were a certain way, not just that they were.

A friend told me:

it must be an amazing feeling to be learning full-time

and damn, he was so right!

[^1]: I&apos;m an AI-optimist _and_ also pro-&quot;investing-heavily-in-ai-safety-research&quot;.

[^2]: And the reason I remember this argument so well is because I wrote it down immediately after it happened, because I realised what a blunder I had made.

[^3]: Sorry I just find it very weird to say &quot;X&quot; with a straight face because then what&apos;s the Musk-era-equivalent of &quot;tweet&quot;?

[^4]: And of course AI is going to make this much much more significant - you might see videos / tweets / images on our feed that were created specifically for you, tailor-made to your existing beliefs and worldview, to maximize your chances of being persuaded of some opinion / belief! No, it&apos;s not all bad! The same AI can also be used to create custom videos - made specifically for you again! - to explain concepts to you in a way that makes the most sense to you. AI, like any other technology, can be used in many ways - some good, some bad.

[^5]: Or more rarely, it might even be the case that it is 20 : 1 in your favour even though your feed only shows you 9 : 1.

[^6]: I now know of several other &quot;retro&quot; social media apps that try to solve this exact problem (i.e., they are about the social aspect of it). But adoption rates are slow, and this is to be expected since they&apos;re trying to go against basic human nature (and also, network effects of course). Instagram / TikTok / YouTube / Twitter still rule the digital media world.

[^7]: Uhhh full disclosure: maybeee what I watch might not count as entertainment in the traditional sense, but it&apos;s more of &quot;edutainment&quot;. To give you a sense, my subscription list is: 3B1B, Veritasium, Y-Combinator, Ted, Dwarkesh Patel, Ted-ed, … you get the idea.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>The one with the commencement speech</title><link>https://devanshshah.dev//posts/the-one-with-the-commencement-speech/</link><guid isPermaLink="true">https://devanshshah.dev//posts/the-one-with-the-commencement-speech/</guid><description>Or, my graduation experience.</description><pubDate>Sun, 13 Jul 2025 00:00:00 GMT</pubDate><content:encoded>Yesterday was a big day for me: I graduated from NUS (National University of Singapore) with a bachelor’s degree in computer science.

But what made this milestone even more special was that I was the valedictorian, which means I had the honour of delivering deliver the “valedictory address” (aka commencement speech).

To give some more context on why this meant so much to me:

1. NUS School of Computing is [#4](https://www.topuniversities.com/university-subject-rankings/computer-science-information-systems) in the world for Computer Science.
2. My cohort had ~1000 students.
3. Only 1-2 students get this opportunity to be valedictorian.

Needless to say, I was simultaneously extremely excited and extremely nervous.

Nervous because although I’m pretty extroverted and like talking to people, speaking in front of ~1500 people felt like a completely different ball game [^1]. And especially because I knew that this was a big moment for the audience too — professors, parents, and graduates — who would all be listening intently.

So, I had prepared my speech a few weeks in advance, got it approved by the university, and was even practising it everyday in a large (but empty) hall for a week leading up to this day.

And finally, the day arrived and the ceremony began.

They started by presenting the degree scrolls to the graduating class, consisting of Bachelor’s, Masters and PhD students.

After collecting my degree, I was guided through a separate door and was seated in the front row, where I watched the rest of the ceremony.

After ~40 mins, the last student collected their degree, and [Prof. Kan Min Yen](https://www.comp.nus.edu.sg/~kanmy/) walked over to the podium to introduce me:

&lt;video width=&quot;900&quot; height=&quot;600&quot; controls playsinline&gt;
    &lt;source src=&quot;https://imgur.com/a/YeKZhH6.mp4&quot; type=&quot;video/mp4&quot;&gt;
    Your browser does not support the video tag.
&lt;/video&gt;

Then, I walked up on stage, bowed to the presiding officer and the academic procession, and delivered my speech:

---

Good morning. Professor Tulika Mitra, Dean (School of Computing) and Vice Provost (Special Projects); Mr. Chris Feng, President, Sea Ltd; Distinguished Guests, Fellow Graduates, Ladies and Gentlemen.

It is an incredible honor to stand before you as this year’s valedictorian... though I have to admit, I’m more nervous now than I’ve ever been before any exam. But more than anything, I feel deeply grateful. Grateful to be speaking not just for myself, but on behalf of the graduating class of 2025 – to try and put into words what this moment means, and to thank the people who helped us get here.

To our professors, thank you for teaching us with such passion, for patiently answering our endless questions, for challenging us to think deeper, and for inspiring in us that same energy and dedication.

To our families, thank you for your love, your patience, the constant emotional support, and for listening to us rant about LLMs hallucinating at the dinner table, even when it made absolutely no sense to you.

We wouldn’t be here without you and of course, your constant reminders to go outside and touch grass.

And to my fellow incredibly hard-working, probably sleep-deprived, peers: we pushed through broken code, wild deadlines, the chaos of group projects, and a lot of caffeine. We finally made it!

Today, we’re here not just to celebrate a degree, but everything it took to earn it. And more than the skills we learned, there’s one thing that carried us through it all: curiosity.

When we first arrived at NUS, we did not know much. But we wanted to. We wondered how programs worked. How websites load. Why restarting our laptops fixes half the problems. We followed that curiosity, even when it led us down rabbit holes of 3-hour long YouTube videos and 10-year-old Stack-Overflow posts – all of which made us feel more lost than before.

It was that same curiosity — obsessively excited, childlike and at times, naively optimistic – that kept us up during hackathons, kept us debugging segmentation faults at 2am, and kept convincing us that fixing that one bug would “only take 5 minutes”.

At some point or the other, many of us felt like imposters. Like everyone else knew more than us and had it all figured out. But here’s the truth: it’s not about having the answers, it’s about being willing to ask the questions. It’s about saying, “I don’t know – but tell me about it”. This readiness to admit you don’t know something combined with the curiosity to learn more can be extremely empowering.

As we graduate, we’re entering a world that is changing at an unprecedented rate. Tools that we learned might be replaced next year – or even next month. What was considered state of the art last week might already be outdated next week. AI is rewriting the rules, reshaping industries, and in an ironic turn of events, threatening to do to us what we once proudly did to others: automate jobs.

And, in a world like this, curiosity is not just a trait – it’s a survival skill. And if we can hold on to that spirit – that playful, fearless, sense of wonder – then we’ll not only adapt to the future, _we’ll shape it_.

So, to the class of 2025: Stay curious. Ask questions. Be bold enough to be a beginner again and again. Let yourself be optimistic, even wildly obsessed, with the things that may not make sense to anyone else, yet. Because that’s how the best ideas are born. That’s how the best lives are built.

So, go out there and stay wonderfully, stubbornly curious.

---

So yeah that was it.

While the whole experience of giving this speech felt surreal, a few moments stand out in my memory.

(1) When the audience broke into an applause during my speech:

&lt;video width=&quot;900&quot; height=&quot;600&quot; controls playsinline&gt;
    &lt;source src=&quot;https://imgur.com/R3UJ6C0.mp4&quot; type=&quot;video/mp4&quot;&gt;
    Your browser does not support the video tag.
&lt;/video&gt;

(2) I felt particularly happy while delivering the last paragraph of the speech:

&lt;video width=&quot;900&quot; height=&quot;600&quot; controls playsinline&gt;
    &lt;source src=&quot;https://imgur.com/ZgSHF4e.mp4&quot; type=&quot;video/mp4&quot;&gt;
    Your browser does not support the video tag.
&lt;/video&gt;

Some other random thoughts I had during this ceremony:

I finally realised what [Barney Stinson](https://en.wikipedia.org/wiki/Barney_Stinson) meant when he said: “whatever you do in this life, it’s not legendary unless your friends are there to see it”. Well, in this case, family and friends, but the point still holds. It meant so much to me that the people close to me were there to celebrate this special occasion with me. Without them, I don’t think it would’ve been as meaningful to me.

I’m so happy that podiums are opaque because if they were transparent, everyone would be able to see my legs literally shaking in nervousness.

I think I did “okay” re my speech delivery, in the sense that it could’ve been a lot better (e.g. i fumbled a few times and my voice was shaking a bit especially in the beginning) but it also could’ve been a lot worse (e.g. i could’ve forgotten my speech entirely, my mind could’ve gone blank and i would be standing there speechless, literally.). So, overall, I’m okay with this outcome.

Oh, and it turns out the PhD valedictorian (Ayush Mishra) and I:

1. went to the same high school — though he graduated 7 years before me.
2. were family friends — his dad and my mum were colleagues, and his sister and my brother were in the same batch in school
3. worked with the same professor in NUS — though he worked for ~7 years and I for ~1 year.

It’s indeed a small world.

Finally, if you want to watch the video of the entire speech, you can find it [on youtube here](https://youtu.be/yVt6SyC2jbg?feature=shared&amp;t=7250).

If you’re graduating / just graduated, happy graduation to you too!! 🎉

[^1]: also its very different from teaching a class as a TA because there, you’re regarded as the “expert” + you know your stuff + they’re there to learn from you you, but here, it’s like you’re talking to your peers so there’s no inherent reason for them to even be listening to you. it’s a very different dynamic.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Deep Dive into LLMs like ChatGPT</title><link>https://devanshshah.dev//posts/deep-dive-into-llms-like-chatgpt/</link><guid isPermaLink="true">https://devanshshah.dev//posts/deep-dive-into-llms-like-chatgpt/</guid><description>Or, how should we be thinking about LLMs?</description><pubDate>Wed, 11 Jun 2025 00:00:00 GMT</pubDate><content:encoded>A couple of days back, I watched this 3.5 hour-long [video](https://www.youtube.com/watch?v=7xTGNNLPyMI&amp;ab_channel=AndrejKarpathy) by Andrej Karpathy (ex-OpenAI founding member, ex-Tesla senior director of AI) titled &quot;Deep Dive into LLMs like ChatGPT&quot;, and it provided some of the best insights about AI and **how we should be thinking about these models**.

I think the latter is underrated because it&apos;s possible to &quot;know&quot; how LLMs work but still not know how we should be thinking about them (e.g. the right mental models to have about them), so it&apos;s definitely super helpful to have one of the leading researchers in this field share his perspectives on this.

And since knowing the internals of the system makes you a better user of it, [this video](https://www.youtube.com/watch?v=7xTGNNLPyMI&amp;ab_channel=AndrejKarpathy) will definitely make you more effective with AI tools.

Anyway, here are my notes from the video:

## Step 1: Pre-training

**&quot;Download&quot; and pre-process the internet**

(1) Gather an enormous quantity of high-quality text documents covering a wide range of topics.

(2) E.g. [FineWeb](https://huggingface.co/datasets/HuggingFaceFW/fineweb) dataset

**Tokenisation and Byte-Pair Encoding (BPE)**

(3) We don&apos;t train our models on raw text. Instead, we convert them into a 1-dimensional array of **tokens**. A token is just a small chunk of characters.

(4) BPE is the algorithm that creates these tokens from the huge dataset of gathered documents. It repeatedly merges the most frequent pairs of existing tokens (starts off as individual letters) into new tokens.

(5) This process builds a **vocabulary** of tokens — each token has a unique ID (a number) which represents it. The model works with these token IDs now, not the actual characters or text.

(6) E.g. the phrase &quot;good morning&quot; is broken down into 2 tokens — &quot;good&quot; and &quot; morning&quot;, which have token IDs 30744 and 7709 respectively (for the tokeniser used by gpt-4o).

(7) A token need not be a full word. e.g. &quot;fantastic&quot; is broken down into 2 tokens: &quot;fant&quot; and &quot;astic&quot;.

(8) You can play around with tokenisers [here](https://tiktokenizer.vercel.app/).

(9) But why do we tokenise? It&apos;s a trade-off between sequence length and vocabulary size. The longer the sequence of tokens we need to generate, the more computationally expensive it is. But we also want enough frequency of tokens so that training on them can uncover reliable statistical patterns that capture linguistic structure. ChatGPT uses a vocabulary of ~100k tokens

## Step 2: Base Model Training

(1) The goal of this step is to learn statistical patterns of language — i.e., which token is most likely to come next?

(2) We train a neural network on windows of tokens up to a maximum length (called the **context size**) and ask the model to predict the next token (token ID). In particular, the input is a list of at most context_size tokens to the model and the output is a probability distribution over all possible tokens (the vocabulary).

(3) Since we know the &quot;true&quot; next token from the training data (i.e., our data is labelled with the ground truth value automatically!), we can compute the loss and update the model&apos;s weights.

(4) At the end, we get a model which has learnt certain linguistic patterns and is very good at predicting the next token. Kind of like a &quot;glorified autocomplete&quot;.

(5) But base models by themselves don&apos;t understand questions, answers, conversations, or tasks. They don&apos;t know that their job is to answer your questions. They will just use your prompt as a starting point and keep predicting the next token (until you tell them to stop). They are not &quot;helpful assistants&quot; yet. (So, almost all the LLMs you interact with online — ChatGPT, Claude, etc. — are more than just base models.)

(6) They are also prone to **regurgitation** (memorizing and repeating from training data) and **hallucination** (the model just taking its best guess in a probabilistic manner). This is because they&apos;re just sampling which token to output from some probability distribution which they have learnt during training. They don&apos;t know whether it&apos;s going to be factually correct or not. Remember: they are literally just predicting the next token.

(7) Yet, they can be made surprisingly capable with a technique called **few-shot prompting**. Basically, we can provide examples of how we&apos;d like the model to behave in the prompt itself, and the model can &quot;learn in context&quot; without changing any of its weights. We don&apos;t really understand how it works, but it does improve response-quality a lot.

(8) E.g. Simply asking &quot;What is 2 + 2?&quot; might lead the AI to not even answer the question (it often goes on philosophical rants and continues by asking more such questions). But if the prompt is:&quot;You are a helpful assistant.Human: What&apos;s the capital of France?AI: ParisHuman: What is 2 + 2?AI:&quot;then empirically, the model answers the question (which is what we want) more often.

## Step 3: Post-training (Supervised Fine-Tuning)

(1) We want the model to be an assistant, not just a glorified autocomplete.

(2) So, we fine-tune the base model by training it on human-written conversations. This just means that we use the base model as the initial starting point, and use the same algorithm to train the model on this curated dataset of Q&amp;A examples.

(3) In addition to the normal vocabulary, this step introduces special tokens whose purpose is to provide structure to the conversation — e.g. whose turn is it? when to stop responding? etc. OpenAI uses tokens such as &lt;|im_start|&gt; and &lt;|im_end|&gt; for this purpose.

(4) This curated dataset of conversations is crafted by expert labellers - their goal is not just to answer questions, but to demonstrate how an ideal assistant should behave.

(5) This improves the model from just predicting the next token based on all knowledge of the vast internet to trying to predict the ideal response by such an expert labeller[^1]. This is how we should be thinking about the difference between base models and SFT models.

(6) Of course, it doesn&apos;t completely forget all the knowledge it learnt in its pre-training phase too — the entire knowledge of the internet is condensed by the model into some hundreds of billions of weights (parameters).

(7) So, by training on this dataset of high-quality, human-crafted conversations, the model becomes skilled at imitating helpful, safe and informed behaviour.

## Interlude: Hallucinations and Tool Use

**Hallucinations**

(1) Why do LLMs hallucinate in the first place? Because all the conversations in the SFT stage include proper answers by human experts. They don&apos;t include answers like &quot;i don&apos;t know&quot; (because of how the dataset was constructed, by asking experts to write ideal responses in conversations). So, the model learns to imitate this by adopting a confident tone (just like an expert) and hallucinates when it doesn&apos;t know the answer.

(2) Even though the internals of the neural network (some subset of neurons) &quot;know&quot; that the model doesn&apos;t know the answer, it doesn&apos;t know how to say &quot;i don&apos;t know&quot; because it&apos;s never been encouraged to do so!

(3) Hence, the fix is pretty obvious: add more examples where the correct answer is &quot;i don&apos;t know&quot;! But how do we find questions to which the &quot;correct&quot; answer is &quot;idk&quot;? We can use another model to generate factual questions based on some text it finds online (LLMs are very good at this) and tests (they&apos;re also very good at this) whether this model gets it correct or wrong — you can ask the same question multiple times to make sure the AI is reliable / sure of it&apos;s answer or just guessing too. Then, explicitly add these questions with the answer &quot;i don&apos;t know&quot; in the dataset, and train the model on this updated conversations dataset.

(4) Basically, by showing the model that it&apos;s okay to answer &quot;i don&apos;t know&quot;, the model learns to be less confident when it doesn&apos;t know the answer.

(5) By doing this, hallucination in models has drastically reduced.

**Tool Use**

(6) Instead of just mitigating hallucinations in cases where it doesn&apos;t know the answer, we can do better! When a human doesn&apos;t know something, we don&apos;t just say &quot;i don&apos;t know&quot; — we can also search the internet to find the answer. Why not let models do the same?

(7) The billions of weights of the model are just like a vague recollection of whatever the model has seen during its pre-training stage on the internet. It might remember some things correctly, get some things wrong, etc.

(8) But by allowing the model to search the web, you can refresh its memory with working memory to trigger those parts of the neural network that store that information that it had possibly learnt during pre-training. The context window is directly fed into the model as inputs, not as weights, so it&apos;s much more powerful in turning the knobs on the model&apos;s responses.

(9) Weights are like vague recollections, not always impactful on the output. Inputs are concrete, factual, and definitely taken into account while producing the output.

(10) But how can the LLM call tools and search the web? Well, the model is trained to generate tokens so the natural solution is to let it emit special tokens that ask the process running it to search the web for it[^2] (and pass the results to the model&apos;s context window, where it can use it directly when it resumes generating the output).

(11) E.g. the LLM can output &lt;search_start&gt;Who is the current President of USA?&lt;search_end&gt; to tell the process running it to search the web with this query if it doesn&apos;t have sufficient information to answer the question directly.

(12) How does the LLM learn that it can do this? Again, the way to train models to emit such special tokens (just as we did for conversations with &lt;|im_start|&gt; and &lt;|im_end|&gt;) is to include such conversations in the post-training dataset. For questions the model doesn&apos;t know the correct answer to, the ideal response (which is crafted by experts) would be to use search tools.

(13) As it trains on such conversations, it learns that when it doesn&apos;t know, it is encouraged to emit these search tokens, which then provide the relevant information directly inside the model&apos;s context window and help it generate the right answer[^3].

(14) We don&apos;t have to stop at search tools — the same idea can be used to allow the model to fetch data from some database, or from some documents, etc.

(15) Lesson: the way we&apos;re teaching these models is just by example.

(16) Takeaway: If you show examples of what you want to achieve in the context window (through few-shot prompting, or providing all the necessary information), the model is going to do a lot better than if you just expect it to retrieve it from the vague recollection from its pre-training phase (where it literally had to learn everything on the internet) aka its weights. Knowledge in the tokens of the context window is part of its working memory

## Models need tokens to think

(1) LLMs can only do a fixed amount of computation per token. A model is just a large mathematical expression that generates the next token. And there is a limit on how much computation this large mathematical expression can do.

(2) So, you cannot expect models to solve logic / math / reasoning problems in few tokens. It&apos;s fundamentally not possible.

(3) To solve hard problems, it helps to ask the model to think step-by-step such that each step is small enough that it can solve correctly. And by the end, it has all the necessary intermediate results in its context window that it can reach the final answer.

(4) So, for datasets involving reasoning models, the ideal expert answer should not just give the answer directly without any explanation (the model can&apos;t do so much computation in one token so its bound to fail at test-time!). We want the model to get into the &quot;habit&quot; of producing all the intermediate steps to arrive at the answer, because that&apos;s what turns out to be useful during inference. We want to distribute computation across many tokens and slowly arrive at the answer.

(5) This hypothesis can be proven empirically: if you ask the model to &quot;answer in a single token&quot; it gets many math / logic problems wrong vs. if you don&apos;t constrain the models with the number of tokens.

(6) Another way to get better answers for math / logic problems is to ask the model to write code. Models are very good at writing code but not very good at doing math computation. So, it can write code (emit special tokens for start of code and end of code) and then the process running the model can run this code and give the result back to the model (in its context window). Then, we don&apos;t have to rely on the model to do the calculations! It can just write the code, you can verify the steps yourself too, and let the python interpreter run the code and perform the actual arithmetic. Needless to say, code is far more reliable and deterministic for math than an LLM that predicts the next token.

(7) Similarly, models are bad at counting characters in a word — remember, they don&apos;t see words, they only see tokens (which might be chunks of a word)! And they&apos;re very bad with spelling as a result too. But they can copy-paste correctly and write code correctly. So, you can ask the model to &quot;use code&quot; for all these adversarial examples and it still gets it correct, because it relies on the code for the actual numeric operations / string manipulations, etc.

## Step 4: Reinforcement Learning Fine-Tuning

(1) Note: Not all models need to go through this step. Only &quot;reasoning&quot; models.

(2) Why do even need reinforcement learning if we already have supervised fine-tuning? Consider an analogy of students learning from a textbook:

   (a) Pre-training is like reading expository chapters — it gives general background knowledge, but no specific questions are solved.

   (b) Supervised Fine-Tuning (SFT) is like studying worked-out examples — you learn from expert solutions to problems.

   (c) Reinforcement Learning (RL) is like practicing with exercises where only the final answer is provided — you&apos;re forced to figure out how to get there on your own.

(3) This third stage is especially important for reasoning models, which must solve complex, multi-step problems in areas like math, logic, and science — not just provide factual answers.

(4) In SFT, the model learns to imitate expert demonstrations, but imitation only goes so far. RL allows the model to explore its own strategies to reach the correct answer.

(5) Humans don&apos;t always know the &quot;best&quot; way to explain or solve a problem from the model&apos;s perspective. What&apos;s simple for us may be inefficient for the model, and vice versa. So, for complex domains like reasoning and math, we often don&apos;t know how to annotate the data effectively. Instead, it&apos;s more powerful to let the model discover the most effective token sequences for solving problems.

(6) Basically, we&apos;re not in a good position to create these optimal token sequences for the LLM to learn problem-solving from because we don&apos;t know how big or small a single step should be / how best to break the problem down from a model&apos;s perspective. It&apos;s useful for models to learn to imitate experts as a means to initialise the system but at the end of the day, we really want the LLM to discover the token sequences that work best for itself. It needs to figure out what token sequences reliably get to the answer, given the prompt (because that&apos;s how they&apos;re going to be used by real users, not given the exact steps of reasoning to follow!). We&apos;re training them to think for themselves.

(7) How RL actually works? The model is given a question (prompt) and asked to generate many possible responses — often thousands. These outputs vary due to the model&apos;s stochastic nature. Some will be correct, some won&apos;t. Among these, we select the best answers (e.g., shortest correct answer), and add them to the training set. The model is now learning from its own generated data, rather than human annotations. More precisely, it&apos;s learning from it&apos;s best attempts at problem-solving (and internalising the patterns / problem-solving techniques that help it reach the correct answer).

(8) Okay, but if RL is so powerful, why bother with SFT at all? Because without SFT, the model would be completely lost at the start — like a student trying to solve problems with no idea what a solution even looks like. SFT bootstraps the model, placing it in the rough vicinity of correct solutions, so RL can then refine and personalise (figure out what works for itself) those strategies.

(9) Also, pre-training and SFT are well-established areas at this point. It is RL that is nascent and it&apos;s what enabled the latest boom in reasoning abilities of AI models.

(10) The output model after RL is not just imitating human experts. It can be coming up with completely novel ways of solving a problem, ones that it discovered for itself and thought would lead to the correct answer.

## Case study: DeepSeek R1

(1) Through RL, DeepSeek R1 learned to:

   (a) Try multiple ideas.

   (b) Evaluate which one might work.

   (c) Backtrack when stuck.

   (d) Try again — much like how humans approach tough problems.

(2) This exploratory behaviour was not explicitly taught or hardcoded — it&apos;s an **emergent property**. No one told the model to try different strategies; it _learned_ (during RL) that doing so improved its chances of getting the correct answer.

(3) This is why reasoning models often require more tokens: they are running complex internal simulations, juggling different strategies. What you see in DeepSeek&apos;s &quot;thinking&quot; section is the model&apos;s actual cognitive process, which is then distilled into a human-readable explanation. The model&apos;s thoughts can be messy — full of detours, false starts, and revisions. The final answer is cleaned up for presentation purposes (but all the &quot;reasoning&quot; is done in the &quot;thinking&quot; section). This strategy of explicitly working through reasoning steps is known as chain-of-thought prompting, and it naturally emerges from RL training.

(4) OpenAI doesn&apos;t show these full reasoning paths in its web UI — likely due to **distillation risk**. Other teams could scrape these outputs and train their own reasoning models by imitation.

(5) Even though reasoning models are so amazing for, well, reasoning tasks you don&apos;t need a reasoning model for factual queries (e.g., &quot;When was Einstein born?&quot;) — a simpler, SFT-only model will suffice.

(6) If you only train on expert games, your model is limited to their strategies. You hit a ceiling. But RL lets models explore and discover new strategies, even ones no human has ever considered. AlphaGo demonstrated the full power of RL: it didn&apos;t just match expert Go players — it surpassed them. E.g. the infamous [move 37](https://www.youtube.com/watch?v=HT-UZkiOLv8).

(7) We&apos;re hoping that LLMs will eventually do the same — the equivalent of move 37 but in the broader, more general domain of problem-solving. Maybe it comes up with its own language that is easier to think in or whatever. In any case, we don&apos;t care how it arrives at the right answer (or in this case, a good solution) as long as it does. If it works, it works — even if we (mere mortals) can&apos;t comprehend why it should work.

## Finale: Reinforcement Learning with Human Feedback (RLHF)

(1) So far, we&apos;ve focused on reinforcement learning in domains where answers are clearly right or wrong (e.g., math, logic). But what about writing a joke, or summarising a news article, or offering advice? In these cases, there&apos;s no definitive &quot;correct&quot; answer — so we can&apos;t just check if the model was right. And it&apos;s also very hard to give scores for these kinds of things. Most importantly, RL is extremely labour-intensive!

(2) Imagine you had to score every model output manually:

   1000 update steps × 1000 rollouts per prompt × 1000 prompts = 1 billion human judgments.

(3) This isn&apos;t scalable. So we use RLHF to drastically reduce the human labor.

(4) How RLHF Works:

   (a) Collect 5 model responses for each of 1000 prompts.

   (b) Ask humans to rank them from best to worst. (5000 human scores total — way more manageable.)

   (c) Train a &quot;reward model&quot; — a neural net that simulates human preferences.

   (d) Now run RL, but let the model optimise against the reward model instead of real humans.

(5) This (in my opinion brilliant!) trick using **indirection** replaces the costly human evaluation with a learned proxy[^4]. And RLHF also works great because:

   (a) Humans are better at ranking than giving precise scores. And we almost always don&apos;t need exact scores — just the relative order.

   (b) This lets us do RL in previously impossible domains, like writing, art, and conversation — areas where generation is hard, but ranking is easier. It&apos;s much harder to generate an &quot;expert&quot; or &quot;ideal&quot; joke, but much easier to compare 2 jokes and say which one is better. Andrej calls this the &quot;discriminator-generator gap&quot; because it&apos;s easier to discriminate between samples than actually generate the samples.

(6) But RLHF has a downside: the reward model is only a lossy approximation of human preferences. RL can discover ways to game this reward model — creating responses that fool it into assigning high scores, even if humans would find them nonsensical.

(7) For example: if the reward model learns that &quot;the&quot; appears more in good jokes, the model might eventually start generating jokes like:&quot;the the the the the…&quot;— which scores highly for the reward model, but not for people.

(8) These are called **adversarial examples**, and the more RL you run, the more the model might exploit such weaknesses in the reward model.

(9) So, in unverifiable domains, RLHF has a ceiling. Run it too long, and the model starts optimising for the proxy instead of real human preference. In verifiable domains (math, logic), this isn&apos;t a problem — there&apos;s a definitive correct answer which cannot be &quot;fooled&quot;!

[^1]: Of course it still does this generation token by token but now it&apos;s trying to imitate an expert human response to a question or in a conversation.

[^2]: This is such a beautiful and elegant design decision, I love it. When it comes to LLMs, &quot;everything is a token&quot;: conversations, tools, etc.

[^3]: In particular, the model doesn&apos;t need to know what &quot;search&quot; is! It just has to emit that token ID — and we could&apos;ve named that token anything, it doesn&apos;t matter. The model doesn&apos;t KNOW it&apos;s &quot;searching the web&quot;. This is so cool!

[^4]: Which reminds me of a quote: &quot;All problems in computer science can be solved with another level of indirection.&quot; by David Wheeler.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>What I learnt from building a RAG chatbot</title><link>https://devanshshah.dev//posts/what-i-learnt-from-building-a-rag-chatbot/</link><guid isPermaLink="true">https://devanshshah.dev//posts/what-i-learnt-from-building-a-rag-chatbot/</guid><description>Or, is it even possible to learn anything while using AI to code?</description><pubDate>Sun, 08 Jun 2025 00:00:00 GMT</pubDate><content:encoded>7 months ago, I [wrote](https://www.devanshshah.dev/posts/learning-vs-getting-things-done):

&gt; Broadly speaking, there are two kinds of modes you&apos;re operating under: &quot;learning&quot; mode, and &quot;getting things done&quot; mode. And these modes are not mutually exclusive. In fact, one of the best ways to learn something is to just get your hands dirty and do it. The best way to learn how to code is to code. The best way to learn how to write is to write.

![Learning vs. Getting Things Done](../../../public/images/blog/learning-gtd-modes.webp)

&gt; …
&gt; It&apos;s much more tempting to just get help to solve your problem, rather than get help to learn the concepts better.
&gt;
&gt; But if you choose to, you can use AI to accelerate your learning at a faster pace than was ever possible before. You have a personalised tutor available 24/7 to help you understand better. All you have to do is ask. Instead of asking it to solve your problems, ask it to explain the concepts involved. And then have the self-discipline to actually try to achieve mastery of those concepts.
&gt;
&gt; If you were in primary school learning basic arithmetic, and you had a calculator, you could do two things: 1) cheat using the calculator in the exam (assume it&apos;s invisible so you won&apos;t get caught), or 2) use the calculator as a personal grader and practise questions without relying on someone else.
&gt;
&gt; Right now, each of us has this calculator. And if we use it right, we can develop our skills, deepen our understanding, and develop true knowledge, without depending on anyone else. If not, we&apos;ll wind up completely dependent on the calculators, praying that the battery doesn&apos;t run out, or that we don&apos;t ever have to solve anything involving geometry / integration / (something that can&apos;t be solved using a calculator).
&gt;
&gt; The choice is ours.

The tl;dr was that you can either use AI to just get your things done, or to help you get better, and it&apos;s important we&apos;re intentional about the choice we make.

I used this same advice myself while I was building a RAG chatbot for my blogs a few days ago.

### Context

I was building this purely for fun, out of curiosity to learn how to integrate LLMs via an API into a full-stack project. I had no deadline and no pressure to &quot;achieve&quot; anything through this project. And I also had a lot of time on my hands[^1].

I also knew nothing about any RAG-specific tools before I started — though I knew the &quot;theory&quot; of RAG, embeddings, LLMs, etc. That is, I had no clue how to get started _building_ a RAG chatbot.

### Process of Building and Learning

As much as I love vibe-coding, I didn&apos;t want to just vibe-code my way through this because I knew I wouldn&apos;t learn anything if I did that[^2].

But of course I still wanted to use AI to help me in my process.

So, first I used ChatGPT deep research to help me &quot;generate the high-level plan on how to design and build a system to create a RAG chatbot for my blogs, on my personal website which is built in using astro, hosted on … and please find tools with a generous free tier&quot;.

And it came up with a fantastic 6-step plan on what I&apos;d have to do!

Next, even though I used Cursor to code, I read through each line it wrote. It got some things wrong the first time (e.g. the chat interface did not have a light/dark theme) and I asked it to fix it. It&apos;s not vibe-coding if you&apos;re carefully reviewing the code, tweaking things before approving it and testing if things work as expected.

And most importantly, for each term, concept, or code that I did not understand, I would ask ChatGPT to explain it in detail. And I would keep asking clarifying questions till I understood it 100%. Sometimes, it wasn&apos;t giving me enough detail so I just went straight the official docs and read the relevant section myself.  Sometimes, I thought of a different way of doing things and asked it whether that made more sense to implement.

For example:

[AI]: Here is the SQL code for creating the table to insert the embeddings of your chunks and the IVF_FLAT to search for nearest neighbours efficiently

[Me]: I don&apos;t get why we need to store both &quot;post_url&quot; and &quot;slug&quot; since one can be derived from the other?

[AI]: Oh yes, you&apos;re right. Let me correct…

[Me]: Also, what does the lists parameter do in the index? What is a reasonable value to set it to?

[AI]: &lt;Explains&gt;

[Me]: Also how does exactly the index help improve the query for nearest neighbours? What&apos;s the algorithm?

Basically, you can afford to ask very basic questions, look foolish in front of AI and it&apos;s still not going to judge you for it![^3]

And I think that&apos;s the key: constantly asking questions if you&apos;re not sure about something. To get a very deep understanding of the topics you&apos;re interested in.

Why? **Because knowing the internals of a system also makes you a better user of it.**

Knowing the internals of how RAG works makes me a better user of similar RAG chatbots too.

I know the kinds of questions it&apos;s going to be able to answer and the kinds it&apos;s not. It&apos;s good for questions that will have a specific answer in some paragraphs of text. It&apos;s NOT good for generic questions that need a lot of information at once.

I know that I need to use the right keywords in my question to generate the &quot;right&quot; query embedding so that it can find the relevant passages / information from the text. If I know the title of the blog I want to query, including that in the question would definitely help too.

For example, asking a specific question about a recent blog I wrote gives a pretty decent answer:

![Probabilistic Decision Making RAG chatbot](../../../public/images/blog/rag-chatbot/pdm-chatbot.webp)

But asking a question like this:

![Number of Blogs RAG chatbot](../../../public/images/blog/rag-chatbot/num-blogs-chatbot.webp)

gives a pretty… stupid answer? From an average user&apos;s point of view, the chatbot clearly has access to the blogs (it even quoted some of them in the answer!), and it just needs to count how many blogs were written between 2 dates. It should be trivial to answer! right… ?

Unfortunately, &quot;raw&quot;[^4] RAG cannot answer this because it doesn&apos;t send all the blogs to the LLM that generates the response — that would be too huge of a context! It only sends the chunks of text (read: paragraphs) that it thinks are most relevant to the question. And mostly, the number of chunks added to the context of the LLM are limited to some fixed number (I used 10). So, even if I&apos;ve written &gt; 10 blogs, the LLM that generates the answer only gets chunks from at most 10 unique blogs and it knows nothing about the others.[^5]

(If you want to come up with more adversarial questions, feel free to play around with my chatbot [here](https://devanshshah.dev/blog)!)

Lastly, through building this simple chatbot, I found that **AI Engineering is 90% traditional software engineering** — APIs, databases, frontend, deployment — **and only 10% AI-specific stuff** — chunking, embeddings, tweaking model params, etc.

So I think unless you&apos;re working on the model directly, most of the work is probably going to be to write glue code (normal software engineering stuff) that connects AI to the different parts of the system. Because at the end of the day, an LLM will just be an API call.

**Final Remarks**

It&apos;s been a long time since I built something where I was a complete beginner[^6]. And honestly, this felt amazing. I had forgotten how refreshing it is to not know what you&apos;re doing and to figure things out along the way. How peaceful it feels to explore without expectations, and to learn just for the sake of learning.

It felt fun. Playful. Pure. It reminded me of why I got into tech in the first place.

So if you&apos;re learning something new right now, I genuinely hope you&apos;re _really_ enjoying it. There&apos;s real joy in being a beginner!

[^1]: I had just returned from a 5-day trip traveling Munich + Garmisch, I was tired and did not want to leave my house for a couple of days so this was the perfect mini project to take up.

[^2]: And that&apos;s why context is important! If my goal was to ship something by a deadline, learning would be a secondary goal and getting it done would be the primary goal.

[^3]: Use temporary chats if you&apos;re really worried that OpenAI will hold such conversations against you when applying for a job there xd

[^4]: My guess is that all SOTA models have much more complex interactions that decide what additional &quot;tools&quot; to call based on the query - and in this case, they would simply call the &quot;query_database&quot; tool and write a simple SQL query to obtain the necessary info and then answer the question based on that.

[^5]: I&apos;ve no clue how it determined that the upper bound is 20 though — probably just made it up?

[^6]: I felt this way when I studied business law last semester too — though I don&apos;t think it&apos;s the same because I wasn&apos;t actively creating / building anything using that new knowledge. This is what makes tech special: you can actually build stuff using what you learn _immediately_!</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Probabilistic Decision Making</title><link>https://devanshshah.dev//posts/probabilistic-decision-making/</link><guid isPermaLink="true">https://devanshshah.dev//posts/probabilistic-decision-making/</guid><description>Or, life is like poker.</description><pubDate>Wed, 28 May 2025 00:00:00 GMT</pubDate><content:encoded>The world has some inherent uncertainty / randomness / luck factor, whatever you want to call it.

And we often abuse this fact:

1. Whenever something bad happens to us, it&apos;s because of bad luck. Whenever something bad happens to others, it&apos;s because they screwed up and made bad decisions.
2. Whenever something good happens to us, it&apos;s because we worked hard for it. Whenever something good happens to others, it&apos;s because of good luck and not skill.

You see the double standards, right?

This is because we&apos;re not accepting the role of uncertainty and randomness in the world fully yet. And because of this, **the way we evaluate decisions is wrong.**

We&apos;ve been evaluating decisions as if we were playing a game of chess — where there is no uncertainty, and the decision and outcome are perfectly related. A good move (decision) is by definition one that leads to a better position (outcome). Unambiguously.

But that&apos;s simply not true in the real world. The correlation between decisions and their outcomes is not perfect — there is some randomness in between. You can make a good decision and still have a bad outcome. And you can make a bad decision and still have a good outcome.

An extreme example: Imagine it&apos;s 2019. You have a wheel with the top 1000 US companies&apos; names on it. You&apos;re going to spin it and then invest all your savings into that one company. It happens to land on Nvidia, and yayyy you become a zillionaire by 2025. Does this mean your decision (to spin the wheel and invest all your money into a single randomly chosen company) was good?? ... No?

**A decision is not good or bad based on the outcome it produces.**

More generally, any information that comes to light after the decision was made cannot be used to justify the decision. You did not know that when you made the decision so how it can be a valid reason for making the decision!

In that sense, life is more like poker than chess. You have incomplete, and often even imperfect, information while making decisions. You don&apos;t know the cards your opponents are holding, you don&apos;t know what the cards on the table are going to be.

In fact, life has more dimensions of uncertainty than poker — in poker, you can calculate the exact odds your cards have of winning[^1] but in life, it&apos;s hard to even estimate the probabilities of outcomes. &quot;What&apos;s the probability of X happening&quot; is a very very tough question where X is some event in the real world — and there are many prediction markets (e.g. [Polymarket](https://polymarket.com/), [Kalshi](https://kalshi.com/), etc.) for you to test your skills if you feel confident in making accurate forecasts.

(That&apos;s why there&apos;s no GTO (Game Theory Optimal) calculator for life[^2] like there is for poker.)

But this does not mean all decisions are equally good or bad. Even though we cannot judge the quality of a decision solely based on its outcome, we can judge them by the process of arriving at the decision itself.

High-quality decisions are the ones which carefully **consider the possible choices** and the **outcomes they might cause**, and then **pick the best-suited one**.

Abstractly, this means:

1. You have some **utility function** that you&apos;re trying to maximize. e.g. pleasure, success, meaning, work-life balance, productivity, whatever, some combination of everything you desire. You can choose this for yourself[^3]. Importantly, each person can have a different utility function. Someone might be more risk-averse and care about minimising the damage / losses in the worst-case scenario. Someone else might be risk-seeking, and want to maximize their best-case scenario only. Another might only care about the average result (aka expected value). It&apos;s really up to you. You don&apos;t need a mathematical formula for this. You just have to know what&apos;s important to you and your priorities and preferences.
2. You have a bunch of actions / choices in front of you and you need to pick from that. It&apos;s always helpful to take some time to enumerate all the possible things you can do because many times, you might miss out on some non-obvious ones. For example, if you&apos;re given a job offer, at first glance, you might think that your only options are to either accept or reject. But in reality, you can also 1) negotiate the terms, 2) ask for more time so you can get another offer to negotiate from a better position, 3) ... By not even considering these possible actions, you might be making suboptimal decisions.
3. For each action, there is an outcome. Well, there is actually an &quot;outcome distribution&quot; — this is where the uncertainty of the world kicks in. You can make a decision but that doesn&apos;t mean the outcome is going to be exactly what you thought it would be. There is some distribution of possible outcomes with attached probabilities. For example, if you decide to start reading a book — maybe with 50% probability you will like it, with 30% you will find it &quot;meh&quot; but still finish it, and with 20% you will find it so dull and boring that you give it up halfway. Just because you decide to read the book doesn&apos;t mean you&apos;re going to like it. It sounds super common-sensical when I say it like this but I&apos;ve seen this kind of thinking patterns many times in all sorts of contexts.
4. Estimating the outcome distribution is probably the hardest part of this process. And it only comes from having an objective and accurate understanding of reality. By detaching yourself from what you want to be true, to look at what is true. By trying to remove any biases in your thinking as a result of wishful thinking (to prevent &quot;copium&quot;). By seeing reality as is, without distorting it to fit your narrative. By _really_ being open-minded about the world. In fact, by seeking opposing views to balance your own so you gain a holistic understanding of the situation.

   The dangers of not being objective here are enormous. If you continue to live in your own bubble of beliefs and stories, you&apos;re going to come up with a terribly skewed outcome distribution — which means your view of the future is going to be wrong, and you&apos;re going to make bad decisions.

    It&apos;s really important to try to be as objective as possible here. And I think the antidote to wishful thinking is a combination of self-awareness + humility + curiosity. Just the willingness to take the effort to know what&apos;s real (while differentiating this from your own opinions).

    In this step, it&apos;s also extremely useful to assign confidence levels to each of the decisions and outcomes. How confident are you of your own construction of the outcome distribution? This will dictate how strongly you feel about your decision, and when new information comes to light, you can update this confidence and adapt your views and maybe even change your decision if needed.It&apos;s perfectly okay to be less confident in some decisions than others. What&apos;s more important is avoiding overconfidence — being wrong and confident is worse than just being wrong.

5. Finally, every action you take, **every decision you make is a bet** that you think taking that action / decision will increase the value of this utility function the most among all possible actions that were available to you. So, based on the above analysis, pick the one you think is best suited based on your utility function.

Importantly, you acknowledge that there is some uncertainty in every decision you make. When you decide to do something, knowing full-well the possible outcomes it&apos;s going to have.

One amazing benefit of this kind of thinking is that it&apos;s **regret-free**. What&apos;s there to regret if you know you made the best possible decision given the information you had?

Let&apos;s look at some examples to explain concretely what this means:

**Example: Coin Flip**

I&apos;m feeling generous so I invite you to play a game. I offer you 2 choices:

1. You flip a coin — if it lands heads, I give you \$1M and if it lands tails, you get nothing.
2. You get \$475k guaranteed without doing anything.

Which one would you pick? (Note that the &quot;expected value&quot;[^4] of option 1 is \$500k while that of option 2 is \$475k)

First of all, there&apos;s no &quot;correct&quot; answer. Why? Because it depends on your situation and your utility function! For example:

1. You might pick option 1 if you are already very rich and this amount isn&apos;t going to affect your life much. In that case, your marginal utility for the first \$475k is going to be about the same as that of the next \$525 (and both are going to be small amounts to you). In that case, it might make sense to try to maximize your expected value (i.e., average value) through this game and flip the coin.

   Why? Why should it be rational to maximise your EV in any single game? Why not take the second option and move on?

   Because in a single game, in a single decision, you are worried out the uncertainty and variance. But **life can be viewed as a series of such decisions**. If you always pick the choice with higher EV, you&apos;re going to come up ahead in the long-run (on average) when the variance is dominated in comparison to the total utility.

   An easy way to understand this: If I offered you these 2 choices and said we&apos;d do the one you pick 1000 times, then you would definitely pick option (1) right? Because in the long-run, variance isn&apos;t going to matter much — sometimes in your favor, sometimes against — but your total utility is going to be dictated mostly by the average utility. So, picking option (1) makes sense — why would you throw away \$25k worth of utility?

   Now, even though you won&apos;t be given this exact same bet 1000 times (sorry I&apos;m not that generous), you will definitely be making many such decisions over the course of your lifetime. You can view them all together as a series of decisions.

   So, for _small_ decisions, ones that don&apos;t impact or you ones that you know you will get to do many times in the future, maximising EV (and ignoring variance) is a reasonable strategy. (Remember it only works for small decisions, once where you don&apos;t go broke because of any of them, and you can afford to keep playing!)

   Another reason why you might pick (1) is because you&apos;re in some special situation where you need \$1M only and not a cent less. Say you owe \$1M to some mafia boss who will shoot you if you give him anything less than \$1M. And the money is due tomorrow and you have no other way to source this money. Then, yeah you pick option (1) because it gives you a 50% chance of living (while option (2) is pointless).

   Lastly, you might also pick (1) if you&apos;re risk-neutral (or risk-seeking). You don&apos;t mind the extra bit of uncertainty because you find much more joy in winning \$1M (more specifically, more than 2x) than in winning \$475k. I&apos;ve seen this to be true in some people — they&apos;re more willing to take on bigger risks because the rewards are also much higher (or more precisely, to such people, the rewards seem to compensate enough for the bigger risks). Naturally, such people also tend to be quite ambitious and entrepreneurial.

2. But most people under normal circumstances would probably opt for the guaranteed \$475k. Because 1) you know you&apos;re not going to be offered a choice of this magnitude in the future again, and 2) this kind of money means a lot and would change your life.

   Some things to note here: &quot;But Devansh, isn&apos;t the expected value (EV) of the first option better??&quot; Yes, but your utility function for money probably isn&apos;t linear! The potential loss of not getting anything would be a bigger loss than the marginal gain of an extra $525k. And this is not true because of some complex math or anything — it&apos;s true in life!

   The improvement (with respect to your quality of life and standard of living) is going to materially bigger when you get the first \$475k than the next \$475k (approximately ~\$525k). Law of diminishing marginal utility and whatnot

   I&apos;ve also found this to be true for much simpler things in life — eating half a cookie gives me about the same joy as eating a full cookie (with half the calories and sugar intake and half the cost!). Of course, then it makes rational sense to always only eat half-cookies rather than full cookies[^5].

This simple example teaches useful things:

1. Maximising EV isn&apos;t the main goal of making decisions! (I&apos;ll admit, this took me a while to figure out[^6].) It&apos;s to maximize _your_ utility function. And very very often, it makes sense to pay EV in order to reduce variance. That is, you might be better off getting less total utility (even on average) while also reducing your risk / uncertainty.
2. Rational people can see the same situation and act differently. Don&apos;t assume that anyone who doesn&apos;t pick the same option as you is immediately irrational and stupid. People need not have the same preferences as you do and can be in very different situations.

And this example seems contrived but it&apos;s still applicable to many real-world decisions. e.g. Should you accept a job offer at a slightly risky startup that gives you a lower base salary but more equity as compared to a bigger company with a higher base salary?[^7] It&apos;s the same principle — think about the odds of success of the startup (maybe even break it down into many different level of success), see the difference in EV, and finally pick the one that fits your &quot;risk profile&quot; (utility function) the best.

**Example: Going to a Party**

Caution: If you do this kind of thinking every time you&apos;re invited to a party, you might see the number of invitations you get dwindling over time. Use at your own risk!

Suppose you&apos;re invited to an impromptu party. You were planning to have a quiet evening and just read by yourself. Should you go or not?

In this case, the possible decisions are easy — either go to the party, or stay at home and read a book.

If you stay at home and read a book, you have no uncertainty — you know exactly how the night is going to turn out to be. You will have a good time and you&apos;ll learn something new — and as knowledge compounds, you&apos;ll be getting smarter in the long run if you consistently make this choice.

But there&apos;s the the feeling of FOMO you might get depending on how amazing the party turns out to be, which you will definitely see on Instagram stories. What if turns out to be the best night ever and all your friends talk about this night for decades to come? Can you afford to miss it? (This is what I call FOMO-driven thinking, something I admit I do occasionally.)

If you go for the party, think of the possible outcome distributions. Maybe it&apos;s not accurate to say &quot;worst case scenario&quot; here but the 5th percentile scenario (only 5% of scenarios are worse than this) would be that the party was absolutely boring. And in most of the average cases, the party would be fun and you&apos;ll have a great time. Finally, in the 95th and above percentile scenario lies our FOMO — when the party turns out to be so spectacular that it you feel stupid for not going to it.

(All these numbers are very pretty much arbitrary — _just assigning a number to something out of thin air doesn&apos;t mean you suddenly know it better or have more information_. Don&apos;t get bogged down by them. It&apos;s just useful as an exercise to quantify things approximately so you can think about them concretely.)

Now, if your utility function is purely driven by the desire to chase the best-case scenario, then you&apos;ll end up always going to the party. And if you are too risk-averse and you think there&apos;s always a chance that it might end up very boring (or into something that you don&apos;t enjoy), then you would never go.

Maybe it&apos;s also useful to consider how often you&apos;ll get to make this decision? Is this a once-in-a-lifetime kind of thing (e.g. your friends are planning to backpack across Europe after graduating from university) or a normal routine party that happens every month or so?

In any case, a utility function that minimises regret is, to me, perfectly reasonable. (In fact, if you can say &quot;I&apos;m going to make this decision and I&apos;m not going to regret it no matter what happens in the future&quot; that already means you know a lot more about your own priorities and goals than most people.). **Follow the path of least regret.**

Suppose you know you have to work hard and study on the same night your friends are going out for a party (because you have an exam the next day), ask yourself: which one would you regret more — going to the party and doing poorly in the exam, or doing well in the exam and missing the party.

This comes back to your utility function too, in particular the temporal discounting you choose to apply: **how much do you discount the future relative to the present**? How much does 1 unit of happiness in the future mean to you today? Would you be willing to sacrifice 1 unit of happiness for 2 units of happiness tomorrow?

Since it&apos;s hard to talk in terms of units of happiness, I&apos;m going to use money as an example:

- If you had to work very hard (12 hours a day, every day) for the next 1 year and then you would be given as much as money as you need in your lifetime to live a comfortable life, wouldn&apos;t you do it?

- But if I change it to, you had to work for 20 years in order to get that money, then you wouldn&apos;t be as sure, right? Because although the remainder of your life is a long time, that is in the distant future.

Many people do things they don&apos;t like because they know it&apos;s &quot;worth it in the long-run&quot;. E.g. If exercising for 30 mins only gave you 30 mins of &quot;extra life&quot; at the end, no one would be exercising. Those 30 mins are worth more to you today than at the end of your life. So, what&apos;s the point? It&apos;s like moving your healthy years to the back of your life. But if exercising for 30 mins increases your lifespan by a day, then it seems like a good deal, right?

Generally speaking, those who set a lower discount factor, i.e., those who care about their future self almost as much as their present self, end up taking a longer-term view and naturally end up ahead in the long-run. **Delaying gratification is often a requirement for achieving longer-term goals.**

Linking this back to our original example: If you&apos;re someone who is ambitious or disciplined (basically, willing to sacrifice some amount of pleasure in the present to eventually end up better off), then staying at home and studying or reading a book (or whatever other productive activity you&apos;re doing) can feel more useful to you, since your utility function does value the future-you&apos;s happiness and betterment too quite a lot too. So, this does affect how you make decisions in your day-to-day too.

It&apos;s a cliche, but still true: &quot;discipline weighs ounces, regret weighs tons&quot;. But this can be interpreted in one of two ways — is it the future regret of being worse off by choosing to enjoy the present at the cost of your future? Or... is it the regret of not enjoying your present enough (i.e., not going to the party)?

Of course, the intended interpretation is the former, since most people would feel more regret (albeit in the future) over a worse off future than over missing a single party. But my point is that it need not be true for every person. Depends on how amazing the party was, I guess.

In any case, the more general concept of **picking the decision which minimises total regret** holds true (though what actual decision that might be varies from person to person). I specify &quot;total&quot; regret because you can&apos;t just look at the immediate regret you feel (because then you would always just pick the easy, more fun option), but the future regret that this decision&apos;s consequences might cause too (which is often the dominant factor).

**Example: Betting on a Stock**

(Not financial advice!) If you were an undergraduate studying computer science with a specialisation in AI, and you knew a lot about AI, one of the best ways to make money might be to find up-and-coming AI companies and bet on them by buying their stocks.

Suppose you find company M.AI[^8] has just gone public. There might be a lot of analysts looking at their financials and stuff, but you think you know more because you understand their technology better than those &quot;finance guys&quot;. What should you do?

Assuming you&apos;ve done your due diligence and are confident that their stock will be worth more in the future, what&apos;s now important is to make this more concrete.

1. How much do you think their stock should be worth (aka fair value)? What&apos;s your confidence on this?

2. How long do you think the market is going to take to get there? What&apos;s your estimate of the trajectory of the stock in a month? 3 months? A year?

Say it&apos;s at \$1.5 right now. Come up with a distribution of where you think the stock is going to be 3 months from now. e.g. 10% chance that the stock falls to \$0.0, 20% chance that it is \$1-2, 30% for \$2-5, 10% that it goes up to \$5-6, 30% that it goes to \$6+.

&lt;figure&gt;

![Probabilistic Decision Making](/images/blog/probabilistic-decision-making.webp)

&lt;figcaption&gt;Note: This is just an example of what you might come up with as your predicted distribution of the stock price in 3 months. It helps you quantify your qualitative prediction of &quot;oh this stock will go up&quot; and analyze it more rigorously + accurately.&lt;/figcaption&gt;

&lt;/figure&gt;

Then, think about your confidence level on this distribution itself. Like, how close to accurate this distribution do you think this is?

With all this in mind, size your bet accordingly. The higher your confidence and the more the expected return (based on the distribution), the more you should be willing to bet.

Say you end up buying \$5000 worth of this stock.

Now imagine it&apos;s 1 year later. Because of some unexpected geopolitical crisis , the entire AI market crashed and your stock went to \$0.00 with it. You couldn&apos;t have seen this coming (or even if you did, you probably thought the chances of this crisis were like 1%).

Was buying this stock still a good decision? Yes! It just didn&apos;t turn out in your favour.

**Evaluating your own decisions**

Having learnt this, one common trap people fall back on is continuing to blame their bad decisions on bad luck — &quot;oh I thought about it very carefully and I was 75% sure it was going to work out, but because of bad luck, it didn&apos;t&quot;. And now you can even justify it better by showing some random numbers you used while deciding which action to take. So, there&apos;s a higher risk of being out of touch with reality and deluding yourself — a risk that you have to be constantly paranoid about, if you&apos;re at all interested in understanding the world and making better decisions.

Remember, **this process doesn&apos;t eliminate any uncertainty in the world**. It just gives you a better way to deal with it.

So, yes, there are still a lot of ways you can make bad decisions even while following this framework:

1. Having bad estimates of the future outcome distributions of actions.
2. Having bad estimates for your confidence in decisions.

The way to fix both is to close the feedback loop after you make the decision. Use the consequences to update your mental models of reality and your own confidence in them. Like, it&apos;s all just bayesian thinking. Look at each piece of new evidence, your current level of confidence, and keep updating it based on how much weight you want to give to this piece of evidence. Again, you don&apos;t have to actually do the math — rough approximations are good enough in most cases.

Let me give you some objective ways to evaluate your own decisions and estimates using basic statistics:

1. If you make 20 decisions in which you were 75% confident, you should expect ~15 of them to work out. If only 5 of them work out, chances are it&apos;s not bad luck, it&apos;s overconfidence.
2. If you are swinging your confidence levels in outcomes back and forth too much, chances are that you&apos;re being overconfident again and giving too much weight to the new pieces of evidence. If you say you are 90% confident about X, and then you suddenly shift to 20% confidence when something happens, you must ask yourself: Was this new information in my original 10%? Or was I overly confident about my 90% and it should actually have been more like 50%? (Because if this happens too much, clearly your initial estimate of 90% can&apos;t have been right — by definition, if you&apos;re 90% confident about 10 things, you must be end up being right about ~9 times. So, if you change from 90% to 10% about half the times, then you weren&apos;t ever at 90% to begin with.)

My recommendation? Write down each decision and the corresponding confidence level you have (remember: each decision is a bet, so how confident are you in the bet?). And then once the outcome materialises, you know whether your bet paid off or not. Use this information to figure out how well you&apos;re doing. Again: it&apos;s much better to be wrong for a decision in which you were 60% confident as compared to one where you were 95% confident[^9].

[^1]: against an opponent&apos;s range

[^2]: inb4 AGI comes up with a GTO calculator for life and says &quot;sorry what were you saying?&quot;

[^3]: to the extent you an control what you want out of life

[^4]: how much you can expect to gain in the long-run if you repeat this game many many times

[^5]: pro tip: just invite a friend every time you go eat a cookie or a waffle or a cake and split it

[^6]: especially because in most math games and puzzles I would solve, the objective was to always maximise EV

[^7]: im NOT saying that this is the only thing you should focus on while deciding which job to pick — of course, the mission of the company, the work culture, the work-life balance, blah blah, also matter (and probably more so than purely the monetary compensation).

[^8]: i normally use X for my variable names, but here unfortunately, using X.AI might give the wrong idea that i&apos;m referring to a certain real company

[^9]: This kind of loss / penalty function — that penalises bering wrong with higher confidence more — is precisely what is used while training regression ML models (and is called log-loss). On the flip side, don&apos;t use this as an excuse to never be confident in your decisions! You can&apos;t put everything as 50% to avoid big penalties! Being confident and right is good is better than being unsure and right too. If you put 50% for 10 decisions, and you turn out to be right about 8 of them, then your actual confidence should have been closer to 80% (more precisely, the average confidence level across the 10 decisions should&apos;ve been ~80%).</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>The Current State of Technical Interviews</title><link>https://devanshshah.dev//posts/current-state-of-technical-interviews/</link><guid isPermaLink="true">https://devanshshah.dev//posts/current-state-of-technical-interviews/</guid><description>A commentary on the hiring process for tech roles.</description><pubDate>Mon, 31 Mar 2025 00:00:00 GMT</pubDate><content:encoded>## Background

Here&apos;s a quick summary on what&apos;s been happening in the technical interview (in tech) space (skip it if you already know the story and want to jump straight into the commentary):

1. Technical interviews for junior software engineering roles in many companies involve solving &quot;data structures and algorithms&quot; (DSA) problems. The point of this (or at least, in the past) was to assess how well a candidate could apply algorithmic thinking to solve a problem and explain his / her solution.

2. There&apos;s a platform called &quot;LeetCode&quot; (LC henceforth) which contains 3000+ such problems, which many people use to prepare for such interviews. The premium version also allows you to filter questions by the companies that have asked them in the past. Importantly, LC is not new. It&apos;s been around for almost a decade.

3. A few months ago, 2 students from Columbia University built [InterviewCoder](https://www.interviewcoder.co/) — an AI app that interviewees can use to get solutions + step-by-step reasoning to LC-style questions problem in the interview itself as it goes undetected during screen-sharing. One of them used this during his own interviews for Amazon, Meta, etc. to pass the interviews, and then posted this on social media, which sparked massive debates.

4. Amazon, Meta, Capital One, etc. rescinded their offers when they found out that he had cheated in his interviews. Amazon even told Columbia University to take action against the student, and a few days ago, Columbia suspended him for a year.

5. Initially, the product he had built was free and open-source — free both in terms of cost as well as free to modify (i.e., [gratis as well as libre](https://en.wikipedia.org/wiki/Gratis_versus_libre)). But once the product became viral on social media, he monetized it by making it paid (and also, closed-source), charging $60/month.

![Reset Repository to contain only releases](/images/blog/current-state-of-technical-interviews/reset-repo.webp)

## Commentary

The most common reactions I&apos;ve seen on social media have been (all quotes are taken directly from LinkedIn / X):

1. &quot;He wanted to make a point: these Leetcode, Hackerrank, and Codepen challenges are useless. What we need from a hire is to be a problem solver, not a human GenAI. Of course, we want a coder to know how to code, but we don&apos;t necessarily need to go to crazy lengths to have someone prove their skills.&quot;

2. &quot;Cheating isn&apos;t right, but oh god I am so tired of these stupid algorithm interviews. At this point, with LeetCode company tags, AI being rampant, the effectiveness of algo interviews is questionable.&quot;

3. &quot;I (as an interviewer) am so annoyed by him but (as a candidate) also adore him.&quot;

It seems like many people are hailing him as a hero for standing up against the &quot;broken&quot; system.

I want to dive a little deeper into what _exactly_ is broken here and why I think the current narrative around this is misleading.

### Frustration

I think most people would agree that LC is not a high-signal way to measure a software engineer&apos;s ability to perform at the real job. I know many people who are great engineers but aren&apos;t good at algorithmic problems, and vice-versa. In fact, this is the reason people are supporting him in the first place.

And so, they are frustrated when they have to &quot;grind&quot; LC in order to get a job, especially so when they know that it&apos;s not going to be relevant to their job anyway.

So, there&apos;s this palpable feeling of &quot;we need to change the hiring process!!&quot; in the tech community.

### Why not test &quot;real&quot; skills

The ideal scenario that would be to give a &quot;real&quot; task to the candidate and see how they solve it. It&apos;s the most direct way of assessing how good they would be in their role.

Some examples are:

1. Take-home project to build an application with some specified features

2. An interview where candidates are given a codebase to understand and debug, or add some feature on top of the existing codebase.

But to do either of these requires more effort from both, the company&apos;s side as well as the candidate&apos;s side. It takes longer for the candidate to do the take-home project and for the company to actually read through the project and evaluate it. The same is true for longer interview processes, be it in terms of the number of interviews or the duration of each interview.

From a candidate&apos;s point of view, if they apply to 100 companies and have to do 100 take-home projects (assume conservatively that each only takes 4 hours), that&apos;s 400 hours worth of effort spent! In such a case, maybe candidates will stop doing the project unless they really want to be join the company. Either this can be a self-selecting criteria (if a candidate does the project, they are clearly interested) but it can also backfire (many talented candidates might not want to do the project if it&apos;s going to take them too long).

I&apos;ve noticed that the companies that _really_ want to hire the best talent (generally high-growth startups and quant firms) are willing to put in the effort to make their hiring process as &quot;un-preparable&quot; as possible to extract the most signal. They have more rounds on average, and their questions are less &quot;standard&quot; as compared to other companies.

In particular, even if they do have LC-style interviews, that is never their only source of signal. They often also have other kinds of interviews like:

1. Building an application that makes API calls to fetch some information and then analyzes that information

2. Building simple versions of some games / apps to see if you can structure you code in a nice way

3. Questions on low-level operating-systems and networking concepts

4. System design interviews

I think this has worked out pretty well for them (in the sense that these interviews seem to be high-signal) _precisely because they are among the few companies that have such interviews_. So, there haven&apos;t been many resources created to &quot;prepare&quot; these kind of interviews and candidates haven&apos;t been optimising as much for these kinds of interviews [^1].

Put simply, the tension can be described as follows: from a company&apos;s point of view, an interview gives the highest signal (aka best predictor of success / failure) if the candidate cannot have prepared _specifically for the questions asked in this interview_; from a candidate&apos;s point of view, an interview is easiest to pass if they can prepare well-in-advance specifically for the questions going to be asked.

Why is this so?

The case from the candidate&apos;s point of view is obvious (and is left as an exercise to the reader xD) so let&apos;s talk about the company&apos;s point of view.

When they ask a bunch of questions, they&apos;re not just testing whether you know those exact concepts but also related concepts in the domain. E.g. If they ask you to explain the difference between a clustered index and unclustered index, they don&apos;t just care whether you know the answer to this question but they&apos;re going to use this data point to estimate your knowledge of databases in general. It&apos;s like randomly selecting a sample of questions to ask, and using that to predict the &quot;overall knowledge in a domain&quot;.

When candidates start over-optimising for specific questions / topics asked in interviews, this extrapolation / generalisation no longer works. A company cannot tell the difference between a candidate X who knows databases very well and someone who just learnt the difference between clustered and unclustered index (for the sake of this interview).

![Companies expect the left, but might end up getting the right — someone who knows nothing beyond the questions asked in the interviews.](/images/blog/current-state-of-technical-interviews/gaming-the-system.webp)

Companies expect the left, but might end up getting the right — someone who knows nothing beyond the questions asked in the interviews.

It all boils down to the same thing: the hiring process tests something that is a &quot;compression&quot; of your skills / knowledge, which can easily be measured against other candidates. And this compression is necessarily lossy because of time and effort constraints.

The only way for companies to keep the interviews un-preparable (aka un-grindable) is to keep changing their questions + interview process every now and then. I know of several companies that do this but it does take a lot of effort of planning [^2].

### Why is LC still used?

Full disclosure: I&apos;m part of the group that has solved several hundreds of problems on LC while preparing for interviews, which means you could argue I&apos;m biased towards keeping the current system intact since I&apos;ve spent a lot of effort optimising for it. I&apos;ve tried to correct for this potential bias and be more objective about my reasoning.

To get this out of the way: I think most companies _know_ that LC interviews are not the best way to assess a candidate&apos;s software engineering skills. Yet, they still keep conducting them. Why?

In my opinion, the reasons why they still exist as a metric are:

1. It tests whether the candidate has the right &quot;algorithmic thinking&quot; aptitude. Solving LC questions essentially boils down to a form of pattern-matching on the various data structures / algorithms / approaches, and [I&apos;d argue this is a kind of aptitude or intelligence too.](https://hsnaved.substack.com/p/intelligence-as-pattern-matching)

2. It tests whether the candidate has some basic level of coding skills.

3. It provides a standardised / streamlined way to assess candidates, regardless of their university and specialisations. DSA is taught in nearly all universities across the world so it&apos;s kind of like a &quot;standardised test&quot; to assess candidates without making any other assumptions about the candidate (e.g. they could be specialising in databases or frontend or networking and they&apos;ll all still have learnt this). And there&apos;s also a pretty &quot;standard&quot; way to _assess_ how well a candidate did in such an interview, by looking at the optimality of their solution (i.e., time and space complexity), and how well they communicated their thought-process and solution to the interviewer (slightly more subjective but it&apos;s probably easy to come up with a checklist / rubric for this too).

4. It&apos;s cost-effective and time-effective from the company&apos;s point of view.

I guess the counter-argument is that most software engineers _don&apos;t_ use fancy data structures and algorithms in their day-to-day jobs. They don&apos;t need to know how to invert a binary tree or find an eulerian circuit in a graph to perform their role. I agree.

I think if, as a candidate, you know what domain you&apos;re interested in (e.g. databases, frontend, infrastructure, etc.), and are only applying for those roles, it&apos;s frustrating to have to do LC to land a role which has very little relation to it. You would much rather have role-specific questions and get better in that specific domain.

But if you are a candidate who is applying for internships / junior dev positions in different domains (frontend, backend, infrastructure, etc.) because you&apos;re still not sure what you&apos;re interested in (i.e., still in exploration mode), having LC-style interviews is actually in your favour because instead of preparing for 10 different kinds of interviews for 10 different roles, you only need to get good at LC to pass interviews for any role [^3].

There&apos;s pros and cons on both sides.

This brings us to:

### Goodhart&apos;s law

&gt; When a measure becomes a target, it ceases to be a good measure.

Right now, the measure used by many companies is the ability to solve LC questions. So, it&apos;s natural for candidates to solve many LC problems (aka grind) to prepare and good at it. _This kind of grinding is inevitable in any system where the benefits are worth the effort. It&apos;s not unique to hiring or tech._

(Note: This is not the same as cheating because you&apos;re not doing anything that is not allowed under the rules of the system, and you&apos;re not lying about it. Preparation does not amount to cheating _precisely because it&apos;s done beforehand_, before you even knew what questions you were going to be asked. Exception: if your interviewer asks you if you&apos;ve seen the question before and you lie and say &quot;no&quot;, then it is considered cheating.)

When some companies moved to asking system design questions, tons of resources came up on how to &quot;crack&quot; the system design interviews too.

This law basically means that we will never have a perfect solution to the problem of hiring. _Anything companies start to measure will lose signal as soon as candidates realise that companies measure it._

So, the companies have to figure out what skills are they really looking for.

Maybe it&apos;s worth letting students optimise for building a &quot;portfolio of projects&quot; if it means they learn something relevant in the process? I think so.

Then interviews can be project deep-dive sessions where companies ask candidates to talk about their projects and dig deeper into the technical challenges involved in building it, which tests real understanding. This would require more effort from both sides but it&apos;d definitely improve the quality of the hiring process.

By Goodhart&apos;s law, we can expect tutorials on youtube that guide you through building a project you could talk about to become popular and candidates to specifically create projects for the sake of talking about them in interviews. _If something can be grinded, people will grind for it._

So, this would naturally reduce the signal of such interviews too. The onus would then be on the interviewers to be able to detect whether the candidate really understands something by asking more probing questions. (Well, until someone builds an InterviewCoder-but-for-Project-Deepdives and we&apos;ll have to find a new process all over again.)

To reiterate, I&apos;m not saying that we should _not_ change the interview process. I&apos;m just weighing the costs and benefits, and claiming that it&apos;s going to be hard to come up with a new, scalable process that companies can adopt — one that doesn&apos;t have the same downsides as the current one.

### The Elephant in the Room

Is it, um, &quot;right&quot; — ethically and morally — to cheat in interviews??

You probably already have your own views on this based on your values and philosophical beliefs, and if you disagree with me here (which is perfectly alright btw!), I think it&apos;s unlikely I&apos;m going to be able to change your opinion.

But still, here&apos;s a quick rundown of my take on the ethics of this:

Generally speaking, breaking rules is wrong, but of course there are exceptions. For example, speeding on an empty highway to rush someone to the hospital is still &quot;breaking the rules&quot; but I doubt anyone would argue it&apos;s morally wrong.

Some relevant factors affecting the morality of breaking rules would be:

1. Is there some &quot;injustice&quot; going on that you&apos;re standing up against by breaking the rules?

2. Does this personally benefit you or are you doing it selflessly for the good of others? (That is, what are your intentions behind your actions?)

    Note: &quot;Morality points&quot; are not the same as &quot;utility points&quot;. If a rich man and a poor man both donate $10 to charity, both get the same utility points but the poor man gets more morality points. Similarly, if you do something with the intention to serve your own interest but it ends up having a net positive effect, you get utility points but no moral points.

3. Does it harm anyone? (If so, you need a much stronger reason to justify it.)

In this case, just saying &quot;cheating is bad&quot; is kind of a weak argument. Let me try to strengthen that:

1. It shows a lack of integrity — there is an implied (if not express) agreement that you will not cheat when you take such assessments or interviews.

2. It does cause harm to others — not just the company but to other potentially more qualified candidates who decided not to cheat.

3. I think this is like cheating in any other exam (think: university exams, or admission exams) simply because you think exams are useless and don&apos;t test your real understanding of the topic. You cannot justify cheating because you don&apos;t _want_ to spend time studying for it — that sounds like an excuse for laziness.

4. I think he lost any moral points he had when he monetized the product (for $60/month!!) — his motive shifted from fighting against the system for the greater good, but to profit from it himself. (If it were free and open-source, many more people would use it and so it becomes easier to overthrow the system, if that indeed was his goal).

5. Oh and based on [his recent LinkedIn post](https://www.linkedin.com/posts/roy-lee-goat_i-just-got-kicked-out-of-columbia-for-taking-activity-7310834407433453568-tqAm?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAADOXW3UBEGhPoD4NzqGmySaduJSx-Ra60zU), his intention _from the very beginning_ was always to create a startup and make money. All this was just a means to go viral and promote his product, which worked remarkably well.

    In his own words: &quot;In Fall 2024, I transferred into Columbia as a CS major. I came in knowing I wanted to start a company... So we flipped the usual startup model on its head and decided to just build something we knew would go viral first, focusing on distribution before anything... The plan was to use it ourselves, get offers from top companies, film everything, and ride the shock factor.&quot;

    _Importantly, his primary motivation behind building this was never to change the system but to go viral and make money._ [^4]

6. Lastly, I don&apos;t believe there&apos;s any &quot;unfairness&quot; in the system right now — at best, the argument that can be made is that it&apos;s a _suboptimal_ hiring process, but that does not take away from the _fairness_ of it [^5]. Right now, minus the cheating, everyone has equal opportunity. No one is stopping anyone from solving more LC problems too. And it&apos;s all fair game. It&apos;s within the rules of the game.In my opinion, it&apos;s more important for a process to have integrity and be fair than anything else. I don&apos;t really care what the metric is as long as it&apos;s something mostly within a person&apos;s control (i.e., you can good at it if you work hard enough). In this regard, LC is a fair metric since people can definitely get better at it with practice [^6].

   Can I also just say that being anti-leetcode and still not condoning cheating is a perfectly reasonable stance? Like, being anti-leetcode doesn&apos;t automatically mean you need to support cheating.

Anyway, I think some amount of luck / randomness in the process is inevitable (and should be accepted) due to the sheer scale of hiring for interns / junior positions — for example, factors like how you early you apply, variability in interviewers, variability in questions asked in the interview, etc. do affect the final outcome. So, there will be some people who feel it&apos;s unfair to them purely due to bad luck, and that&apos;s unfortunately the hard truth.

(Tangentially, even though I don&apos;t respect his business model, I have immense respect for the sheer chutzpah and conviction he has to do be doing all this, despite people (myself included) saying it&apos;s not right and Columbia University suspending him. It takes guts, at the very least.)

### Possible Outcomes

Okay, so now what?

What&apos;s going to happen, given that all this drama is taking place in public and companies are aware of the existence of such AI tools being used to cheat in their interviews? This is the part I&apos;m more interested in.

Here&apos;s my rough sense:

1. **In-person interviews**: More and more companies will start to adopt in-person interviews as the final round to prevent cheating. This is already very common in Singapore (since it&apos;s a very small country, it&apos;s reasonable to ask candidates to travel to office for an interview) and I expect the proportion of companies doing this to go up even more.

2. **Tighter filtering criteria**: Right now, many companies don&apos;t care about GPA or which university you go to when hiring for internships. This is because they feel interviews and online assessments give better signal than examinations in university. But if more people start cheating, it might make more sense for companies to filter students by GPA / which university they went too, as some factors. Why?Because it at least establishes some baseline level of aptitude / skills. It&apos;s reasonable to expect that average student from MIT/Stanford/CMU is probably better than the average student from \&lt;Insert another university\&gt;. So, by having tighter filtering criteria, companies reduce their variance of a new hire, and at least know the person is decently good.And since typically, companies want to minimize their false positive rates more than they want to minimize their false negative rate, this makes sense. That is, the cost of a bad hire is often much higher than the cost of missing out on a good candidate.

3. **Software v Software (2025)**: It&apos;s also possible that companies start using software that can detect currently-invisible-AI-applications. I&apos;m confident that this is not too hard because software like Examplify already exists for examinations (it can block network activity so you cannot access the internet). Once the software has kernel-level access, it can basically track / monitor / block whatever you want.I&apos;m also pretty sure people are already working on [building this](https://www.linkedin.com/posts/ugcPost-7311482014581374976-2wRU?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAADOXW3UBEGhPoD4NzqGmySaduJSx-Ra60zU). It&apos;s going to be a cat and mouse chase as the cheating-platform-creators try to find workarounds to this and proctoring-software-creators try to patch them. I expect this to be the most common path companies take to combat such cheating.

4. **Blacklisting**: Maybeee if a company detects (with sufficient evidence / reason) a candidate cheating, they can consider blacklisting them [^7]. I honestly think this would be a huge deterrence against cheating as it increases the &quot;cost&quot; of cheating drastically. Then, the only people for whom cheating would still be &quot;rational&quot; [^8] would be the people who have a close-to-zero chance of passing the interview to begin with — and these will be easy to spot once they start working.

5. **Removing leetcode-style assessments**: My estimate of the probability of this happening in the near-future is quite low. Moreover, whatever replaces this is going to face similar problems too, because cheating is not something unique to leetcode-style interviews. Cheating is possible in any system and needs to be detected and discouraged.

6. **Unpreparable Interviews**: Again, I think very few companies are actually going to put in the effort to change their hiring process / type of questions asked in interviews every couple of years to make them less grind-able. But according to me, this is the most robust way companies can guarantee to get high-signal from the interviews and assessments and minimize any false positives.

[^1]: If more companies start moving to X type of interview, then it incentivizes more candidates to start preparing for X as they can kill many birds (here, pass many interviews) with one stone (here, preparing one thing - X).

[^2]: I&apos;m sure it&apos;s worth it if you&apos;re trying to hire the best people.

[^3]: Though an argument could be made that you&apos;d learn a lot more by studying 10 different domains than just doing LC. I agree 100%.

[^4]: I have nothing against making money or entrepreneurship! I&apos;m 100% for it (as anyone who knows me can vouch for). I just happen to place values and ethics above entrepreneurship.

[^5]: So, while there may be a need to improve the system from an optimality / signal-seeking-process standpoint (not from a fairness standpoint), this would not justify cheating. You can believe that LC is not effective yet not support cheating! Rather, the means to do that would be to come up with a robust alternative and show that it&apos;s better than the current system. I&apos;d argue big tech companies are well-positioned to do some kind of A/B testing of different hiring processes to figure out which one works best — something I would definitely support!

[^6]: Part of me believes that the non-grinders will always feel like the system is not fair towards them because they think it&apos;s rewarding the &quot;wrong&quot; people, no matter what the metric is.

[^7]: I&apos;m not entirely sure if the punishment is proportional to the transgression here — it&apos;s possible this is a little too extreme.

[^8]: In EV terms, E[cheating] = (1 - P(get caught)) * (benefit) + P(get caught) * (consequences). Companies can influence both, P(get caught) and the consequences too, to make it irrational for anyone to try cheating. More generally, changing the incentives in a system can have a HUGE impact on the behaviour of actors in a system.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Intelligence as Pattern-Matching</title><link>https://devanshshah.dev//posts/intelligence-as-pattern-matching/</link><guid isPermaLink="true">https://devanshshah.dev//posts/intelligence-as-pattern-matching/</guid><description>Or, &quot;the mind as a switch statement&quot;</description><pubDate>Sun, 23 Mar 2025 00:00:00 GMT</pubDate><content:encoded>[_Epistemic status_](https://forum.effectivealtruism.org/posts/bbtvDJtb6YwwWtJm7/epistemic-status-an-explainer-and-some-thoughts)_: wrote without doing any research in ~1h [^1], purely based on personal observations, open to pushback!_

Based on anecdotal evidence, it seems that intelligence, at least partially, is the ability to recognize patterns based on past experiences and apply them to new situations.[^2]

In this context, a pattern can mean something concrete like an algorithm or a software implementation pattern or something more abstract like an economic principle or a philosophy concept.

And pattern-matching refers to &quot;finding a close match&quot; to the current situation / problem.

Though I do find the phrase pattern-matching more.

Let me give a few examples:

1. Doctors that have seen thousands of patients can diagnose new patients based on the similarity of the symptoms

2. Lawyers that have studied thousands of legal cases can come up with better strategies for the case they&apos;re working on, by making use of insights from other case.

3. Software engineers don&apos;t build new systems by reasoning from first principles — they pattern-match to find other similar systems and see how they were built, and what architectural design decisions can be applied to their system too. Even when there is no similar system, they fall back to commonly used software patterns and adapt them to their needs.

4. More generally, we make decisions everyday based on past experiences through pattern-matching.

In all the cases, it seems like the only information we have at our hand is our past experiences. By &quot;thinking&quot;, we aren&apos;t creating new information (in a strict sense). We are just using ideas / concepts from our already existing knowledge-base to solve our current problem.

To be clear, by combining 2 ideas, you can come up with a novel insight and &quot;generate&quot; new knowledge; but what I mean is that you would not have come up with this novel insight if you did not already know the original 2 ideas.

Every idea is built on top of other ideas.

It&apos;s different from rote-learning / memorization in the sense that the match doesn&apos;t have to be exact (hence, &quot;pattern&quot;-matching). You&apos;re never going to be in the exact same situation twice and you&apos;re rarely going to be solving the exact same problem twice. So, you need to think more broadly, more abstractly and focus on past experiences with some similarity to the current problem while doing pattern-matching.

Note: Perhaps critical thinking is when you do pattern-matching at the most fundamental level — to identify which first-principles apply in this situation, and then work your way up by building on top of them (and them alone). But I know this is not convincing. So, maybe this can be seen as a separate component / dimension of intelligence altogether, as &quot;first principles thinking&quot;.

**What factors affect how good someone is at pattern-matching?**

In theory, one limiting factor is how many patterns a person knows. If you know 100 patterns, you can pattern-match against at most 100 patterns.

But in practice, the true limiting factor is how many patterns / concepts can a person remember. Again, I don&apos;t think this is a memorization task. It&apos;s a matter of HOW you manage to remember your experiences in terms of the key principles that you are trying to generalise to other situations. This is often done subconsciously but it can also be done consciously. (In fact, that&apos;s the whole tenet behind [Cognitive Flexibility Theory](https://commoncog.com/how-note-taking-can-help-you-become-an-expert/#the-four-big-ideas-of-cognitive-flexibility-theory).)

Note that you don&apos;t have to only learn from your own experiences — by reading, you can absorb other people&apos;s experiences and come up with more principles / patterns for yourself.

The second factor affecting how good you are at pattern-matching is just how well you can spot similarities (aka how good your regex algorithm is).[^3]

There are different levels at which you can perform pattern-matching:

1. trying to find a similar problem within the same domain

2. trying to apply a concept from another domain (e.g. applying economics to tech)

3. combining multiple partial matches to solve your problem (e.g. taking 2 big ideas from 2 different domains and combining them to solve your problem.)

If your pattern-matching algorithm is good at detecting even faint similarities (e.g. how sensitive it is), you&apos;ll end up matching with more past experiences / lessons, and end with more principles to choose from.

It does not necessarily mean that all patterns you have in front of me will be relevant or useful for the task at hand — but at least you have the optionality of using it, which is better than not having it at all. In other words, you still need to figure out which one(s) are most relevant and can be applied in this context.

The bigger leaps you can take in terms of this pattern-matching, the more ground you can cover in the problem space. This means trying to maximize the amount of value you get from each thing you learn. It becomes useful to ask &quot;What principles can I takeaway from this, that can be applied to future situations?&quot;

Of course, if you generalize too much, the higher in terms of abstraction and scope, the more generic the principles and patterns tend to get. At that point, they might become mere platitudes and not useful.

So, it&apos;s about being able to pattern-match at multiple layers of granularity / complexity, depending on the need. This is probably what makes people highly intelligent. Knowing when to cast how wide a net to prevent getting useless noise.

In a [previous blog post](https://devanshshah.dev/posts/learning-vs-getting-things-done/), I wrote:

&gt; Imagine the space of all problems in the world. Now, imagine the problems you&apos;ve encountered as being points located in this space. When you&apos;re presented with a new problem, you&apos;re probably going to start by trying to find a closely related problem that you&apos;ve encountered before. So, if you&apos;ve encountered and solved a lot of problems, it&apos;ll be easier to solve related problems in the future because you are more likely to be able to find a close match (by spotting patterns, etc.) and then see if you can adapt the previous solution to this new problem.
&gt; [...]
&gt;
&gt; The more ideas and concepts you have in your head, the easier it is for you to absorb new ones (because you can see how they fit in to your existing mental models by comparing them to other ideas). This is why people often say that knowledge compounds over time.
&gt;
&gt; But that&apos;s not all. If you want to have original ideas (which is much harder than being able to understand other people&apos;s ideas), you need to have a dense space of points to begin with. The more ideas you have, the more you&apos;ll be able to combine several of them together, and try to uncover insights.
&gt;
&gt; Most original ideas are the amalgamation of existing ideas from different disciplines, applied in a novel way. And this is quite hard to do without enough points.

Here&apos;s a visual representation of that too:

![Intelligence as Pattern Matching](/images/blog/intelligence-as-pattern-matching/intelligence-2.webp)

The blue points represent the existing patterns you have identified and internalized. The red point is the new problem you have encountered. In the left case, you have many more past patterns to rely on. In the right case, you only have one past pattern, which may or may not even be applicable.

And on the importance of thinking laterally and across cross-domains:

![Intelligence as Pattern Matching](/images/blog/intelligence-as-pattern-matching/intelligence-2.webp)

The red point is the current problem you&apos;re trying to solve and the blue points are the patterns you have gathered. If you can think more broadly (aka think laterally), think across domains, you can tap on more patterns / principles and use them too (maybe even combine them together). In the left case, you only have 3 points to play with, but in the right case, you have many more.

I finally understand what Charlie Munger meant when he said:

&gt; You&apos;ve got to have models in your head, and you&apos;ve got to array your experience — both vicarious and direct — onto this latticework of mental models.

We do this subconsciously all the time when we make any decision, and doing it consciously can probably accelerate the pace of building this latticework for ourselves.

As a final fun remark: this idea that intelligence is pattern-matching is itself an application of pattern-matching to itself, i.e., to find examples where people think in a pattern-matching way which is regarded as intelligence.

[^1]: Actually I was in the middle of another post and was going off on a tangent — this tangent of pattern-matching — and I thought it made sense to just turn it into a standalone post and keep the other one distraction-free.

[^2]: About 50% through writing this post, I realized that this idea of &quot;intelligence == pattern-matching&quot; is essentially what &quot;reasoning by analogy&quot; is, and I kind of agree. So, I&apos;m not saying anything new here, just explaining what I think of the idea in a different way — and I think framing it as pattern-matching makes it easier to understand, at least for me. (Ironically, this also means I was bad at doing the pattern-matching to spot this similarity between the two things much earlier on xD rip)

[^3]: I finally realized THIS is why IQ tests are all about spotting patterns in random sequences of shapes and it all makes sense now.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Joy and Productivity</title><link>https://devanshshah.dev//posts/joy-and-productivity/</link><guid isPermaLink="true">https://devanshshah.dev//posts/joy-and-productivity/</guid><description>Or, how I survived university.</description><pubDate>Sun, 09 Mar 2025 00:00:00 GMT</pubDate><content:encoded>*Estimated reading time: 19 mins*

To me, being happy and being productive are two sides of the same coin. When I&apos;m happy, I tend to also be more productive, and being productive also brings me joy.

I&apos;ve been experimenting with many different systems over the past few years, and have tried following a lot of the common advice in books and videos. For example, keeping my phone away in a different room while doing work, or waking up without an alarm clock.

Some have worked, others haven&apos;t.

I think I&apos;ve come up with some of the main changes that have really moved the needle in terms of making me happier and also more productive [^1].

None of these are groundbreaking, or even original, ideas. Instead, they&apos;re some of those simple-to-preach-but-hard-to-practice (e.g. &quot;eat healthy and exercise&quot;) ideas that I&apos;ve become convinced are _actually_ important by seeing them in action in my own life.[^2]

As an obvious disclaimer: These are just things that have worked for me, I don&apos;t know if they&apos;ll work for you. But it probably doesn&apos;t hurt to try them anyway right?

### 1\. Don&apos;t waste time

I hate the feeling of wasting time. I think it&apos;s a pretty common feeling among people I&apos;ve encountered.

But everyone has their own definition what &quot;wasting time&quot; means to them. Which is why I think a more useful meta-definition which doesn&apos;t talk about any specific activities but is instead about how to identify &quot;time-wasting&quot; activities is:

&gt; If doing X doesn&apos;t add value in any way AND makes me feel worse _afterwards_ , then X is a waste of time.

The idea is that you CAN do things that to relax and enjoy yourself even if they don&apos;t add any productive value, as long as you genuinely feel good afterwards. For example, going for a walk, meeting friends, etc.

The activities that I consider a waste of time are ones that I only enjoy in the moment and _I know_ will make me feel worse about it later on. For example, watching random youtube videos about things I don&apos;t remember a day later, scrolling through Instagram reels.

You might consider _different_ activities a waste of time (or not) and that&apos;s alright. I think as long as you&apos;re doing things that are either adding some value / helping you make progress or making you happier, that&apos;s perfectly fine!

What&apos;s important to me is that I want to be in control of where and how I&apos;m spending MY time (and to do this, I need to be able to track, at some high level, what I&apos;m doing with my time).

So, rather than just jumping straight into doing something, I find it useful to pause for a second and ask &quot;Why am I doing this?&quot; . I do this for literally everything now.

If I don&apos;t have a good reason for doing it, I realise I shouldn&apos;t be doing it.

(To reiterate, what counts as a good reason depends on you; for me, &quot;just out of curiosity&quot; is a good reason, but &quot;because I&apos;m bored&quot; is generally not - more on this next.)

### 2\. Setting the right defaults

It&apos;s [pretty](https://en.wikipedia.org/wiki/Psychological_inertia) [well-understood](https://en.wikipedia.org/wiki/Default_effect) now that defaults have a big impact on our decision-making.

For small decisions, we often tend to just follow the path of least resistance / effort rather than actually thinking and trying to find the best course of action. e.g. What to eat for breakfast?

The problem is that although each individual decision can be inconsequential, they add up over time. What you eat for breakfast everyday for a decade can have a pretty big impact on your overall heath.

Perhaps the biggest &quot;default&quot; that exists in most our lives is our default source of entertainment. What do you do when you&apos;re bored?

Every time I was bored, I would just mindlessly grasp my phone and open either Instagram / X to see something new and get a quick dopamine hit. I didn&apos;t have a reason for doing it. I just didn&apos;t know what else to do.

An interesting realisation is that you can&apos;t just remove this default option without replacing it with something else. That is, you can&apos;t have no default. Otherwise, you still won&apos;t know what to do when the situation arises and you&apos;ll likely gravitate towards the option which provides the most immediate gratification (which is almost always the worst one in the long-term).

So, the way to &quot;fix&quot; this is to design your environment / system such that doing the right / good thing (that you know is better for you in the long-term) is the easier option.

Concretely, setting the right defaults for myself means that now, when I&apos;m bored, I do one of:

  1. Watching videos I had added to my watch-later on Youtube (generally science / math / tech related).

  2. Listening to saved podcasts / audiobooks on Spotify.

  3. Continue reading a book.

  4. Go for a walk.

Observe that (1), (2) and (3) have some sort of prior planning - I curate the stuff I want to watch / listen to beforehand so it&apos;s as easy as possible (since I don&apos;t have to search for new content) for me to do it when I&apos;m bored. And I always have a book I&apos;m currently reading as another default option to continue — starting a new book would be much more difficult to adopt as there&apos;s more friction involved in picking which book to start, obtaining it, etc.

Oh, and I often just delete Instagram / X if I find the temptation too hard to resist. And then install them back if I want to use them — this intentionally creates friction, which means I only use them when I really want to, not just because I&apos;m bored and have nothing else to do. I don&apos;t want them to be my default go-to source of entertainment.

Doing this also meant I regained control of how I was spending my &quot;free&quot; time, which ties back to (1) Don&apos;t waste time.

### 3\. Listen to yourself

It&apos;s easy to get sucked into a rabbit hole of constantly listening to other people&apos;s advice and what works for them. This is exacerbated by the fact that every semi-successful person has started to give advice on social media and make youtube videos on how to be as successful as them.

Everyone is telling you what you should be doing, what you can achieve if you follow their advice, &quot;If I can do this, you can do it too!&quot; , blah blah blah.

It&apos;s too much noise.

You feel as if you&apos;re drowning in a sea of everyone else&apos;s opinions.

The only lifeboat you have is to think independently and come up with your own opinions.

It&apos;s a relatively new phenomenon where every person has been given a platform to share their ideas and give advice to others. It&apos;s tempting to view them as &quot;experts&quot; based on how confident they sound — but in my personal experience, most of them are charlatans who do this merely for ad revenue, affiliate marketing, etc.

But more importantly, they don&apos;t know you. They don&apos;t know your context, your priorities, your goals, what you want to achieve, how you think. They know nothing about you as an individual. Why, then, do you think they know what&apos;s best / right for you?

![Pressure of advice](/images/blog/joy-and-productivity/advice-pressure.webp)

When you are constantly listening and following others&apos; advice, you&apos;re not listening to yourself. You aren&apos;t exploring your interests. You aren&apos;t trying out new things that go against the social norms and conventions. You&apos;re living life based on other people&apos;s expectations and opinions — sure, it might turn out okay, but you miss out on figuring out your passions, and your dreams.

And it&apos;s not just explicit advice given by people. It&apos;s also implicit in social norms and conversations. There&apos;s this one standard path that everyone follows, and you feel the pressure to conform to it. In university, it might be: 1) study hard, 2) do internships, 3) find a job.

If you have different goals, you&apos;ll feel out of place. You&apos;ll feel as if you&apos;re doing something wrong but at least you&apos;ll know what you&apos;re doing.

But if you don&apos;t have any idea what you&apos;re doing, you&apos;ll likely just follow this standard path too. Without ever questioning if this is something you actually want to be doing in the first place. And this is dangerous.

I&apos;ve felt this to be true personally as well. When I entered university, I didn&apos;t know what I wanted to do but I just followed the default script in university. I didn&apos;t really even think of what I wanted to be doing. I was too busy doing what everyone around me was doing. It was only in my 3rd year that I started questioning why I was even doing certain things. I went back to the basics — I knew I enjoyed tech and building things. So, I started doing more of that. I knew I liked math and statistics, so I started taking more of those courses. I stopped caring about what others were doing and started caring about what I was doing.

In my final semester, I&apos;m even doing a business law course! Why? Just because I thought it would be fun. And it has been my favourite course this entire semester.

I feel like listening to advice is great _as long as you don&apos;t blindly accept and follow it_. Think about it yourself. See if that&apos;s what you want to do. Throw away the default script. Make one for yourself.

In fact, if you don&apos;t already know what you want to do, trying to find your passion is a great source of joy in itself. The only way to know is to try different things and see what you enjoy — what feels like fun to you but work to others. Believe me, it&apos;s worth it. Once you find your passion, it&apos;s like an unlimited source of energy that you can consistently tap on.

### 4. Importance of Mood

The whole premise of this post is that joy boosts productivity and productivity brings joy.

More generally, I&apos;ve found a strong (positive) correlation between my mood and my productivity. And my overall mood for the day is largely determined by how my morning goes. So, the natural question was: How do I consistently start my day in a good mood? Or, how do I get off to a productivity start so that my entire day goes well and as a result, my mood is also good?

I make no promises that this will work for you, but the thing that helped me achieve this was having a consistent morning routine. I like to start my day off slow and relaxed rather than jump straight into work. So, I wake up ~6:30am almost every day, go to the gym or for a run, and then come back and eat a nice, slow breakfast for 20-30 mins (even if I&apos;m just drinking coffee, I&apos;ll spend more time than &quot;needed&quot;, just enjoying each sip). All this brings my focus to the present and I appreciate it more.[^3]

(Oh, and I do think _not_ checking messages / emails until after breakfast is a key part of the routine. It&apos;s precisely what makes it relaxing and distraction-free.)

I&apos;ve also started spending more time outdoors and that has brought tremendous joy too. I touched grass more times in the last month than in the previous 4 years combined. And it feels great.

I&apos;m pretty sure there&apos;ll be equally (if not more) happy and productive people who do the exact opposite too. Which just goes to show that you have to figure out what works for you — though I do think having any routine is a game-changer.

Even a 5-10% improvement in your mood is going to have a tremendous impact on your quality of life, and it&apos;s totally worth spending an extra half-hour or hour each day if it means you&apos;re happier overall.

### 5\. Importance of Inspiration

Inspiration is an emotion. It&apos;s this intense, yet calming, feeling that makes you think you can do anything you put your mind to, and _you_ can change the world too.

Inspiration often strikes without warning. You might be inspired by watching some youtube video, by reading a book, or just talking to someone.

Most often in my life, it has manifested itself as a &quot;Wow, I have this amazing idea! I want to work on it right now!&quot;

In the past, I used to try and delay it by telling myself that I had a lot of other assignments to complete, and work to finish, and that this &quot;amazing idea&quot; had to wait a while and take a backseat. I realised this was not the right way to prioritise things because inspiration is perishable.

You can&apos;t force yourself to be inspired / excited about an idea you had a month ago — it fizzles away over time.

You can&apos;t schedule inspiration. Worse, if you keep suppressing inspiration by not giving it its rightful time and expression, it might dry out entirely.

You need to have some &quot;damn, this is so cool!&quot; moments every once in a while to regain this child-like awe and sense of wonder — and this only happens when you follow your natural curiosity.

Since then, I&apos;ve decide to prioritise inspiration over anything that is not super urgent. For example, last month I had an idea to build a dashboard for company-wise Leetcode questions so anyone can access it _without purchasing Leetcode premium_. I spent a few hours on that very same day and just built it. I had originally planned to work on my final year project but that plan went out the window.

![FYP Message](/images/blog/joy-and-productivity/fyp-message.webp)

It was so much more fun, and I don&apos;t regret it at all. I felt great that day. (And I got my FYP work done the next day.)

Also, I think it&apos;s possible to increase the frequency of such bursts of inspiration by:

  1. hanging out with people you like and admire, who share similar interests.

  2. exploring new fields and interests with a beginner&apos;s mindset — some of my biggest &quot;oh damn!&quot; moments were at the intersection of two fields, generally technology and something else.

### 6\. Importance of Beauty

I never thought beauty could bring joy. But now I&apos;m convinced it can.

There&apos;s really beauty in everything. Here are some examples:

  1. Reading an elegant mathematical proof is almost like listening to classical music. It really does sing like a song, and make you feel as if the world is a better place with it in it.

  2. The same is true for code — some code is just so clean and beautiful that you love working with it. It&apos;s easy to understand and well-written. Other times, the code is so ugly and unfriendly that the very thought of working on it makes you want to take a break.

  3. In the UI of a website, no detail is too small. A few days ago, I spent ~3h making small cosmetic changes (font colours, background, layout, mobile responsiveness) to my personal website until I was satisfied with it. I&apos;m more than satisfied with it now — I&apos;m proud of it! (Oh, and I had an exam that day too.)

![Personal Website](/images/blog/joy-and-productivity/personal-website.webp)

This is the new version of the [website](https://devanshshah.dev/) — simple, clean and minimalist.

Though I do think that to appreciate such beauty, you need to really tune in, and focus. You can&apos;t appreciate beauty under time pressure or when you&apos;re stressed about something. You need to be present in the moment, calm and relaxed.

But once you see the beauty in something, you feel much more joy when you&apos;re working on it. You&apos;re proud of it.

Pushing myself to do things I&apos;m truly proud of has made me more confident in my own abilities. This, in turn, motivates me to work on more projects. And so, doing things I&apos;m proud of becomes a virtuous cycle of both joy and productivity — the joy in the act of creation of something worthwhile itself, and the productivity of having done it.

Perhaps more importantly, it&apos;s also helped me develop a sense of taste. Now, I know what works and what doesn&apos;t. What looks good and what doesn&apos;t. I have more opinions on how to make other products better, by having thought of those design decisions while building stuff myself.

You can see the growth in taste over time through the following projects:

![Quizopia](/images/blog/joy-and-productivity/quizopia.webp)
A quiz platform I made for an NUS module in 2023. Do you see the cringe &quot;add fun and multiply your brain power&quot;??

![Volunteer managemnet System](/images/blog/joy-and-productivity/vms.webp)
A volunteer management system I built in 2024 with a friend. The pink and yellow colour scheme makes it look like it was made for kids.

![LC dashboard](/images/blog/joy-and-productivity/lc-dashboard.webp)
My latest [project](https://leetcode-company-wise-dashboard.netlify.app/) — one where I&apos;m actually proud of the design and one which ironically took the least amount of time to build.

Don&apos;t underestimate the power of beauty and taste.

### 7. Embracing flexibility

It&apos;s good to have a system in place, a routine, a way to manage your time / priorities / goals. Whatever you want to call it.

But don&apos;t be too rigid with it. Sticking to any system too rigidly reduces your optionality in trying new things, exploring new opportunities. This is especially true in universities where the best things often happen on short notice.

Here, I mean flexibility in 2 main regards:

  1. Flexibility within the system itself

  2. Flexibility to break the system

(1) means that whatever system you use to plan your day / week should allow for flexibility. Why? Because 9 times out of 10 you&apos;re probably not going to finish everything you thought you would because something else (which was more important) came up and you had to postpone things.

You can&apos;t keep feeling bad for not ticking every checkbox every day. Not every day is going to be exactly as you planned it. Things happen. These can be good things too! What&apos;s important is that you make the best use of your time.

(2) means that you need to give yourself the freedom to break the system if you think it&apos;s not working out — this might be because of a certain phase you&apos;re in (e.g. if you&apos;re in the middle of exams, maybe you can&apos;t afford to have a slow breakfast or spend 1.5h in the gym) or it might be because you&apos;re not comfortable with it (e.g. you feel it&apos;s limiting your ability to do things you really want to do).

The system should adapt to you, you shouldn&apos;t have to adapt to the system.

For example, I don&apos;t set time-based targets for any of the items on my daily todo list. In fact, on any given day, my todo list rarely contains more than 2 big tasks (but it does have a bunch of boring, routine tasks that don&apos;t require much effort). Importantly, I don&apos;t set a bound on how much time I spend on any assignment on a given day. It&apos;s going to take as long as it&apos;s going to take. I&apos;m going to do it at my own pace, and optimise for learning, not optimise my throughput (tasks completed in a given time frame).

I think this kind of fluidity and dynamism is precisely what separates university from school or work. In school and at work, you have an external schedule imposed on you. So, you have more constraints and less control on how you can spend your time (but this is often easier to deal with since it also means less responsibility to plan).

In university, you have none of that [^4]. You can choose to do whatever you want. It gives you a lot more control and freedom to decide how you want to spend your time. Make the most of it.

### 8\. Writing

I&apos;ve found writing (journaling) to be a great way to self-reflect and think deeply. It helps to close the feedback loop and reflect on whether I&apos;m on the right track, whether I need to change anything, etc.

More practically, when I write things down, it becomes easier for me to step back and ask questions about it (e.g. &quot;hmm why does this make me so upset actually?&quot;). Because I&apos;m less attached to a piece of writing than thoughts in my own minds. I can see it more clearly for what it really is, rather than what I think it is or what I want it to be.

It&apos;s like a conversation. It&apos;s a conversation between two sides of my mind. One of which is asking questions to the other to try and probe for reasons behind the thinking. To try and understand why it&apos;s thinking the way it is and then to evaluate it.

But not everything I write is about things that are not going well or things I need to improve on. That would be kinda dull and somewhat sad. I also write down things that are going well and I&apos;m happy about. It&apos;s a great way to slow down and be grateful for these things, since gratefulness itself is one of the primary sources of joy.

In fact, I also write about random things I&apos;m thinking of during the day as well — when I think of something I find interesting, I just take out my phone and write it down. So, I have a page which is just a massive dump of whatever I&apos;m thinking. Kind of like a &quot;brain log&quot;.[^5]

This also helps to relieve the pressure of remembering things (though ironically, writing them down tends to make me remember them better anyway).

What&apos;s really useful is that it&apos;s searchable — so even if I forget the details of an idea I can vaguely remember, I can find it quickly. And this makes it possible to connect the dots to what I am currently thinking about.

Sometimes when I&apos;m bored, I just read through what I was thinking about a few months ago, and I see those same thoughts / observations in a completely different light. I see how they relate to things I learnt after that, and whether I updated my views accordingly.

It&apos;s also a very good way to track objectively how my thinking has changed over time — rather than relying on my own memory to tell me what I believed in the past, which is susceptible to cognitive dissonance and hindsight bias. This is much more raw and honest — since it&apos;s literally a snapshot of my mind at that time.

This kind of meta-reflection (made possible via writing) increases self-awareness drastically and overall, writing / journaling has been an absolute game-changer for me.

[^1]: I&apos;ve omitted some obvious sources of joy like friends, family, relationships, etc. and the importance of perspective / resilience though they are probably the most influential factors in life. Maybe another post on this later.

[^2]: This in itself is a common concept: you never _really_ understand _just how true_ something is by reading / hearing it; you have to _experience_ it yourself to become convinced of it. Almost all quotes sound true and believable and wise, but you don&apos;t understand their importance until you actually see them applied in real life. In this sense, I think everything has 2 levels of understanding: the first is when you understand the concept itself (as a matter of fact, or theory), and the other is when you actually internalise it through experience (the &quot;ohh damn! i finally get what it means&quot;) moment.

[^3]: It&apos;s impossible to appreciate anything in life without focus. If you&apos;re always distracted, you won&apos;t find anything &quot;amazing!&quot; in a deep way. But if you&apos;re free from distractions, you really start to appreciate every little thing more — things you didn&apos;t even know existed though they were right in front of you, things you took for granted. Life feels a lot more profound and deep when you slow down.

[^4]: Well, almost none. Nearly all lectures taught in NUS School of Computing are recorded (hence, optional). So, even if you attend all tutorials / labs, that&apos;s ~10 hours of externally scheduled time per week. Which is less than 6% of the total time in the week!

[^5]: For context, I average ~1000 words per day in this brain log — although much of it is really just random thoughts and musings. But I&apos;m perfectly okay with this, because I think the very act of writing spawns new ideas. So even though X itself may seem useless, _writing about_ _X_ can generate more ideas around it (imagine a sphere with X as the center) which can potentially be insightful / useful, as writing explores many different angles and encourages lateral thinking.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Ideas are ___, Execution is ___</title><link>https://devanshshah.dev//posts/ideas-execution/</link><guid isPermaLink="true">https://devanshshah.dev//posts/ideas-execution/</guid><pubDate>Mon, 24 Feb 2025 00:00:00 GMT</pubDate><content:encoded>It’s incredible to see how good AI has gotten at programming and building stuff. I use Cursor almost exclusively now, and have noticed myself prompting more and coding less. Tools already exist to create full-stack apps from scratch, using only a prompt.

I started my undergraduate degree in Aug 2021, around a year before ChatGPT was released. And if you had told me then that this was how the state of programming would be right now, I would’ve laughed and told you to stop reading so many sci-fi novels.

Yet here we are.

How will software engineering look like 1 year from now? 2 years? 5 years? I’ve no clue.

The rate of change is too high to even predict how things will like by the end of 2025. We’re living through the world’s fastest technological revolution!

Nevertheless, I think at least in the near-future, technical skills are going to remain important. Even if you use AI tools, prompting them correctly and effectively is necessary for them to do tasks right now. You still need to specify some intermediate steps or break the problem down for the AI to solve. To do this, you need to know (at least on a high level) how to do the task yourself. This will eventually change as models get better, but until then, technical knowledge is useful at least insofar as enabling you to write better prompts to generate accurate code.

But even though I can’t predict how tech jobs will look like in the future, I think the real (and more important) question is: What skills are going to be valuable in a world where AI can do most of the intellectual work we do today?

Until now, the advice given to young founders and startups was mostly: “ideas are cheap, execution is expensive”. This is clearly changing. With AI, the time and effort to build things on the internet has been going down dramatically.

Does this mean the maxim should be reversed to “execution is cheap, ideas are expensive”?

Honestly, I don’t think so. In my opinion, the “execution” in the maxim was never *really* about technical execution, i.e., the technical skills needed to build something. It was more about the discipline and the mentality to execute. It was about the consistency and persistence to push through difficult times and brick walls. It was about being relentllessy resourceful.

So, in that sense, execution — having a strong conviction and high agency — will become even more important. The difficulty is just going to move from solving technical challenges to solving business problems and the increased competition.

And the real question is: Even though you have the power of AI to build whatever you want, *will you*? *Will you* take the initiative and make use of the resources you have?

I still think ideas alone are not going to be enough. Even with AI and all the possible resources one might need, there will be a lot of people with ideas who will not act on them (or see them to fruition).

At the same time, as a natural consequence of more products entering the market at a rate never seen before, branding and advertisement are going to become more important.

The reason is simple: the barrier to entry has gone down significantly (think: anyone who knows basic programming can build an app) so while there were once 1-2 apps in a niche, now there are going to be a dozen. This means you’re going to have to work harder to differentiate yourself from the crowd.

So, when everyone can build, the game isn&apos;t about building anymore. It&apos;s about finding distribution and making people *care* about what you&apos;ve built. [^1]

[^1]: I predict that to get an edge on advertising, more and more people will start to build in public, trying to establish their own personal brands, and advertising their products via their journey. In such a case, advertisements will be inextricably linked to people, stories, and a general media consumption diet. *Everything will become an advertisement*. In particular, social media platforms are going to become the dominant advertising platforms, and their personalized recommendation algorithms are going to be bring advertisements of products you&apos;re likely to like / need on your feed. This will be the new way you will discover new products. (I find it slightly distasteful (but reluctantly accept as being inevitable) that the &quot;building in public&quot; movement started off as a genuine attempt to share cool things individuals were working on, but has now become more of a PR stunt.)</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Hack&amp;Roll 2025</title><link>https://devanshshah.dev//posts/hackandroll-2025/</link><guid isPermaLink="true">https://devanshshah.dev//posts/hackandroll-2025/</guid><description>A hackathon to remember</description><pubDate>Mon, 27 Jan 2025 00:00:00 GMT</pubDate><content:encoded>I don&apos;t usually post about events, but this one was special: Hack&amp;Roll 2025!

Hack&amp;Rolls have been a big yearly affair for the past 4 years of my life. I took part in H&amp;R 2021 as participant, and organized the next 3 iterations (2022-25).

For context, Hack&amp;Roll is the largest student-led hackathon in Singapore, held in-person over 24 hours (meaning you can stay overnight), and open to all students (from primary school to PhD). What makes it unique (apart from the free flow of coffee + snacks + food) is that there is no &quot;problem statement&quot;: you are free to build whatever you want. Even the criteria for judging is really just how cool your hack is.

We have ~10 spot prizes (aka categories) that you can qualify for (e.g. &quot;most annoying hack&quot;, &quot;most beautiful hack&quot;, &quot;most awesomely useless hack&quot;, etc.) depending on what you&apos;re building.

The purpose of Hack&amp;Roll is to encourage you to explore your creativity, learn something new, and just build something you&apos;re proud of. This is what hacker culture is all about.

This year&apos;s hackathon was held last week (18-19 Jan), and we broke all previous records:

- 747(!) participants (we had students from secondary schools, junior colleges, polytechnics, NSFs and university students)

- 270(!!) teams (meaning 270 projects were built over the span of 24 hours)

- 121(!!!) judges (all our judges are either industry professionals or professors or indie hackers)

We put in a lot of hard work into organising Hack&amp;Roll every year, and it&apos;s always worth it. It&apos;s so cool and inspiring to see the participants build such amazing hacks.

I also just really enjoy organizing events and handling the operational / logistics aspect of things. It seems like a weird interest at first glance but I think it&apos;s because this require a certain kind of imagination (to predict and visualize exactly how something is going to happen), creativity (to solve problems related to physical constraints like time, space, etc.) and the raw ability to get things done.

There were lots of fun moments, like wearing the mascot - yes, I can finally reveal it was me [^1] since I won&apos;t be wearing it anymore - and playing mario kart in the ops room.

And there were also some, um, stressful times - like when my &quot;efficient table allocation&quot; script (that I had never tested until that moment) failed an hour before judging started and we thought we&apos;d have to switch to our backup plan [^2] (nah, I ended up fixing it and we got everyone in a single hall for judging), or when I was live-debugging the `winners.py` script to determine the winners of the hackathon in front of ~1000 people (turned out to be some random pandas datatype errors which caused the closing ceremony to be delayed by 10 mins, sorry!).

But honestly? I enjoyed every single moment, and wouldn&apos;t have it any other way.

And organizing large-scale events such as these has taught me so much about planning, managing, operations, leadership, teamwork - things that can&apos;t be taught in a classroom. Nothing prepares like the experience itself.

It&apos;s probably the last hackathon I&apos;ll be organizing for a while since I&apos;m graduating in a few months. I&apos;m going to miss this.

Here are some pictures to show just how vibrant and energetic the atmosphere was:

&lt;figure&gt;

![Dining Hall](/images/blog/hnr25/dh.jpg)

&lt;figcaption&gt;Hundreds of hackers building the next big thing.&lt;/figcaption&gt;

&lt;/figure&gt;

&lt;figure&gt;

![Dining Hall](/images/blog/hnr25/coffee.jpg)

&lt;figcaption&gt;Code, Coffee, Chaos.&lt;/figcaption&gt;

&lt;/figure&gt;

&lt;figure&gt;

![Dining Hall](/images/blog/hnr25/dh-2.jpg)

&lt;figcaption&gt;Teams building actual physical prototypes.&lt;/figcaption&gt;

&lt;/figure&gt;

&lt;figure&gt;

![Mascot](/images/blog/hnr25/mascot.jpg)

&lt;figcaption&gt;Me wearing the mascot for the last time.&lt;/figcaption&gt;

&lt;/figure&gt;

&lt;figure&gt;

![Organisers](/images/blog/hnr25/organisers.jpg)

&lt;figcaption&gt;All organisers: coreteam members + volunteers.&lt;/figcaption&gt;

&lt;/figure&gt;

---

[^1]: some of the time* (this year, we had 2 other people who also wore the mascot at different times)

[^2]: the backup plan was to use 2 halls for judging, if a single hall could not accommodate everyone, but i thought this would be much less vibey (and less like a project fair) and so, we just had a more optimized table-allocation system (to pack everyone in 1 hall).</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Visualizing Bias in LLMs</title><link>https://devanshshah.dev//posts/bias-in-llm/</link><guid isPermaLink="true">https://devanshshah.dev//posts/bias-in-llm/</guid><description>A picture is worth a thousand words</description><pubDate>Thu, 26 Dec 2024 00:00:00 GMT</pubDate><content:encoded>I learnt about the concept of word embeddings about a year ago, and I remember feeling amazed at the genius of whoever came up with the idea. It was one of those lightbulb moments that you don&apos;t forget.

The idea of converting words to vectors living in some high-dimensional space, and then using the position of those vectors to infer information about the semantics / meaning of the word based on their distance from other words still seems so cool to me.

We can now say things like &quot;what&apos;s the distance between 2 words&quot; without sounding crazy.

We can think of each dimension / axis / direction as encoding some form of meaning about the real world.

And this simple idea is what we can use to analyze and quantify the bias that is ingrained in AI models.

Let&apos;s start with a (pretty classic) question. If `man` : `woman` : : `king` : X, what is X? That is, `man` is to `woman` as `king` is to what?

It&apos;s pretty obviously queen, right?

Humans are good at these kinds of puzzles precisely because we think of word in terms of their meaning (and not in terms of the letters that make up these words). But how would you pass this information and teach the idea of &quot;meaning&quot; to a computer?

It&apos;s a genuinely hard problem, but the (current) state-of-the-art method is to encode words as vectors (known as embeddings) by analyzing a very large corpus of text to see which words appear in the context of other words. By doing this, machines are able to assign vectors to words such that similar words have similar-ish vectors — and they live close together in this high-dimensional (generally 50-300) space. [^1]

By &quot;live close together&quot;, I mean that the distance between these vectors (either cosine or euclidean) is going to be small.

Really internalize this idea of words being vectors. We can perform operations on words just as we can on vectors. Addition, subtraction, dot products, and all the other jazz.

Another useful property that emerges as a result is that different directions encode different things about the world.

So, from our earlier example, we can try to visualize the words `man`, `woman`, `king` and `queen` (I&apos;ve used PCA to reduce the dimensions from 50 → 2 so I can actually plot it — and since we only have 4 words, this is generally not super lossy anyway).

![Man-Woman-King-Queen](/images/blog/bias-in-llms/man-woman-king-queen.png)

We can see that the direction indicated by the line seems to encode the idea of &quot;gender&quot; to the machine — and is consistent with the fact that the man-woman line and the king-queen line are both parallel-ish to each other.

And due to this, we can actually do things like: `king` + (`woman` — `man`), and the intuitive meaning of this is that we&apos;re &quot;transforming&quot; `king` by subtracting the male gender, and adding the female gender. We expect the answer of this transformation to be `queen`, and it is! [^2]

My hypothesis was that these embeddings encode societal bias too.

A pretty simple way to detect this is to draw a line joining two points which would be the dimension across which we wish to measure bias (e.g. gender, race, etc.), and then project the other points (whose bias we wish to detect) onto this line.

If two words have similar values along this dimension, they should lie close to each other on the line — i.e., they should not differ a lot in their components along this &quot;dimension of bias&quot;. Formally, their difference should be orthogonal to this dimension so that the two words have the same degree of this dimension.

It&apos;s easier to explain this with a visualization:

![Man-Woman-King-Queen](/images/blog/bias-in-llms/man-woman-king-queen-projection.png)

The way to interpret such a graph is to look at the *relative* positions of the red points along this axis as a measure of how different they are in this dimension. The absolute positions aren&apos;t really important here — the important thing is how far the red points are from each other.

If the two points are far apart, they differ greatly in this man-woman dimension. Obviously, king and queen do differ greatly in this dimension (it&apos;s sort of the only difference right?), so it&apos;s natural to expect there to be a big distance (almost as big as that between man and woman itself!)

![Man-Woman-King-Queen](/images/blog/bias-in-llms/man-woman-king-queen-drawing.png)

![This Different](/images/blog/bias-in-llms/this-different.png)

To be clear, if two words are near each other on this man-woman axis, it does NOT mean that they are both gender-neutral. It just means that they have the same amount of &quot;gender-ness&quot; encoded in them. That is, the &quot;lean&quot; the same amount along this dimension.

It would be great if we could just use the absolute position on this axis as a measure of &quot;how much gender&quot; is present in the word, but this didn&apos;t seem very meaningful. In fact, even from the picture above, we can see that `king` has more `man` component than the word `man` itself.

But why is this the case? Shouldn&apos;t the midpoint of the line segment joining `man` and `woman` be the expected location of a gender-neutral word?

Well, yeah, I thought so too. So, I decided to investigate this when I saw that a seemingly neutral world like `house` was closer to `man` than `woman`.

![House](/images/blog/bias-in-llms/man-woman-house.png)

It turns out that is indeed the case that IF we normalize the vectors so they all have equal length, then this holds true. In an isosceles triangle, the median and altitude coincide (aka perpendicular bisector) but this is not true for a general triangle.

Here&apos;s an illustration:

![Isosceles Triangle](/images/blog/bias-in-llms/isosceles.png)

This is actually a pretty accurate depiction of what was happening — the word `woman` was longer than `man` — not in characters, well, also in characters but in this case, the vector length — and so the altitude was shifted towards the `man` , which meant that even neutral words seemed closer to `man` than `woman`.

Once I normalized all the vectors, I saw that the `house` moved closer to the midpoint but it was still slightly closer to `man`:

Maybe there really is some gender-related connotation about the word &quot;house&quot; too? (i guess because of the phrase &quot;man of the house&quot; used in traditional settings?)

So, I did another test: count how many words are closer to man than woman, and vice-versa, to see if there&apos;s some systemic leaning in the entire vocabulary.

Surprisingly, it turns out that more than twice as many words are closer to `woman` than to `man` (in terms of cosine distance). Does that mean that on average, words are more &quot;feminine&quot; than &quot;masculine&quot;? Maybe? I don&apos;t know.

Anyway, let&apos;s come back to the central hypothesis, which was to check whether we can find evidence of bias in these embeddings. Here, I present some of my findings.

Note that for these graphs, I&apos;m using _normalized_ glove embeddings so theoretically, the midpoint should be the &quot;neutral&quot; point. But I&apos;d still prefer using the distance between the red points, which intuitively makes more sense to me.

![Programmer-Nurse on Man-Woman Axis](/images/blog/bias-in-llms/programmer-nurse.png)

Imagine an AI agent tasked with filtering candidates for a job position… I wonder how fair it&apos;s going to be?

Let&apos;s add some other jobs along this axis:

![Careers on Man-Woman Axis](/images/blog/bias-in-llms/man-woman-careers.png)

Another kind of bias below?

![Rich-Poor on Man-Woman Axis](/images/blog/bias-in-llms/man-woman-rich-poor.png)

I feel like now&apos;s a good time to reiterate that I&apos;m just presenting my analysis and don&apos;t necessarily support or condone any opinions that these graphs may seem to imply.

![Religions on Positive-Negative Axis](/images/blog/bias-in-llms/positive-negative-religion.png)

![Nationalities on Positive-Negative Axis](/images/blog/bias-in-llms/positive-negative-nationality.png)

It&apos;s funny how most of the nationalities (`chinese`, `indian`, `british`, `russian`, `singaporean`) are pretty close to each other, except `american` which is quite far away from the group (worth noting the direction 👀). And it&apos;s very *very* surprising that `singaporean` is furthest on the right?? Again, think of the consequences of AI making decisions based on this.

Another way to think about visualize this idea of bias is to use plot the 2 pairs of words in a 2D plane (using PCA) and observe the angle the two lines make with one another. If they are perpendicular, it means that the two lines capture completely independent &quot;information&quot; and there is no correlation between the two dimensions. If they are parallel, it means they are highly correlated.

In other words, the angle between the lines can be used as a measure of the correlation between the two dimensions / axes. An angle of 90 degrees indicates zero correlation and an angle of 0 degrees (or 180, however you like) indicates perfect correlation.

For example,

![Man-Woman Rich-Poor Angle](/images/blog/bias-in-llms/man-woman-rich-poor-angle.png)

Here, the two lines make an angle of 45.09 degrees, so there is a moderate degree of correlation in the two dimensions. And we can find out which &quot;side&quot; this correlation leans by dropping perpendiculars to the rich-poor axis, just as we did earlier.

Another example below: angle = 17.6 degrees, indicating a strong correlation of good-bad and honest-liar, i.e., &quot;honesty is good, lying is bad&quot; is inferred by the model:

![Good-Bad Honest-Liar Angle](/images/blog/bias-in-llms/good-bad-honest-liar.png)

## Further

We can also do multi-variable analysis by having more than 1 axes to plot the points. e.g. plotting words on a graph where the x-axis is man-woman and the y-axis is rich-poor, for example.

Finally, we can even quantify / measure how *much* the bias is by finding the distance between the two points along this &quot;dimension of bias&quot; — which would be much more persuasive for some people. Fortunately, I can avoid doing all the math (and just have fun making pretty visualizations) because most of it has already been done in a research paper [here](https://dl.acm.org/doi/10.1145/3351095.3372843). In any case, the evidence is clear.

## Conclusion

This has pretty consequential societal implications.

Because embeddings are the building blocks of all state-of-the-art language models, even small amounts of bias could potentially magnify itself in downstream tasks. For example, when AI agents that make use of these embeddings are allowed to make decisions, they&apos;re going to be using a biased lens to look at the world. A biased worldview leads to biased decisions. Garbage in, garbage out.

I think trying to account for this notion of fairness / unbiasedness at the decision-level is going to be wayy more complicated (because there&apos;re going to be a lot more edge-cases to consider for each decision) than fixing the root cause, i.e., embeddings.

Also, we already have [evidence](https://www.astralcodexten.com/p/claude-fights-back) that AI is resisting change to what it was taught initially. This means that the longer we wait (equivalently, the higher up in the abstraction hierarchy we put this guard), the harder it&apos;s going to be for the AI to unlearn these biases.

I have some weak suggestions (weak because I&apos;m not really sure how feasible they are):

- We can treat the current embeddings as a starting point and tweak (&quot;fine-tune&quot;) them subject to mathematical constraints to ensure they are as unbiased as they can be. e.g. `(male - female) . (good - bad) = 0` , and others.
- Retrain the embeddings on a filtered corpus of text which excludes examples of obviously biased worldviews. I imagine obtaining a general consensus on what counts as biased (vs. factual or subjective) in today&apos;s world is going to be the hard part, not to mention the number of man-hours filtering the texts.

Nevertheless, if we&apos;re only thousands of days away from AGI, maybeeee it&apos;s worth making sure the models we get are ones free of prejudice and biased notions?

[^1]: This is a heavily oversimplified view of how embeddings are generated, to avoid distracting from the main point.

[^2]: Well, kind of, since we get a vector very close to `queen` .</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>I Built the World&apos;s First Correct Highlighter...</title><link>https://devanshshah.dev//posts/highlighter/</link><guid isPermaLink="true">https://devanshshah.dev//posts/highlighter/</guid><description>Or so I thought...</description><pubDate>Mon, 25 Nov 2024 00:00:00 GMT</pubDate><content:encoded>I built the world’s first *correct* highlighter extension for chrome. Okay, I’m mostly exaggerating.

Check it out [here](https://chromewebstore.google.com/detail/minimal-highlighter/gioopdapheoejkiekebbkjjlnckhddde). It&apos;s completely free and doesn&apos;t require any sign-up.

Read on to find out about the story behind it.

---

I read a lot. On average, I spend ~ 1-2 hours / day reading long-form content on my laptop. This mostly includes books, blogs and newsletters.

And I’m a sucker for storing things I find interesting in one place so I can find it later on, because my memory isn’t super amazing (especially when someone asks “where did you find that?”, because I’m pretty decent with ideas and concepts, but bad with sources).

Until a few weeks ago, I was using Omnivore for reading articles and newsletters. It’s basically a free + open-source read-it-later app where you can store anything you want to read. It had a pretty sleek interface and a nice integration with Notion that helped me store my highlights there.

But they shut down, just as all free open-source projects eventually do. I tried Readwise, but I found it too overweight for my needs.
I just wanted a way to highlight things I was reading and copy them as markdown so I could easily paste it in Notion, with the formatting preserved (e.g. italics, bold text, headings, links, etc.).

So, I tried a bunch of chrome extensions but they all had a lot of functional bugs:

1. Does not highlight correctly when the text is formatted
2. The order of the highlights is that of the order in which you highlight, not the order in which the text appears on the page.
3. Overlapping highlights are not merged together — which means when copying, the overlapping part appears twice.
4. Adding multiple nested spans to the DOM for each overlapping highlight

Okay the last one’s not really functional (because the highlight is displayed the same to the user) but it’s annoying to see someone implement it the “wrong” way (yes, although such design decisions are mostly about trade-offs, there are still objectively better / worse implementations).

A typical example of a wrong implementation:

&lt;video width=&quot;900&quot; height=&quot;600&quot; controls playsinline&gt;
  &lt;source src=&quot;https://imgur.com/ezRabg6.mp4&quot; type=&quot;video/mp4&quot;&gt;
  Your browser does not support the video tag.
&lt;/video&gt;

So, I decided to make my own. I thought it would take me like 2-3 hours max to build + publish. In the end, it took me ~20 hours (spread over a week) to get it right.

For example, when the selected text is across multiple paragraphs, you can’t just simply add a `&lt;span class=”highlight”&gt;&lt;/span&gt;` around the selected region because it will remove the paragraph break. So, you need to chop up the selected range into intervals, and then add spans for each of them.

But what if it partially overlaps with another highlight? How would you even detect that? And then how would you merge it? What if you need the highlight to be across other DOM nodes like `&lt;strong&gt;`, `&lt;em&gt;`, etc.? Do you still split the `&lt;span&gt;` each time?

There are a ton of edge cases here and I didn’t want to hard-code them (because I would probably have missed some of them), so I decided to use an algorithmic approach to this.

It’s similar to how you would solve the following problem: given a tree, with each node being a range (and ranges in a tree are sorted in increasing order of their endpoint), maintain the invariant that no 2 intervals overlap even as new intervals are added. And merge consecutive intervals whenever possible.

And so, what I did was:

1. Scan through existing highlights to detect overlaps
2. Add the interval to the DOM tree.
3. Run the  `merge` algorithm that checks siblings and descendants in order to merge adjacent / nested highlights.
4. When copying all highlights, detect all “enclosing” formatting tags and apply the markdown-equivalent of them.

And it works pretty nicely :)

&lt;video width=&quot;900&quot; height=&quot;600&quot; controls playsinline&gt;
    &lt;source src=&quot;https://imgur.com/8mGfY8P.mp4&quot; type=&quot;video/mp4&quot;&gt;
    Your browser does not support the video tag.
&lt;/video&gt;

Or so I thought...

I quickly realized that even my highlighter was far from perfect, and was facing multiple issues. Just not the issues other extensions were facing.

It was a more fundamental issue: in many cases, I didn&apos;t know what the ideal output should even look like. And it&apos;s, um, quite hard to build something if you don&apos;t even know what it&apos;s supposed to do.

For example,

1. If you highlight 2 separate sentences in the same paragraph, and then copy them, should they be put in the same paragraph? Or should there be aline break between them?
2. When you highlight a part of the sentence that is in an unordered list, should the markdown output have the list format? If yes, what if you highlight two disjoint parts of the same list item? Should they be in the same list item, or should there be two list items?
3. If you have a nested list, but you only highlight an inner list item, should the markdown output have the nested list structure or just a single layer list?

I decided to step back and reevaluate what I was doing.

I realized that I had set out to build &quot;the&quot; correct highlighter, but in the process, learnt that there is probably no such thing, because everyone&apos;s expectations of what the output should look like are different.

In fact, even for my own use-case, I realized that I wanted different kinds of markdown outputs at different times. For example, sometimes, I want all the highlights to be prefixed with a `&gt;` so that they become quotes, and sometimes, I want them to have the original formatting (as on the page).

So, nope, in the end, I did not actually build the world&apos;s first correct highlighter, and in fact, it&apos;ll probably never exist.

Lesson: Building the &quot;correct&quot; XYZ is a strong claim. It&apos;s much better to try to build a *better* XYZ where the definition of &quot;better&quot; is independent of the user (or at least, *many* people can collectively agree on what &quot;better&quot; is). There&apos;s rarely any one-size-fits-all solution when it comes to software, from browsers to note-taking apps (which is why you see so many similar products in the market - they cater to different groups of users).

(Also, I don&apos;t think many people would care about the 1% edge cases anyway -- they would much rather have an easy-to-use tool with a good UI that works *almost* always. And so, it would&apos;ve failed the &quot;make something people want&quot; test.)

Somehow, I feel I&apos;m satisfied with this conclusion, yet I&apos;m glad I built this anyway.

You can find it [here](https://chromewebstore.google.com/detail/minimal-highlighter/gioopdapheoejkiekebbkjjlnckhddde), if you&apos;re still interested!</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Learning vs. Getting Things Done</title><link>https://devanshshah.dev//posts/learning-vs-getting-things-done/</link><guid isPermaLink="true">https://devanshshah.dev//posts/learning-vs-getting-things-done/</guid><description>Are LLMs actually slowing you down in the long-term?</description><pubDate>Sun, 03 Nov 2024 00:00:00 GMT</pubDate><content:encoded>At this point, LLMs like ChatGPT have become a household term and hundreds of millions of people use them on a daily basis.

## AI as a Tool

It&apos;s useful to think of LLMs as just tools. Like all tools, they increase the leverage you have. If you have a calculator, you can solve math problems faster than you would on a pen and paper. In the same way, if you have a certain skill X, you can use LLMs to improve your productivity / output related to the skill X by some factor (maybe 3x, 5x or even 10x).

The key thing to note here is that you still need to have the skills in the first place. 0 multiplied by any number is still going to be 0. If you don&apos;t know whether a math problem requires addition or multiplication, you won&apos;t be able to solve it even with a calculator.

You can magnify, but not replace, your skills with AI.

## Two Modes

Broadly speaking, there are two kinds of modes you&apos;re operating under: &quot;learning&quot; mode, and &quot;getting things done&quot; mode. And these modes are not mutually exclusive. In fact, one of the best ways to learn something is to just get your hands dirty and do it. The best way to learn how to code is to code. The best way to learn how to write is to write.

![Learning vs. Getting Things Done](/images/blog/learning-gtd-modes.webp)

Other things in the &quot;learning mode&quot; set include reading books, watching videos, attending workshops. And before AI, probably the only other option in the &quot;getting things done mode&quot; was to hire someone else to do it.

That&apos;s also why when assessing someone&apos;s skills, it&apos;s often very useful to look at the previous work of the person.

But now, with the prevalence of AI, this doesn&apos;t hold true anymore. Because you can basically outsource your work to someone else (um, can we pretend this person&apos;s name is &quot;ChatGPT?&quot;), and still claim (and truly believe) that you did it yourself.

The benefits of AI in getting things done are quite obvious, and indisputable. I&apos;m personally a massive fan of these technologies myself, and it&apos;s awesome to see the unprecedented pace at which they are evolving.

But I want to talk about the cost. The cost here is the sacrifice of the &quot;learning&quot; mode in favour of the &quot;getting things done&quot; mode. The cost is in choosing to favour the short-term temptations of quick victories and visible progress over the long-term benefits of deep knowledge. [^1]

Note that I&apos;m using AI only as an example here (simply because it&apos;s the most common manifestation of this problem), but the more general principle is that taking shortcuts to get things done quickly might actually be slowing you down in the long-term.

## Costs

**Firstly**, as we said, doing X (yourself) helps you learn X better. What&apos;s more, doing X is often even more important than getting X done, because this knowledge helps you solve other related problems in the future too.

Imagine the space of all problems in the world. Now, imagine the problems you&apos;ve encountered as being points located in this space. When you&apos;re presented with a new problem, you&apos;re probably going to start by trying to find a closely related problem that you&apos;ve encountered before, kind of like performing a nearest neighbour search of this problem. So, if you&apos;ve encountered and solved a lot of problems, it&apos;ll be easier to solve related problems in the future because you are more likely to be able to find a close match (by spotting patterns, etc.) and then see if you can adapt the previous solution to this new problem. This is how we most often solve problems — we don&apos;t reinvent the wheel each time (i.e., we don&apos;t always think from first principles), instead, we reason by analogy, try to use patterns and heuristics and apply them to the problems at hand.

Also, this is not just applicable to problems, but also to ideas in general. The more ideas and concepts you have in your head, the easier it is for you to absorb new ones (because you can see how they fit in to your existing mental models by comparing them to other ideas). This is why people often say that knowledge compounds over time.

But that&apos;s not all. If you want to have original ideas (which is much harder than being able to understand other people&apos;s ideas), you need to have a dense space of points to begin with. The more ideas you have, the more you&apos;ll be able to combine several of them together, and try to uncover insights.

Most original ideas are the amalgamation of existing ideas from different disciplines, applied in a novel way. And this is quite hard to do without enough points. [^2]

So, by outsourcing a problem to AI, you&apos;re depriving yourself of the chance to add this point to your space, which means it&apos;s going to be more difficult for you to solve related problems when they arise. [^3]

Further, when you think deeply about a problem, you&apos;re exercising your mental muscles. But when you ask an LLM to solve it for you, you aren&apos;t. And if you don&apos;t exercise your muscles enough, you aren&apos;t going to be able to put them to use when you have to.

In the realm of ideas, you&apos;re also reducing the likelihood of being able to think of something novel / new. Because this process of uncovering original insights by playing around with different ideas in your head is typically done without conscious effort. You don&apos;t decide to sit down and try to combine ideas (well, you might, but I don&apos;t think people do this). This happens when you&apos;re working on something for a long time, and your mind wanders off in this space of ideas to find other points to help you find solutions for this problem (often when you&apos;re showering or commuting). It&apos;s a natural process that requires you to be actively involved and sunk deep into the problem.

(I think this happens most when you use LLMs to help you write — they follow your prompts too precisely, which means you never think of anything other than your first thoughts. Instead, if you write by yourself, you&apos;re much more likely to spot inconsistencies while writing, add nuance, and improve the quality of your thoughts.)

**Secondly**, you can probably judge your own level of skill quite well. And by using AI to do the work or simply plagiarising, you know, deep down, that you aren&apos;t developing any skill [^4].

This applies particularly to students in schools and universities who are getting started in learning programming (or even writing for that matter), where the level of imposter syndrome is already quite high. Everyone thinks others are better and know so much more than them, but in reality nobody knows everything and everyone is learning things along the way.

One of the main causes for such imposter syndrome is that a big part of software engineering (when you&apos;re getting started) is just searching, reading stack overflow and copy-pasting code. So, it doesn&apos;t feel like you&apos;re actually learning anything or have any valuable skills. You think even a trained monkey could probably do this. [^5]

AI makes this even more extreme. You literally all spend your time asking for help and trying to come up with the best ways to ask for help. You spend less than a few minutes on any one problem, and move on to the next without really understanding how it solved it. Naturally, you don&apos;t think you&apos;re improving, no matter what amazing output you show to the world (because you know that you didn&apos;t come up with it).

As a learner, you should be in &quot;learning&quot; mode, not &quot;getting things done&quot; mode (sounds obvious right?). The point of learning is also to gain the confidence to tackle bigger / harder problems in the future, and also makes you more effective.

This may sound fluff, but it&apos;s definitely not unimportant. A lack of confidence is a mental barrier to solving problems. If you don&apos;t believe you can do it, you&apos;re probably right.

You need the confidence when you&apos;re doing something new, and you get that level of (real) confidence by having a proven track record to back it up. Confidence without any track record is simply naïveté.

So, gaining such confidence is like attaching turbo boosters to a car. It&apos;s worth taking a few minutes to attach them if you&apos;re going to be driving for hours.

Concretely, this means that you should be trying to improve your skills and achieve mastery as much as possible. More so than anything. Even if it means taking longer to do something. It&apos;s better to optimise for confidence over productivity when you&apos;re in learning mode.

This is probably a sufficient reason to avoid using AI to do your work when you&apos;re getting started.

## What Next

The key takeaway from this should be to prioritise true learning rather than just getting something done. How you achieve this is up to you — some people like to read books, just get started directly (recommended), watch videos — but the important part is making this active effort.

Ironically, you can use AI to help you learn better too (though you don&apos;t have to!). I know, I know. It seems like I just spent so much time trying to convince you to not use AI. But that&apos;s not true. What I was actually saying is that AI is just a tool and it&apos;s up to you how you use it.

You have this choice between &quot;learning&quot; mode and &quot;getting things done&quot; mode every time you&apos;re solving something.

It&apos;s much more tempting to just get help to solve your problem, rather than get help to learn the concepts better.

But if you choose to, you can use AI to accelerate your learning at a faster pace than was ever possible before. You have a personalised tutor available 24/7 to help you understand better. All you have to do is ask. Instead of asking it to solve your problems, ask it to explain the concepts involved. And then have the self-discipline to actually try to achieve mastery of those concepts.

If you were in primary school learning basic arithmetic, and you had a calculator, you could do two things: 1) cheat using the calculator in the exam (assume it&apos;s invisible so you won&apos;t get caught), or 2) use the calculator as a personal grader and practise questions without relying on someone else.

Right now, each of us has this calculator. And if we use it right, we can develop our skills, deepen our understanding, and develop true knowledge, without depending on anyone else. If not, we&apos;ll wind up completely dependent on the calculators, praying that the battery doesn&apos;t run out, or that we don&apos;t ever have to solve anything involving geometry / integration / (something that can&apos;t be solved using a calculator).

The choice is ours.

[^1]: I&apos;m not claiming that &quot;learning mode&quot; is always better than &quot;getting things done&quot; mode. One simple counter-example would be for startups that need to &quot;move fast and break things&quot; to survive. But I do think most people naturally lean towards &quot;getting things done&quot; over &quot;learning&quot; (unless they&apos;re making excuses to avoid getting the work done), so I want to tilt the scales back to where they&apos;re more equal.

[^2]: If you have n ideas, you have O(n²) ways to mix 2 ideas, O(n³) ways to mix 3 ideas, and so on. If we agree that original ideas involve the marriage of 2 or more existing ideas, then you can have O(2^n) possibly original ideas with just n ideas. This is another pretty cool way to think about the compounding effect of knowledge.

[^3]: I don&apos;t think this is necessarily bad, but it&apos;s important to acknowledge that you&apos;re prioritising &quot;getting things done&quot; over &quot;learning&quot;. In fact, this kind of just-in-time learning can actually be pretty effective for people who already have the confidence to say &quot;i know i can figure this out along the way&quot;. Of course, this also depends on the context. I wouldn&apos;t want a pilot trying to learn the controls on-the-fly when the AI on his aeroplane stops working.

[^4]: Other than prompt engineering, which is very likely going to be obsolete in the next few years as AI models get better at generating higher quality output even with lower quality input, and AI researchers work on improving prompt tuning so that end-users don&apos;t have to worry about writing the best prompts.

[^5]: But in reality, you&apos;re doing a kind of literature review of things that have been done in the past, and you&apos;re adding all that to your head so that you can tackle *slightly* different problems next. And as you get better, you can solve problems that are even more different than the ones you&apos;ve seen (i.e., over time, you can make bigger leaps — in terms of euclidean distance — from one point to another, without any &quot;stepping&quot; points in the middle)</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Data-Driven Insights into Y-Combinator</title><link>https://devanshshah.dev//posts/yc-analysis/</link><guid isPermaLink="true">https://devanshshah.dev//posts/yc-analysis/</guid><description>An analysis of Y-Combinator&apos;s portfolio of startups.</description><pubDate>Sat, 12 Oct 2024 00:00:00 GMT</pubDate><content:encoded>## Introduction

Every few months, I end up scrolling through the Y-Combinator (YC) [startup directory](https://www.ycombinator.com/companies) to see the cool new startups they funded. It gives a good flavour of the entrepreneurial and tech scene in Silicon-Valley and the kinds of projects that people are working on (that have the potential to change the world).

But this time, I ended up doing something different. Instead of focusing on the uniqueness of every startup, I looked at the bigger picture, and tried to find some trends, patterns, and interesting statistics from the data.

Here, I hope to present the data in an objective manner, suggest some possible conclusions, and then, you can decide what you believe for yourself.

## Data

I found a YC-directory [scraper](https://github.com/corralm/yc-scraper) on Github which works for the most part (massive thanks to the author!), but I think YC may have recently changed their page structure, which was causing some issues with scraping the tags from the latest batches.

I used the [csv](https://github.com/corralm/yc-scraper/tree/main/data) that the author had already created (available on Kaggle too), and then added the missing data using a slightly modified version of the scraper.

In the end, I had nearly 5000 companies that YC had funded to date, starting from 2005 all the way up to 2024.

Before getting into the trends, it&apos;s important to highlight some of the key features (and limitations) of this dataset:

### Absence of Prior Distribution

This might be seem like a subtle technicality but it&apos;s not. Because we don&apos;t have information and statistics about all the startups that apply to YC in the first place (only the ones that get in), we can&apos;t reliably draw conclusions about anything that involves the distribution of companies applying for YC.

It&apos;s kind of like not knowing the &quot;base rate&quot; that we&apos;re dealing with when we&apos;re looking at the posterior probability of an event. So, we can&apos;t use this data to see what kinds of companies are associated with higher chances of getting into YC. For example, even if 60% of the companies that YC accepted this batch are AI-related, it doesn&apos;t mean your chances of getting in are better if you pitch an AI-related idea than a biotech-related idea (because a million people might be submitting AI idea, while only a thousand might be submitting a biotech idea — numbers here are for illustrative purposes only).

### Multi-label Classification

Essentially, each company can fall under multiple categories.

For example, Dropbox falls under &quot;B2B&quot; as well as &quot;Productivity&quot;, Reddit falls under &quot;Consumer&quot; as well as &quot;Content&quot;.

## The Rise of AI

Clearly, AI is all the hype right now. And here&apos;s some pretty damning evidence to back this up:

![YC Analysis](/images/blog/yc-ai.png)

The above graph shows that the proportion of YC-backed companies that use AI has seen a huge increase in the recent years. Over 60% of the companies that were accepted in the S24 batch used AI as part of their solution.

A reasonable inference is that YC is investing heavily in AI-focused companies. It&apos;s making a bet that AI is going to be the &quot;next big thing&quot;. This speaks a lot about the current tech landscape and where it&apos;s headed.

## Most Common Sectors that YC Supports

A pretty natural question to ask is: What kinds of companies has YC been funding in the past, say, 3–4 years?

This is useful information to know if you&apos;re planning on applying to YC or even just interested in getting a feel for the latest trends in technology.

![YC Analysis](/images/blog/yc-common-categories.png)

It might not have been obvious that B2B startups are the most common type of startup that gets funding by YC, even more than AI! And that developer-tools-related startups are so much more commonly accepted into YC than consumer-facing products or even healthcare / e-commerce... Yeah, I wouldn&apos;t have been able to guess this beforehand.

## Solo-Founders at a Disadvantage?

There&apos;s a [lot](https://www.reddit.com/r/ycombinator/comments/18i9dpe/why_it_is_so_difficult_for_solo_founders/) of [discussion](https://medium.com/the-launch-path/as-a-predictor-of-startup-success-whats-better-solo-founders-or-founding-teams-20f4518dbfc3) on whether being a solo-founder makes it (statistically) harder to succeed (or get into YC).

While Sam Altman was the President of YC, he [wrote](https://news.ycombinator.com/item?id=9239322):

&gt; We really prefer at least two founders, but it&apos;s not a deal-breaker.

And the data speaks quite clearly:

![YC Analysis](/images/blog/yc-solo-founders.png)

Over the past few batches, the proportion of solo founders in the batch has gotten smaller and smaller, to around 10% in the latest batches.

What&apos;s also interesting is that in the period when Sam Altman was President, from 2014 to 2019, this proportion, um, barely changed? It only started declining from 2020 onwards, after Geoff Ralston became President, and even further after Garry Tan took over.

I guess one other theory is that the ratio of solo-founders to non-solo-founders in the &quot;application pool&quot; has also gone down (and YC still accepts the same proportion of solo-founders that it sees, but this number itself has been going down), though it doesn&apos;t seem as likely.

Regarding the claim that it&apos;s harder / easier to succeed as a solopreneur, here are two charts showing the current status (whether they&apos;re active, or have been acquired or gone public or dead) of companies with &gt;1 founder, and those with 1 founder.

![YC Analysis](/images/blog/yc-status-multiple-founders.png)

![YC Analysis](/images/blog/yc-status-one-founder.png)

And while there are some cases (e.g. W06, S06, W07 batch) of clear difference, there doesn&apos;t seem to be a clear overall trend..? If anything, one can argue that there has been a higher proportion of solo-founders who end up taking the company public (a pretty clear sign of success?) of roughly 0.6% versus the 0.3% for teams with more than 1 founder. But this is based on a total of only 19 companies that went public — too small to make a strong claim.

Another theory might be: well, it is actually harder for a solo-founder to succeed compared to teams of more than 1 person, on average. But because YC already has a higher bar for solo-founders, you have a sample bias in which the solo-founders you&apos;re looking at are probably the best out there (since they met a higher bar than the other teams).

## US and The World

It probably is no shock that the largest number of YC-backed companies are based in US.

But... it IS pretty shocking that this number is more than 70% !!

![YC Analysis](/images/blog/yc-us.png)

Out of all the companies YC has ever funded, 73% have been from US, and the next top 9 are India 🇮🇳, UK 🇬🇧, Canada 🇬🇧, Mexico 🇲🇽, France 🇫🇷, Nigeria 🇳🇬, Singapore 🇸🇬, Germany 🇩🇪, and Brazil 🇧🇷.

Again, probably not what I would&apos;ve guessed?

And interestingly, this proportion seems to be relatively stable throughout the years (except during Covid), with a gradual increasing trend of non-US companies:

![YC Analysis](/images/blog/yc-countries.png)

During Covid (2020–2022), the proportion of non-US companies reached its all-time high (of ~40% in 2021). Note that in this period, the YC program was held remotely, which is probably why more people around the world could apply and attend the program, without the &quot;hassle&quot; of having to move to another country (and things like a visa couldn&apos;t get in the way). This is consistent with the sharp drop in the proportion of non-US companies after Covid, when YC moved back to its in-person (in San Francisco) program.

Even then, it seems quite surprising that such a high proportion of companies that join YC are based in US, when YC itself has achieved global fame. Here are some probable theories:

1. Maybe YC *does* take into account where you&apos;re based and how likely you are to move to Silicon Valley for the 3 months, which is why it actively leans towards supporting US-based companies more than others.
2. This &quot;country&quot; field is the country where the *company was registered* — not where the founders came from. It&apos;s possible that the founders are another country but haven&apos;t incorporated the company before joining YC and so, when they join YC, they just decide to incorporate it in US (which causes the number of &quot;US&quot;-registered companies that are accepted into YC to increase).

## Future Work

While this dataset is pretty great, there&apos;s a lot more that can be done! Here are some ideas for future improvements:

- **Including valuations and funding amounts in the analysis**: I don&apos;t think the YC website itself has the current valuations for each of the startups. But I did find this website — &lt;https://ycdb.co/&gt; — which has more information about the valuations, and a ton of other metrics.
- **More Detailed Features**: It might be interesting to analyze which &quot;features&quot; are most correlated with success (in terms of valuations). I&apos;m almost certain that YC does something like this internally too, and they probably have a list of the top predictors of a startup&apos;s success (based on their portfolio), even including things like &quot;founder&apos;s past experience&quot;, &quot;founder&apos;s attitude&quot;, etc.
- **IK-12**: I wasn&apos;t sure how to deal with the [Imagine K12](http://www.imaginek12.com/our-startups.html) &quot;batch&quot; (since it&apos;s not *really* like other batches) but more of an aggregation of all edtech startups since 2016. For the current analysis, I treated it as a batch in its own right but it probably makes more sense to treat it as a separate dataset altogether. And do note IK-12 does not mean that the batch year was 2012.

Any other ideas / thoughts?</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>The BIG Life Questions - Answered</title><link>https://devanshshah.dev//posts/the-big-life-questions-answered/</link><guid isPermaLink="true">https://devanshshah.dev//posts/the-big-life-questions-answered/</guid><description>No, the answer isn&apos;t 42.</description><pubDate>Sun, 06 Oct 2024 00:00:00 GMT</pubDate><content:encoded>Why did you open this article?

No, but seriously, why? What were you hoping for?

Were you expecting this to be THE article that changes how you view life and solves all your problems?

If you’re honest with yourself, then thinking about this question will already speak a lot about your current mindset. And you’ll have everything you need to realize what you need to do in order to break free.

Well anyway, I do hope it’s going to change how you view life. But unfortunately, it’s not going to solve all your problems.

## The Questions

The most common questions that almost everyone [^1] grapples with are:

- What is the purpose of life?
- How do I find my purpose in life?

And these seem like good, innocuous questions. Because they force you to think long-term, about your life as a whole, and where you want to be heading.

I’ve been thinking about these for months now, and I’ve finally come to a point where I feel pretty satisfied with my views on this. Figuring this out has helped a lot (you’ll see how). So, I decided to share it, hoping it benefits others too.

## My View

I think they’re bad questions to be asking. For multiple reasons.

1. Firstly, they sound like awfully simple questions to answer, because each question is &lt; 10 words long — “how hard can the answer be if the question is so short?” — when in reality they are overloaded questions.
2. At the same time, they feel like cosmic existential questions (e.g. how did the universe come into being?). And because of that, we expect the answer to such questions to be some universal truth, like gravity. We expect “the answer” to have a certain solemnity and weight.
3. These are highly “personal” questions. That is, the answers to these questions depends on who’s asking it. And so, what might sound like a good answer to one, might sound terrible to another.
4. Perhaps most importantly, the questions are phrased in a way that makes sound as if there needs to be a single big purpose of life. Why can’t someone have multiple purposes?

In a sense, I think we’re putting too much pressure on the question by making it sound as if it is the most important thing in the world. And by doing so, we’re putting too much pressure on the answer — by expecting it to be life-altering.

And I don’t think anyone has figured out a concrete answer to these questions anyone. In truth, everyone is just figuring things out along the way — no one knows exactly how they want their entire life to turn out to be.

So, the best answers so far are mostly meta-answers: they’re a way for people to come up with their own answers (without having much confidence in them).

## Consequences

I think one of they biggest issues (at least, for me personally) is that these questions are so deep and existential that they consume your entire mind.

Once you start thinking about it, that’s probably all you can think about.

It’s like your mind is paralyzed and can’t do anything else until you’ve answered these questions. You lose all motivation to do everything else and fall into a nihilistic mindset (at least until you come up with a satisfactory answer).

And since there is no way of knowing whether the answer you come up with is even right, you probably end up spending too much time thinking about it. Analysis paralysis.

That is, they end up doing more harm than good.

But all is not lost.

## Solution

I think asking such questions is good (for the sake of pausing and reflecting), but you shouldn’t ask them with the intent to actually find an answer. Because you probably won’t [^2].

Importantly, it’s okay to not have the answers to these questions. You can’t be expected to plan your ENTIRE life and know what you want out of it. And even if you did, you’re probably not sure about it. What if you think you know what you want, and a few years later, you realize you want to change course? Wouldn’t you?

So, figuring out your “life purpose” is just too big of a problem to solve.

And taking inspiration from computer science, how do we deal with a big problems? We [^break](www.google.com) it down into smaller sub-problems and solve them instead!

And that’s exactly what I did.

We can rephrase the questions to make them more flexible (i.e., expanding the set of valid answers by loosening the constraints), by making the following observations:

- There’s no reason why you can only have one purpose in life.
- There’s no reason a person’s purpose needs to be fixed. It can evolve over time, as life goes on.

So, instead of thinking of “purpose” as a singular life-long existential thing, we can view it as something that you focus on for a while, before finding your “new purpose”.

It’s a “mini-purpose” — a purpose but for a smaller period of time. Like a year, or 3 years or 5 years. [^3]

In *that* sense then, a (mini-)purpose is just… a goal?

That’s right!

And that relieves a lot of the pressure on finding your purpose in life, because now you can just ask yourself “what goal do i want to work towards?”

Which is a lot easier, because instead of letting an overwhelming wave of existential crisis sweeping over you, you can actually figure out the answer to this. Calmly.

So, it doesn’t have all the negative-effects of the “big” questions.

You can have long-term goals, which give you a direction to work towards, and then, you can convert that into actionable steps. And that’s usually enough to get you going.

If you’re not sure what goal to work towards, my personal answer is to [follow your energy](https://youtu.be/uxoCnxlxpIk). Do whatever you’re excited about. If you’re using a checklist or a pros-and-cons table to decide what you like, throw it away. You already know what you like. You just have to listen to yourself. And be honest when you listen.

If you have a burst of inspiration to do something (e.g. play the piano, or start a new project), do it at that time. Don’t wait for later. Inspiration is perishable. It’s just your “inner voice” talking to you. If you ignore it enough times, it’ll stop talking. But when you’re inspired, it’s like an infinite source of energy that you can tap on. Don’t underestimate its power.

You already have everything you need to find your purpose, and be happy. Nothing you don’t have right now can make you feel more satisfied. You’ve gotta earn satisfaction by doing things you’re proud of. You’ve

And don’t think too much [^4]. It drains a lot of energy, and makes you indecisive. It also kills inspiration. Because you’re not making any progress when you’re just thinking. The way to keep inspiration alive is by actually doing — it’s a cycle: doing replenishes inspiration, which fuels your actions.

If you show up consistently and just do whatever excites / interests you (with some discipline), I think you’ll be fine.

And you can actually enjoy what you’re doing. You can actually enjoy the journey. You can actually enjoy life — because you like what you’re doing.

Like Kobe Bryant said:

&gt; Those times when you get up early and you work hard; those times when you stay up late and you work hard; those times when you don’t feel like working, you’re too tired, you don’t want to push yourself, but you do it anyway; that is actually the dream. That’s the dream. It’s not the destination, it’s the journey.

## Tl;dr

- “Purpose” is just a glorified way of saying “goal” [^5]
- You can (and almost certainly will) have more than one goal in life spread over different years in your life. [^6]

Initially, I used to think that the purpose of life is the pursuit of purpose itself. It sounds fancy, but what it probably translates to is “spend all your life figuring out your life’s purpose, and that is your purpose”, which sounds kind of… bad? It sounds like having a constant existential crisis?

Now, I would much rather have goals and work towards them, and be happy while doing so.

I’d love to hear your thoughts on this too! [^7]

[^1]: almost everyone *reading this** — because a large proportion of the world population doesn’t have the privilege (*yes*, privilege) to be thinking about this. You’re already on the second-highest level in Maslow’s hierarchy if you can afford to be thinking about this.

[^2]: I’m not saying that we shouldn’t ask difficult questions that we probably won’t find answers too — in fact, that’s what science is all about. What I’m saying is that asking such questions does more harm than good and doesn’t leave you any better off.

[^3]: The reason you shouldn’t set goals that last beyond a certain threshold time horizon is that things will probably change too much in that time. You will change. Your desires and goals might change too. Life might get in the way. You never know. I don’t have an exact threshold but I think a few years is long-term enough to help you focus on the bigger picture (which is the main point), while keeping it actionable and relevant.

[^4]: A good rule of thumb I’ve developed is to not think about X for more than 10% of the time it’ll take to do X (or the time for which X will impact you directly). Most of the times, though, you already know the answer. You just don’t want to make the decision. Have confidence.

[^5]: I guess another common way to view purpose (that I didn’t talk about here, because it’s quite vague and doesn’t feel as “real”) is as a meta-goal — something that informs how you choose your goals. I like to think that’s more of your “identity”: who you are decides what you want to do. Maybe it’s just a matter of semantics, but even so, I’d prefer making it slightly less abstract and more actionable than something like “I want to change the world”. In any case, I think the key idea of this is to answer the “why” — why are you doing whatever it is you’re doing? — which I do think is important in keeping you motivated to achieve your goals.

[^6]: I think it’s good to have only one big goal at a time (maybe for a few months or years?) because that helps you focus. Big, here, is defined as something that requires a considerable amount of your time and energy. So, it’s almost by definition, that having too many big goals means you split your time and energy and therefore, don’t end up achieving any of them. Okay, maybe I’ll save my thoughts on this for another time.

[^7]: This article reflects my *current* views. Of course, they might change over time.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Debunking Myths Regarding Tech Internship Applications</title><link>https://devanshshah.dev//posts/debunking-myths-regarding-tech-internship-applications/</link><guid isPermaLink="true">https://devanshshah.dev//posts/debunking-myths-regarding-tech-internship-applications/</guid><description>And why you should be wary of common advice</description><pubDate>Sat, 04 Nov 2023 00:00:00 GMT</pubDate><content:encoded>Disclaimer: The views and opinions expressed in this article are solely those of the author and do not necessarily reflect the views of the author’s former, present or any future employer.

The purpose of this article is **to disillusion students regarding the myth that you do not need to work hard (aka “grind”) in order to land your dream tech internship**.

Some words of caution to prevent any misinterpretation or misrepresentation:

1. This post is mainly intended for students who’re aiming to land Software Engineering (SWE) internships at the top tech/quant firms, which conduct technical interviews involving coding a solution to a problem (generally related to data structures and algorithms).
2. I hope simply to provide another perspective on the highly discussed topic of internship applications, a perspective that I believe is missing from the current discourse.
3. My intention here is not to criticize any specific person or entity or hiring practice in any way.
4. Of course, everything here is simply _my opinion_ (not a “fact”) - you can prefix “In my opinion” to the beginning of every sentence if you wish to :)

## Context

As a student, I’ve been following discussions on internships and what you need to do to prepare for them for quite a while now. I’ve been seeing a lot of articles/videos (created by well-meaning people, I’m sure) that give advice such as “stop grinding leetcode” and “no one has time to solve hundreds of questions”. While their intention might be to help students prepare better by using their time more effectively, I think it does more harm than good. The reason? Their premise is a myth.

By “myth”, I mean that such claims paint a misleading picture to unsuspecting students, and is nowhere close to the truth. I think it’s a myth that you can get into the top companies without the necessary “grind”. Of course, there are some exceptions to this. But they must be seen for what they are - exceptions, not the norm.

Broadly speaking, people who give such advice belong to one of 2 categories:

1. Category 1: Those who have never been offered an internship/job with these companies.
2. Category 2: Those who have.

Let’s look at each of them in turn.

## Category 1

Their advice generally doesn’t have any evidence backing up, _not even anecdotal_. Not many people would believe them, so they don’t have much of a following. In other words, people seldom take them seriously anyway.

As a digression, note that this is not true in general - for the majority of intellectual discussions, you don’t need any “credentials” (eg. a PhD or even a degree) to have the right to speak. You’re judged (and rightfully so) based on the actual content and validity of your theories/arguments. As a concrete example, even though I’ve no formal learning in biology, I can very well propose theories if I choose to and they would have to be judged based on their merits, not based on my credibility.

But in case of internship applications, there’s no real “authority” or “credentials” you can establish anyway except by going through the process and doing well in it. That is, it’s much harder to prove the correctness of your theories/claims apart using empirical data, and personal experiences. And since accurate empirical data regarding this topic is unlikely to be obtained, the best that people can offer is anecdotal experiences.

But since they’ve never actually made it through the interviews themselves, their advice lacks weight. They’re the armchair critics who say they can do a better job refree-ing while watching a basketball game.

## Category 2

These people are far more convincing. They have the credibility because they’ve “been there, done that”. They try to curate small lists of questions that they believe “are sufficient” to crack the interviews.

The best way to prove that their advice is a hoax is to ask them a simple question: “How did you prepare when you were applying for internships?”. This question gives a far more accurate picture of the reality than asking “How do _you think_ I should prepare while applying for internships?” (which is the question they’re trying to answer).

Such people, in general, have themselves spent countless hours solving problems on Leetcode and other platforms - which is how they managed to pass the interviews and get an offer. They probably wouldn’t follow their own advice of only solving a selected set of questions even if they had to do it all over.

Note that I’m not saying that these curated lists are “useless” - I think they often contain a wide range of questions which exposes you to new patterns and approaches, and so they’re a great way to get started with learning the concepts. But by no means are they sufficient. Just knowing the concepts/patterns is not enough - you need to be able to spot them and apply them. And this takes _consistent_ hard work.

Yet that’s not the advice they give to people - they tell others that it’s possible to get offers from top companies without grinding. Why do they preach what they wouldn’t practice? I honestly don’t know why - and I don’t wish to make any assumptions regarding their intentions.

Even if they _think_ that solving hundreds of questions did not help them get the offer, how do they _know_? Solving questions is not a one-dimensional exercise - it does not only help build your data structures and algorithms knowledge. It also:

- improves your general problem-solving skills: this is the most important area, and I’ll come back to this towards the end
- improves your pattern recognition skills: if you’re worked on a wide range of questions, across a wide range of topics, you can easily spot the right approach/pattern when a new problem is given to you, by finding some similarities with previously solved problems.
- improves your proficiency with the standard library (and commonly used functions) of the programming language of your choice so you don’t have to look up the documentation during the interview.

In general, such advice misleads people into believing that they can “achieve anything they want” without putting in the necessary effort. It gives people the impression that it’s possible to succeed without much hard work. And this is simply not true.

When people believe such statements, they end up putting in less effort than they would have otherwise. In other words, they get complacent and to a certain extent, lazy. And laziness is not a virtue. Similarly, encouraging people to take “shortcuts” (when _they themselves_ did not) is not noble. Encouraging laziness is not noble.

Put bluntly, there’s nothing virtuous about sacrificing hard work under the disguise of “work smart, not hard”. Wrong! You need to work hard _AND_ work smart if you want to be among the best.

If you want to reach the 75th percentile, you can probably still achieve this by only solving a list of questions curated by someone else for you. But if you want to be at the top - among the 1% - you can’t let others decide what you should study and what is “not that important”. The law of diminishing marginal utility applies here as well - it’s much harder to improve when you’re already “good enough”. But that doesn’t mean you shouldn’t. Anything worthwhile in life is likely going to be hard.

And if it’s _really_ your _dream internship_, why would you not want to give it your best shot? Why would you want to shortchange yourself by paying heed to people who ask you to work less? Why would you willingly risk not preparing for something just because someone says it’s “not that important”?

## Some Preemptive Rebuttals

1. “Are you saying that grinding leetcode guarantees getting into a top firm?”

   No. Nothing “guarantees” that. I’m simply saying that hard work improves your chances of getting into the top firms. I’m claiming that hard work is a necessary, but not sufficient, condition to landing such roles - luck definitely plays a factor, but since that is, by definition, not within your control, you’re better off focusing on what is in your control - working hard. The more you prepare, the less you need to rely on luck.

   But if you don’t prepare enough (and deep down, you’ll know if you didn’t), don’t try to blame it on luck.

   Also, this is just one part of your preparation journey. You’ll also need to work on your resume, communication skills (being able to explain your thought process during interviews), answering behavioural questions, and (perhaps the most underrated) building emotional resilience so you can brave the rejection emails you might receive.

2. “Why are you singling out LeetCode”?

   I’m just trying to use a familiar example. The same argument applies no matter which platform you use to prepare - Leetcode, Codeforces, Hackerrank, Codechef - as long as you know that you’re trying to cut corners (though to be fair, if you’re preparing for technical interviews on codeforces, you’re likely already good enough xD)

3. “Are you saying that everyone should be grinding leetcode?”

   Nope. You’re free to set your own goals in life, and I’m nobody to judge you for that. It’s perfectly okay not to be attracted towards such jobs - eg. you may enjoy working at startups more because they’re super fast-paced and fun!

   But this particular post is only aimed at bursting the bubble of people vying for tech roles in the top companies, as I mentioned at the beginning :) It should not be treated as general advice for everybody, simply because everyone has different goals and aspirations in life, and so naturally, the same advice can’t apply.

4. “So how many questions should I do?”

   I’ve intentionally avoided giving such a number, because such a number simply does not exist. Different people require different amounts of practice - it’s true in school, it’s true in university, and it’s also true in preparing for internships.

   I can give you a good heuristic however - keep practicing until the point you can solve _almost any_ new problem in under 10 minutes (or you feel “bored” doing new problems because it feels you’ve done the same thing so many times).

5. “Which topics should I focus on more?”

   Again, I can’t give a straight answer to this (and that’s not the main focus of this article anyway) because _it depends._ It depends on your current level of knowledge/mastery, what kind of role you’re looking for, and

   As a general rule of thumb, focus on the fundamentals first before moving on to more advanced topics. Then, focus more on the topics you’re weaker in.

6. “I’ve seen IOI medalists getting internships without doing any leetcode.”

   More generally, there’s a category of people who have worked hard enough during their high school days (and proven themselves by taking part in IOI, IMO, etc.) for whom such interviews may seem like a breeze. The key point is that they’ve already worked hard previously to reach a level of mastery and proficiency to comfortably pass these interviews - before everyone else even started. Don’t mistake their (possibly) present lack of efforts as evidence that you can get away without working hard. They’ve already put in the hours - it’s your turn now.

## My Advice

I think part of the problem is manifested in the way we talk about this topic itself. In particular, the word “grind” implies that the action is repetitive and, to an extent, mindless. But that’s not what problem solving is about!

My personal take is that you should enjoy the process - I know it sounds very idealistic but hear me out. When I started solving Leetcode problems, I too found it to be a chore. But after about a week, it became a routine and I started to look forward to it - heck, I even started to enjoy it! How?

Let me explain. For most people, solving such problems is a means to an end - the end being landing a tech internship/job - and this mindset makes it harder to sustain the motivation of solving problems.

Allow me to propose another way of looking at things.

The ultimate goal is not just to be able to solve the problem in front of you → the goal is to use the current problem to build your problem-solving skills and solve new problems you’ve not encountered before. Viewing every problem you encounter through this lens means that you focus on not only solving the problem but also spending time figuring out (and hopefully, writing down) what you’ve learnt from this problem that you think might be useful in helping you solve new problems (e.g. a new algorithm, structuring your code in a better way, a neat math trick, a unique optimisation). This puts less pressure on actually solving the problem, since the main focus is on _learning_ through the problem - hopefully this shift in perspective encourages you to enjoy the problem too :)

## Conclusion

Tl;dr: Consistency is key. Focus on learning by solving as many problems of different kinds as you can and writing down notes on what you’ve learnt through that problem. Do your best. Ignore the people that say you don’t need to work hard and solve hundreds of problems to get your dream internship because they probably did the same to get where they are.

Moreover, this discussion is not limited to preparing for technical interviews. It’s true for almost all situations in which there is cut-throat competition (along with some irreducible luck factor), and you need to maximize your chances of being _at the top_. You’d be doing yourself a disservice by not putting in your 100%. As the short, wise green man said: “do or do not; there is no try” → either put it in your 100% or don’t bother.

A famous quote by Germany Kent is “If you never try, you’ll never know”. I’ve taken the liberty to modify it as such:

&gt; _If you never try **your best**, you’ll never know_</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Time Value of Money - What it *really* means</title><link>https://devanshshah.dev//posts/time-value-of-money/</link><guid isPermaLink="true">https://devanshshah.dev//posts/time-value-of-money/</guid><description>An intuitive explanation of the concept of Time Value of Money</description><pubDate>Wed, 26 Jul 2023 00:00:00 GMT</pubDate><content:encoded>## Motivation

There&apos;s so much jargon and math involved in explaining basic financial concepts that people often don&apos;t understand the bigger picture - why money works the way it does and how time affects the value of money.

This article does NOT provide a rigorous mathematical analysis (no, we have enough textbooks for this) but aims to improve conceptual understanding using simple concrete examples. Once you know how the financial world works, the formulae become self-evident and intuitive. (it feels like a cardinal sin to teach people the formulae without telling them how the formulae came into being → a formula is not an arbitrary collection of symbols, it&apos;s common sense once you&apos;ve understood the logic)

Throughout this article, for the sake of simplicity (and to show that inflation is an entirely different, though related concept), we assume there is no inflation (i.e., the cost of an item - say, a chocolate - is the same today as it will be anytime in the future).

Let&apos;s start with a behavioral experiment: If you had the choice, would you rather get \$100 today or \$100 a year from now? Assuming you&apos;re like most people (and rational), you would much rather get the money today. Why is that so? Because fundamentally, we prefer certainty over uncertainty, the present over the future. The future is more uncertain than the present - we don&apos;t know what can happen from today to next year. Notice that this is true even if there is no inflation (in terms of chocolates, if each chocolate costs \$2 today, you can buy 50 chocolates today. And since the cost of chocolate remains the same next year too, you can buy 50 chocolates using the $100 next year too).

But it&apos;s just not the case that we prefer money today over the same amount a year from now because of our tendency to avoid uncertainty - in fact, it&apos;s purely rational in the economic sense too.

You&apos;ve probably heard that money today is “worth” more than money in the future. But what does that really mean?

If \$100 today can buy 50 chocolates today, and \$100 a year from now can buy 50 chocolates too, in what way is the money today worth more? This is actually a really insightful question.

The only difference between the 2 scenarios is that they&apos;re separated by time - one year to be precise. This means that if you get the money today, you can “do something with it” and possibly make a profit using this money.

I deliberately use the (admittedly vague) phrase “do something with it” because the truth is that you can do tons of things with it - put the money in a bank (and gain interest), invest in the stock market (and possibly make a fortune), start a business of your own (and make profits), etc. These are all the things you can do if you get the money today.

On the other hand, if you only get the money next year, you can&apos;t use that money to do anything between now and next year. So, this opportunity of “doing something” (which we will now call an “investment opportunity”) is delayed by a year.

Observe that none of the above investments are directly related to inflation.

And that is the true “time value” of money. The same amount of money today is worth more because you can invest it and earn profits through the investment. This is called the “earning potential” of money in the time period.

Okay, so now we know that \$x today is worth more than \$x a year from now. But what if we wanted to calculate exactly how much \$x today is worth a year from now?

Well, we can consider this scenario: if you receive \$100 and just put it in your savings account (with a 3% interest rate), you&apos;ll have \$103 at the end of the year. So, \$100 today is worth $103 a year from now.

But wait. What if you decided to use the \$100 to create your own cryptocurrency (or a dropshipping business) and that grew to a \$10,000 company in a year. Does this mean that \$100 today is worth $10,000 a year from now?

The answer is no. The reason is that anything physical you do in the real world has some inherent risk associated with it. It could very well be the case that your cryptocurrency (or business) fails and you&apos;re left with nothing. So, there might be a 0.01% chance that your business succeeds (and you end up with \$10,000) and a 99.99% chance that it fails (and you have $0).

But there are (literally) an infinite number of ways you could spend the \$100 - so how do we calculate the exact “worth” of it in the future?

We can consider the scenario where we invest the \$100 in a “riskless asset” - basically something with a zero (or near-zero) probability of not paying back the money it promised to. Depositing your money in the bank is essentially a “riskless” investment for all practical purposes (well, it might have some risk if the bank goes bankrupt and is unable to pay you back). Buying government bonds (of “stable” governments) is also practically riskless. This simple idea also implies that all riskless investments must have the same yield/returns.

In our example, if the annual interest rate is 3%, \$$x$ today is worth \$$1.03x$ a year from now.

This also means that if you have the choice to pick between receiving \$100 today and \$200 a year from now, you should pick the latter (unless you have some really clever plan to make money or desperately need it).

Now what if you want to calculate how much \$100 a year from now is worth today. In other words, how much money should you be given today that will be equivalent to giving you \$100 a year from now. Well, the answer is simple (because now you know how money works!): if you&apos;re given \$$\frac{100}{1.03}$ today, you can deposit it in the bank and at the end of the year, you&apos;ll have \$100 (since interest rate is 3%).

![Time Value of Money](/images/blog/time-value-of-money/time-value-of-money-1.png)

More generally, assuming an interest rate of $r$% compounded annually, \$$x$ today is worth \$$x(1+r/100)^t$, $t$ years from now.

Using the above formula, we can “move money through time” since we know exactly how much any amount of money is worth at any time in the future. Similarly. can bring “future money” into the present too.

## When Inflation Rates are Non-Zero

As a last example, let&apos;s consider the case where the inflation rate is not zero - suppose it is 5%. This means that the price of goods (chocolates, in our case) rises by 5% over the year. So, if chocolates cost \$2 today, they&apos;ll cost \$2.10 one year later. This means that even if we have the same “numerical amount” of money (i.e., $100) one year from now, we will be able to buy fewever chocolates. That is, inflation causes the “value” of money to erode over time.

Note: ”numerical amount” is correlated with “value” but does not include the aspect of time. If you shove \$100 in your pillow and take it out after 10 years, it&apos;ll still be \$100 numerically, though it&apos;s actual “value” would be much lower than the $100 you had put in → because of the inflation caused by time and the earning potential lost. In other words, if you want your value of money to remain constant over time, it&apos;s numerical amount must increase.

HIgher inflation rates mean that the value of money erodes faster, and so, money today is worth much more than the same “numerical amount” a fixed time period from now.

Another way of looking at it is that when inflation rates are high, you “discount” the future more, i.e., your “future money” is worth less than it would be without inflation (both of which would be less than your “present money” - assuming the same numerical amounts.)

![Time Value of Money](/images/blog/time-value-of-money/time-value-of-money-2.png)

## Time-Money Equivalence

Bonus: there&apos;s a much deeper connection between time and money, a connection that transcends finance and economics, or any discipline for that mater. Think about this: when you work, you&apos;re being paid for your time spent. That is, the money you make tells you how much your time is worth. On the other hand, if you don&apos;t want to do some work (e.g. drive somewhere), you can pay somebody else to do it for you, and suddenly you free up that time. So, you can create money by spending time, and you can create time by spending money! The adage “time is money” is literally true - time and money are equivalent in the real world, just as mass and energy are equivalent in physics.

## Conclusion

I hope you have a better understanding of how time can (literally) “create money” and why time plays such an important factor in understanding how money works.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>How to Build Great Tech Products</title><link>https://devanshshah.dev//posts/how-to-build-great-tech-products/</link><guid isPermaLink="true">https://devanshshah.dev//posts/how-to-build-great-tech-products/</guid><description>A Guide for Product Managers and Growth Leaders</description><pubDate>Mon, 03 Jul 2023 00:00:00 GMT</pubDate><content:encoded>## Why this article?

Almost all resources out there contain _generic_ advice on product management, which isn’t very useful to someone who’s actually looking to practice it. So, I decided to gather some concrete examples of how and why tech products succeed and the stories of the heroes behind those products.

This article contains **actionable insights** from the successes and failures of 4 product leaders, all of whom ultimately built successful products.

## Jeff Lawson

CEO of Twilio.

- Lessons from Twilio’s journey: 1) Know exactly what you want to accomplish and who your customers are 2) Have conviction in your hypothesis even if (especially if) it is against conventional wisdom
- Build something that you need, or at least what you would use (or would have used) at some point in your life. Before you write a single line of code, talk to potential users to see if there’s even a real need for it (i.e., are you solving a _real_ problem?)
- Always have the willingness to try new products, new things. You never know when your “side product” can become your main business. Follow your customers — if they ask for new features or products and you think it’s a cool idea, try it out.
- Follow your gut. It’s okay to make mistakes but it’s not okay to not try at all or do something you’re not convinced about. Sometimes getting distracted by chasing the shiny things isn’t so bad, but you need to balance exploration (try new stuff) with exploitation (investing in your core product). Manage your resources (time, money, effort) well.
- You don’t know what’s going to be the next big thing so you can’t just have 1 big bet. Don’t put all your apples in a single basket. Have multiple bets which all have the potential to be the game changer. Increasing the number of such bets you make also increases your odds of success.
- When you run experiments or build new products, don’t expect them to become giant businesses overnight. Don’t measure them in dollars but instead in how much you learnt from it.
- When you learn you’re onto something, when your customers are growing, when your product’s becoming successful, be willing to invest heavily into it. Double down in real time when you see the signs of success.
- Build strong relationships with your customers. Once you have users, try your best to retain them. If your customer is a business and is paying millions of dollars, you better have sales reps that are regularly in touch with them and keeping them happy. Customer service is essential especially when there’s no shortage of competitors in your industry. So it’s in both yours as well as the customer’s interest to know what they’re thinking so you can try and help them (and consequently retain them).
- When things go wrong, do a post-mortem to figure out the root cause. When things go right, do a post-mortem to figure out the key principles or lessons that can be generalized. In short, treat every experience, good or bad, as a case study and analyze it so it helps you in the future.
- Good decisions sometimes lead to bad outcomes. Bad decisions sometimes lead to good outcomes. There’s a lot of luck involved, but on average: make good choices, great things happen.
- If a single bug by a developer can break an entire website, don’t blame the developer (after all, humans always make mistakes). Figure out the root cause — why was there ever a system that would fail entirely because of a single mistake? Ask “Why” 5 times to figure out the root cause (in fact, someone once told me that asking “Why” 5 times is enough to make someone cry).
- “Every day, our goal is to suck a little bit less” — accept that there are some things your company is not good at but just try to improve on those things.
- Write things down. PowerPoint cannot be used as a decision making tool — don’t mix emotions with decisions that need to be analyzed rationally. Use the written word to argue the case and make decisions based on detailed analysis, not flimsy PowerPoint slides. Bullet points destroy information — and the devil lies in the details. When you abstract away the details too much, ideas get lost — you lose touch with reality.
- In fact, the act of writing a narrative essay explaining an idea without having intellectual clarity yourself is really hard, so it forces you to know what you’re talking about. In contrast, in PowerPoint you can just shove in the keywords, some good charts, and bullshit your way through the talk. Whenever you want clarity of thought, try it write it down.
- Ruthlessly prioritize. If the executive team never argues, it’s a problem. It’s a sign that everyone’s getting their way, which means that there’s too much on the “goals list”. But if you restrict the number of goals to 3, people would start arguing about which goals are more important than others. So, prioritizing lead to (necessary) arguments and disagreements that help to clarify the vision of the company.
- Your budget is your priorities. First decide what you want to get done — debate this rigorously. When you’re allocating budget, allocate based on the priorities.
- Goals should be prioritized (numbered in order of importance) and their metrics (to determine whether a goal has been met or not) must be clearly written down too. In fact, if you have multiple metrics, you should list them in order of importance. This is better than OKRs because objectives aren’t ordered, and people tend to focus too much on the measures. The benefit of priorities is that they communicate the commander’s intent — what exactly are we trying to achieve?
- Don’t be obsessed with measures. Measures just tell you whether you’re on the right path. Charting the right path is the real hard part.
- If you’re not in close proximity to the customers, you can’t feel the impact of the product you’re developing and that sucks the passion out of it (and it feels like clerical work). If you’re just building something based on the specs of a PM (who heard stuff from the sales team), everyone feels disconnected from the real customer and you feel as if it’s all hearsay. Instead companies should ensure all employees can see the big picture and the part they play in it so that they feel inspired by it and can execute it to perfection. (This is how startups work because you basically have to do everything and the complexity is small enough to keep in your head).
- For every team, define the customer, a mission, and the metrics to evaluate progress. Keep teams small enough to function as a startup. Scale erects walls — people start working dispassionately in silos and don’t care about the big picture, and you should try hard to avoid this.

## David Lieb

Senior Director of Google Photos.

- Don’t take no for an answer. Sometimes it’s okay to be stubborn and stick to your guns.
- Show, not tell. It’s easier for people to understand what you’re saying when you show them (using a demo). Give a transformational presentation that inspires people. Go above and beyond.
- Have the confidence that the problem you’re solving is real and when you build the product, users will come. But your confidence needs to be based on at least some evidence. It’s better to have a small group of people love your product than lots of people just like your product. This small group of people will rally for you, give you feedback, and be your cheerleaders.
- To get others to help you, you need to help others too.
- Acquisitions are a great way to get smart people who have diverse perspectives to join your company.
- How to hire the right people? 1) They need to have the same values — this is non-negotiable 2) They need to be aligned with the company’s mission. 3) They need to be confident, independent thinkers who will bring a different perspective and disagree with you. Their confidence needs to be credible — do they have any previous experience or learning? Do they know what they’re talking about or are they just confidently rambling nonsense? (So you need high level alignment but you also want disagreements in which paths to take to reach the final goal)
- Best questions to ask: “If you were the owner of product X, what would you do? What would you change? How would you implement that? Why are you so confident about that?” Poke people deeper and deeper to separate the bullshitters from the real learners.
- The most dangerous kind of person to hire is someone who’s confident but can’t articulate why he’s confident in his opinion. It just means the confidence is unfounded and likely unrealistic. It’s just so tiring to interact with such kind of people who always think they’re right but can’t even explain why.
- User retention is sometimes harder than user acquisition. Figure out both.
- What do you do when you don’t know what to do (for consumer products)? Go talk to users. Ask them which features they like, don’t like, how frequently they use it, etc. Don’t ask them super vague/general questions (e.g. what are some pain points in your life) because they rarely ever elicit valuable insights. Ask specific questions about the product (e.g. why do you use our product?) or a feature or anything that you can work on. Sometimes users are using your product for a completely different use-case than you intended. Understand the motivations of users — ask WHY.
- How to find real problems? Ask yourself: what are some minor inconveniences or annoyances you face in your day? Dig into those because they may be symptoms of a deeper, much bigger problem. Then ask others (your friends, family) whether they face similar problems too.
- If you think you should fire somebody, you should fire them.
- Don’t discount ideas you think might not be appealing to a lot of people. Have a portfolio of product bets, each with a different level of conviction. If a feature is not very hard to build but has the potential to give great returns, just do it (even if the probability of success is low).
- Attention to detail + going deep into the problem is the key to being a successful product managers. The higher your seniority, the more you lose touch with the actual product (yet the more decision-making you do, which makes it dangerous). You also need to convince people to disagree with you, by inspiring them. The best product managers understand the capabilities of their tech and design team and they plan accordingly.
- Ask yourself how excited you feel about building this product? If you’re not excited about it, how are you going to get users excited about it? Be honest to yourself while doing this little thought exercise. Change the narrative to inspire yourself or change what you’re building.

## Nate Stewart

Chief Product Officer at Cockroach Labs.

- Have a clear roadmap for what the company is about, and say NO to customers whose use-case doesn’t align with your product. They may go to your competitors and that might be demoralizing but have the conviction that your strategy will eventually lead to success.
- Dogfooding is super important — if you’re an engineer, use what you build so you know its advantages, disadvantages, use-cases, etc. better than anyone else. It’ll also show you ways to improve the product, and how actual users would be interacting with the product (so you have a better sense of what you’re building).
- A company’s strategy should match it’s capabilities and skill sets. If you don’t have security experts, how do you plan on keeping data secure, and customers to trust you with sensitive data? This is often why strategies that may sound good in theory often fail in the real world — it’s a skill issue.
- A lot of companies these days believe in “don’t focus on your competitors focus on your product and your customers” and that’s bad advice. You’re not the only company in the industry — and you need to know what others are doing so you know where to position yourself vis-a-vis others (e.g. during sales pitches, you need to be able to differentiate yourself from competitors).
- Measure how much real users are using the different services and features so you know what to focus on improving.
- Consider holding “product council meetings” — every month, get the product manager to write down a long narrative on how things are going, where things are headed, and get the heads of all departments (sales/marketing/engineers) to silently read the document during the meeting and leave comments. The PM can collate the questions and in the next half of the meeting, they can have a conversation around these questions. For such meetings, try to only include people who are relevant (7–10 pax).
- PMs need to define problems very specifically (set the acceptance criteria but not how to reach them) — don’t lead the engineers to solutions. Let the engineers come up with innovative solution.
- Don’t commit to a customer without knowing how much time and effort you would need to spend on the solution (from a technical point of view as well). Only commit stuff you think would accelerate your roadmap, not distract you from it, or solutions that solve a bigger problem than you were originally intending to solve.
- Manage your ego. Your strategy can be wrong and it’s okay — don’t try to fight it when you’re wrong. Accept it and make the change necessary.
- Actively seek feedback and reflect on it. Try to get high quality actionable feedback from people. Ask them for specific things you can improve on.
- If you act like a defensive jerk when someone gives you real honest feedback, it’s unlikely that they’ll ever give you such feedback again and that’s your loss.

## Melissa Tan

Head of Growth at DropBox and Webflow.

- Do specific user research — get detailed pain points of the user, especially if the product is complicated to use. Take big swings — do unconventional things to solve those pain points. Get them to talk out loud as they use the product, not rely on their memory of the experience but the experience itself. It’s more real and hits different compared to reading a synthesis of their experience.
- Building a great product is not sufficient if it’s too complex to use — you need to teach users how to use the product. (Also do user research on how users prefer to learn — videos, blogs, live sessions, etc — and use the right mode of teaching)
- Identify the “points of influence” — points during the user journey where users make key decisions — and try to focus on making sure those go as smoothly as possible.
- Get users invested in the product early on (e.g. in Webflow, they found that users are more likely to finish setting up their website if they already bought a domain) to reduce drop-off rates. Psychologically, this makes perfect sense — it’s a classic example of sunk cost where you’ve already spent some time and effort (and maybe even money) on something and so you’re less likely to drop out of the journey.
- Develop user empathy — encourage them to continue and offer help at every step. Make sure they feel like you’re with them every step of the way. Get users to feel a sense of urgency to start using the product. Show them what they stand to lose if they delay using the product.
- Invest in layout. Poor UI/UX is one of the main reasons people don’t like using products — they just don’t feel good about it. If your UI/UX is bad you need to provide a LOT of value to be able to compensate for the terrible experience. On the other hand, if your UI/UX is good, users will be more tolerant of some minor bugs.
- Make sure your success metrics are easily and accurately measurable (e.g. time spent by users per day, daily active users, etc.). Also, they should be such that they can be measured quickly so you can see the change in metrics to assess your progress. Close the feedback loop using these metrics and improve using what insights you gain by analysing these metrics.
- Make sure the metrics make sense and everyone’s on the same page about them. Once you’re confident that the metrics can accurately measure the success of the product, be extremely results oriented. You can’t (and shouldn’t) hide from the data.
- Not all trends to be explainable so don’t try to find explanations for everything. Some trends may be purely random or seasonal.
- Knowledge sharing between teams is super important — get teams to fill in reports asynchronously and share them with everyone (so those interested can learn from it).
- As usual, have long term goals as well as short term targets (that are derived from the bigger goals) aimed at achieving those goals (translate goals into actionable steps)
- It’s okay to be measuring tons of metrics but you can’t be optimizing all of them. At most you can optimize a couple of metrics, without it being counterproductive to the other ones.
- How to improve user retention? Use an annual subscription model, offer discounts.
- When to get a “growth person”? Either when founders have no more bandwidth to work on growth or when you’ve hit a ceiling and you need a growth expert to drastically expand the startup.
- What background do growth experts need to have? Attributes are more important than experience — needs to be analytical, user-centric, data-centric, thinking from first-principles, flexible, learner’s mindset
- Pricing and packaging? You never know what’s going to be your core go-to market strategy is going to be but it’s got to be scalable. But you need to think about it early on — who are you building the product for and how much are they willing to pay for it? Also, you should include PMs in the conversation to decide the price for features because they are close to the features and how much value it adds to the users.
- Think long term when it comes to product roadmaps. Don’t monetize X if you can monetize Y (which would give more revenue) and offer X for free if it can drive the sales of Y up. That is, don’t think of each pricing decision as being individual and isolated — they must all fit into the bigger picture.
- Price changes are difficult and need to be executed/launched properly, especially if you already have a large user base. Brace yourself that if you increase prices, you might lose some customers (and that’s not necessarily bad) — you can’t have your cake and eat it too. Of course, any price increase should be matched with value increase (feature addition, etc). You should know how much increase in price each user segment is going to face and run the numbers ahead of time. Lastly, your messaging (how you communicate the price change) needs to be clear, effective and empathetic. Test it on some people in your community to see the reactions it engenders before rolling it out to everyone.

That’s all! 😅

Btw, if you haven’t read Ben Horowitz’s **“Good Product Manager/Bad Product Manager”**, it’s a must-read for anyone interested in learning how to build great products.

## References

Podcasts by In-Depth on Spotify:

1. “Building a Highly Technical Enterprise Product” — Nate Stewart
2. “How to Design A High Impact Growth Org for a PLG Startup” — Melissa Tan
3. “CEO of Twilio Jeff Lawson Reflects on the Peaks and Valleys”
4. “Growing a Consumer Product from Scratch to 1 Billion Users” — David Lieb</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>11 Lessons from Paul Graham&apos;s Essays</title><link>https://devanshshah.dev//posts/lessons-from-paul-graham/</link><guid isPermaLink="true">https://devanshshah.dev//posts/lessons-from-paul-graham/</guid><description>A summary of the key lessons I&apos;ve learnt from Paul Graham&apos;s essays.</description><pubDate>Sat, 27 May 2023 00:00:00 GMT</pubDate><content:encoded>## Introduction

I recently stumbled upon Paul Graham’s essays and got hooked almost immediately. I loved the unostentatious style of writing and the immense amount of knowledge each essay contained.

I’ve been reading a few daily for about 2 weeks now and thought it would be a good idea to summarize the key lessons I’ve learnt, for the benefit of myself as well as those who aren’t huge fans of reading long essays (or who don’t have the luxury of time).

## 1. **The most dangerous way to lose time is not to spend it having fun, but to spend it doing fake work.**

If you’re having fun doing self-indulgent stuff like binge-watching a show or going for parties every night, you’ll quickly (or at least, you should) start feeling guilty about it. At the very least, you know that you’re not doing work and you’re being unproductive. Once you know it, you can do something about it.

What’s much worse is doing “work” that, at least on the surface, appears to be meaningful - such as replying to emails, reading the newspaper, doing unimportant tasks.

It’s dangerous to be engaged in “fake work” because you don’t even realize that it’s fake. You’re probably giving yourself a pat on the back for getting through your inbox - without realizing that it’s not even important. Imagine doing such fake work for your entire career - yeah, that’s a scary thought. That’s why it’s important to objectively consider whether what you’re doing adds any value to society, or if it’s aligned with your long-term goals. If not, it’s probably fake work.

## 2. If you want to make a million dollars, you have to endure a million dollars’ worth of pain

Everyone knows that there’s no escaping hard work if you want to be successful. But this one sentence just hits different. It makes you realise that it’s possible to achieve success faster by enduring the same pain in a shorter duration. That is, you can become rich by working like crazy for 3 years or by working moderately for 30 years.

In fact, that’s the key difference between startups and big companies. The term “high-growth” when describing a startup basically means working as hard as you can (because you can bet that if you don’t, your competitors will beat you) and generating wealth rapidly.

## 3. Run upstairs

If you’re a startup and you’re faced with a choice - do something hard (i.e., run upstairs) or do something easy (run downstairs) - and the value of each of those options were proportional to the difficulty of the task, you should always pick the harder one. Why? Because if it’s hard for you, as a fast-paced start-up, it’s probably going to be next to impossible for the big companies to follow you.

This is good advice for life too. Whenever you have to make a choice, choose the harder option. Chances are the only reason you’re even considering the other is because you’re lazy. Choosing the harder option takes care of this - you know it’s the right thing to do. So, if you’re deciding whether to go watch a movie or go to the gym, now you know what to do.

## 4. Users, users, users.

Any company, or more generally, any product is measured by the number of users it has and the value it adds to each of it. There’s no point building a product that (you claim) has the best features and technology but no one’s interested in it.

Having users is the only true measure that your product is actually solving a real problem. It’s the only way to validate that your work has added some value.

Don’t be obsessed with features; be obsessed with users.

## 5. Time Quanta of Hackers

Some jobs have a small time quantum - which means it generally takes a small amount of time to complete a task (or at least a subtask), and even if you’re interrupted midway through that job, you could continue almost unaffected after that.

But that’s not the case for hacking. It might take an hour just to load the problem into your head (simply because some technical problems are hard). When you’re interrupted, you lose your train of thought and it takes a lot of time reload the context into your head.

Tip: keep chunks of uninterrupted time if you plan to hack.

That’s why many hackers work at night when everyone’s asleep.

## 6. Write Simply

The goal of writing should be communicate ideas - not to impress people. Anyway, people are more impressed by ideas than merely tough-to-follow language.

The more convoluted your writing is, the more effort readers have to put in to understand (some may not bother and just stop reading) and the more likely it is that you can’t explain it well enough. Don’t pretend.

When it comes to writing, less is more.

## 7. Life is Short

Don’t waste your time on bullshit. Before doing something, ask yourself: “Is this really how I want to spend my time?” A good heuristic to decide whether something maters or not is to think whether you’ll care about it in the future.

## 8. Forget Prestige

Don’t care whether the world thinks you’re an important person or not - that’s a sure way to fall into the trap of doing what you don’t like (or at least stuff that isn’t important).

If there are 2 jobs that you’re considering and one has higher prestige associated with it - pick the other one. You’re likely more interested in the other one (with lower one) and you’ll enjoy it more.

It’s important to have a sense of fascination with the work you’re doing - at the end of the day, you should be able to say “wow, that’s pretty cool”.

Chasing your dreams and passion is better than chasing money. Do what you like and let prestige take care of itself.

## 9. Work ≠ Pain

As much as schools reinforce this idea that work is different from play, and is more like pain (because for most people, doing schoolwork is pain), that is simply not true. You can decide what you want to work on.

People often lie that they enjoy their work when they’re actually miserable - mostly due to social pressure (and if doing well requires you like what you do, then not liking it means you aren’t doing it well - which is difficult to accept). It’s hard to find work that you love, but it’s worth it.

No matter what you’re doing (even if you don’t like it), do it well. That way you can be sure that you aren’t just being lazy and making excuses. In short, always produce.

## 10. Good Ideas vs. Bad Ideas

It’s very difficult to distinguish between good, crazy ideas that can work and bad ideas. The reason is simple: if it were obviously good, someone else would’ve done it already. Only the unconventional and risky ideas haven’t been tried yet (though in hindsight, they too tend to seem like obviously good ideas once they are implemented successfully).

Being correct is not a sufficient condition for success - you need to be right _and_ most other people need to be wrong. It’s only the crazy novel ideas that matter - these are the black swans that have a huge impact.

So, if “someone who’s both a domain expert and a reasonable person presents a crazy new idea to you, chances are that it’s a good idea (even if it sounds like a bad one). If the person proposing ideas is reasonable, then they know how implausible it sounds - and yet, they’re proposing it anyway. That suggests that they know something you don’t. And if they have deep domain expertise, that’s probably the source of it.”

Don’t dismiss ideas just based on the person who had them - judge them based on their merits.

## 11. Good Founders

- A good startup founder is **“relentlessly resourceful”** - determined to get things done + adapt to changes.
- Determination is a larger factor than intelligence when it comes to predicting the success of a startup.
- Mean people fail. Why? Being mean makes you fight with other people instead of tackling the problem together. Also, if you’re mean, you can’t convince the best people to work for you (they’ll always have other options) - and that’s critical for start-ups.

## Conclusion

Paul gave a list of 5 commands that constantly remind you to focus on stuff that matters (which he puts on top of his to-do list, and you should probably too):

&gt; **Don&apos;t ignore your dreams; don&apos;t work too much; say what you think; cultivate friendships; be happy.**</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>Why the Current Incentives for Work just Don&apos;t Work</title><link>https://devanshshah.dev//posts/why-current-incentives-dont-work/</link><guid isPermaLink="true">https://devanshshah.dev//posts/why-current-incentives-dont-work/</guid><description>An analysis of how incentives drive behavior.</description><pubDate>Wed, 24 May 2023 00:00:00 GMT</pubDate><content:encoded>There are all kinds of people — some who find work to be a chore, others who say they like what they do (out of social pressure — because everyone believes that only people who like what they do end up doing it well, and no one wants to be the person that is shamed for not doing what they like), and a few (very few) who actually like what they do.

Imagine you’re given a task to do. Suppose you can do it within 4 hours by yourself. But now imagine you’re given access to the solution of the task (you have some superpower that tells you the correct answer immediately). Would you use the superpower and solve the task instantly or work on it for 4 hours by yourself and come up with the solution?

I haven’t asked this question to enough people to get enough data points but amongst those I asked, most said they’d use the superpower. What I found interesting was that there were, in fact, some people who would rather do it by themselves. 😮

When probed for their reasoning, they gave explanations such as “it’s the right thing” or “it seems unfair to take shortcuts”. Some mentioned that work was a major source of their identity — but then I’d argue that you’re still doing the work by completing the task; you’re even doing it faster. So, it wasn’t directly about work. It was about something else — something commonly mistaken to be synonymous with work, but entirely different.

**Effort**. At the heart of all of those explanations was a single underlying reason — they didn’t want to _appear_ that they weren’t working hard.

The keyword here is _appear_. So, these people were becoming less productive (i.e., taking more time to solve a given problem) simply because they wanted to show others that they were putting in a lot of effort.

This is puzzling — shouldn’t people’s work be measured by the end results rather than effort? 🤔 If you judge someone based on their efforts, you’re incentivizing them to take longer and spend more time (hence, showing that they’re putting in effort) rather than being more productive and actually completing the task.

If I can finish a task in 1 hour that someone else takes 1 day to complete, should I be paid less because it took less of my time? Absolutely not! This would be ridiculous — you would end up penalizing talent and everyone would intentionally slow things done. And although this is not done with regards to pay (at least, not that I’ve heard of), it is very often done with regards to recognition — people are praised for working longer hours rather than for the output of their work. But it’s equally wrong and foolish — why would you even have such an incentive that seems so obviously counter-productive in retrospect? 🤔

More importantly, why is it that whenever we see someone working very hard, we naturally assume that they’re a “good” person — in literature, this is called the “moralization of effort”. We assume that effort correlates with morality because they often go hand-in-hand (but not always — and that makes all the difference!). It does make some sense: Hard-workers have great self-discipline and do things that need to be done — whether they’re in the mood to do them or not. Wouldn’t you like to have someone like that on your team or as your business partner? 😄

So, the problem lies not so much with our initial assumption, but with the effects of this assumption — which incentivize people to do the wrong thing, which quickly evolves into a vicious cycle — everybody tries to show that they’re working the hardest. And once this happens, our assumption becomes flawed because we can no longer claim that people who work hard are better people to work with, because people are now working (very) hard to show that they’re working hard so that you think they’re better than others.

Phew. Was that a lot of meta-reasoning? Think about it in terms of financial markets: information about a stock is useful to decide whether to trade or not only if you’re the only one who has this knowledge. Once this information becomes public, everyone uses it to make the necessary trades and the market corrects itself. In the same way, once people have realised (and they definitely have) that others like hard-workers, this information becomes practically useless as they try to “game the system”.

For example, being the last one to leave office seems to be something that many working adults (or even interns) take great pride in. It’s as if the act of simply staying back in the office somehow makes them a better person than someone else who finished the same tasks much before and went back home to spend time with his/her family.

I’ve seen other examples of this too: people intentionally reply at ungodly hours to give others the impression that they were up working till then. Unsurprisingly, some people just use the “schedule send” feature of email clients to do this for them, and are fast asleep 😴 — probably dreaming about how others will see them in a good light.

All the above are examples of cases when people intentionally become less productive to gain “moral points” from others.

In case it has to be said, I’m not advocating against hard work — I sincerely believe that hard work is essential for progress and success. What I’m advocating against are the incentives that motivate people to appear to be working hard instead of actually working hard.

This brings us to the question: what can we do about this? The most obvious solution is to stop placing emphasis on effort alone.

If you pay a plumber on a per-hour basis, he has an incentive to take a very long time to fix the issue. So, you don’t pay the plumber for banging on the pipes — you pay him for knowing where to bang (source: unknown).

In the same way, rewards should be based on results and output rather than effort. **Productivity, rather than effort, should be measured.**</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>An Unforgettable Coding Experience</title><link>https://devanshshah.dev//posts/an-unforgettable-coding-experience/</link><guid isPermaLink="true">https://devanshshah.dev//posts/an-unforgettable-coding-experience/</guid><description>How I learnt to despise the big bang.</description><pubDate>Thu, 11 May 2023 00:00:00 GMT</pubDate><content:encoded>## Story Time: An Unforgettable Coding Experience

This is not an essay; it&apos;s an impulsive writing, a raw anecdote (+ some key software engineering lessons). If you’re expecting something well-researched or a “well-written” (whatever that might mean) article, i don’t want to disappoint you - so stop reading. If you’re looking for a good story with lots to learn from, continue reading! 😄

I attended the Code to Connect 2023 competition conducted by Bank of America at their Singapore office today (May 11, 2023), and this was an unforgettable coding experience.

Don’t get me wrong here - I mean unforgettable in a very “not-so-good” fashion - you’ll understand soon enough.

I reached the office at 7:30am (yes, I woke up at 5am just for this - totally worth it though) and met my teammates - we got along pretty well. After the problem statement was explained to us, we started coding at around 9am. It might be good to mention here that the deadline ƒor submitting the code was 5:00pm. So we had about 8 hours to implement a \&lt;redacted due to non-disclosure agreement\&gt; - basically, something related to equity trading.

This is when it all begins. We spent about 20 minutes deciding the overall software architecture before diving straight into coding - all seems to be going well, and we’re making good progress. 3 hours in. We’re nearly done with all the components - all that’s left to do is integrate everything and test that it works.

After lunch, we continued - everyone was in a good mood, comfortable and quite relaxed. And then, everything with southward.

We realised we had a major problem - we hadn’t really thought carefully enough about how the different components would be interacting with each other. We thought we’d develop that communication interface “as we go along”. As it turns out, there was a circular import dependency (not in our logic, but in our codebase). For context, we were using python and had separated each component as a class in a different file.

There didn’t seem to be any easy way to fix this. Some of the mentors from Bank of America very kindly explained to us the problem and together, we all started discussing possible alternative implementation ideas - all of which were either super hacky - e.g. putting all the components into a single file - (believe me, seeing solutions would make me cry) or required major refactoring (for which we didn’t have time).

Also, on closer inspection we kept uncovering more and more bugs - simply because we had forgotten to account for these things beforehand. For example, our entire codebase was running sequentially (instead of asynchronously, as was required by the specifications) and there was no way we could make it multi-threaded given the current implementation.

For about 20 minutes, I didn’t speak a word - probably a mixture of guilt, embarrassment (for not thinking of such obvious problems) and panic (yeah, mostly this tbh). Then, after sufficient mourning, we decided to re-architect the entire codebase nearly from scratch - we clearly defined our APIs, our logic, everything.

We spent about 45 minutes doing this - on paper! During this time, we didn’t write a single line of code, but this was, without a doubt, the time most wisely spent.

Then we started refactoring and making everything work again. The problem was that time wasn’t on our side. We had about an hour and a half to complete what was supposed to be a 8-hour competition.

Fast-forward to 30 minutes before the submission time. Nearly all the logic “seemed” correct - but there were so many minor bugs that it was impossible to test the code. We were all exhausted at that point. We powered through - fixing all kinds of bugs, one at a time, before finally the code worked.

Until it didn’t.

The output didn’t match the expected output and we realised that we had messed up some of the logging functionality (which was another strict requirement) and we still had to make our entire system asynchronous. This is when a jolt of motivation hit me - I remember thinking to myself “There’s no way I’m submitting something that doesn’t work perfectly”.

I implemented the entire multi-threading functionality (thanks to my recent Operating System course at NUS for teaching me about mutexes, critical sections, and concurrent programming) with about 3 minutes to spare. But since I was coding a concurrent program in python literally for the first time in my life (yeah, not the best time to try out new stuff but I didn’t have a choice - even my other 2 teammates didn’t know it), there were some other bugs that had crept up.

With 2 minutes on the clock, I rushed (felt like I was typing at 150 WPM but I’ll never be able to prove it), I continued to fix the bugs and run the tests one by one, until everything worked as expected. We had about 20 seconds left when I committed the latest changes, pushed the code, and closed our laptops.

And that was it.

I really can’t explain the amount of adrenaline pumping through my veins at that point - I loved every moment of the last 30 minutes. The satisfaction in delivering a working product under unbelievably high time pressure (imagine 6 people standing behind you, staring at your screen, hoping you’re able to fix the problem, while there’s a minute left on the clock). is simply ineffable (in fact, I think I’m addicted to working in high-stakes fast-paced environments).

Needless to say, we didn’t expect to win. But to our greatest astonishment, we came 2nd in our category! It turns out that most of the other teams couldn’t successfully make their application multi-threaded either, and although our code quality wasn’t great, our application satisfied their requirements.

All this taught me a whole bunch of lessons:

1. Spend as long as you need clarifying high-level software architecture - make sure each and every person on the team knows exactly what is his/her role as well as how it ties into the bigger system. It’ll save a lot (really, a LOT) of backpedaling down the road and having to start over.
2. Being able to debug code is equally (maybe even more!) as important as being able to code - in real life, you’re mostly going to be working with other people’s code and building on top of it (or reading your own previously written code which you’ll obviously forget how it works)
3. I can’t emphasize enough the importance of good, clean, and elegant code - bad code can literally make your (or others’) head hurt and is frustrating to read. Set incredibly high standards for yourself and others while coding (at least when you have the time to do so). Think of coding as a social activity - you’re not coding for yourself (unless it’s your own pet project, in which case you might still be coding for your future self, who is likely to not understand your terrible code either) - people will be eternally grateful to you for writing good code.
4. Plan, Plan, Plan! Never just start coding directly - use a pen and paper to write down exactly what you’re going to implement, how you’re going to do it - until you’re all confident it will work. Then, the amount of time required to code is directly proportional to your typing speed, and not your thinking speed (because you’ve already thought about everything and, hopefully, written everything down too). Also, aim to finish at least an hour before the submission so you have enough time for testing, improving code quality, preparing a presentation deck, whatever - ideally there should be no functional changes 1 hour before the submission.
5. Learn to deal with high-pressure situations - it’s an incredibly useful skill and I’m super grateful to be able to remain calm in such situations.
6. Software Engineering is about COMMUNICATING computational ideas - during the span of 8 hours, I spoke to a lot different of people including mentors regarding our code and the problems that we were facing - the only important skill in order to even get help from them was to be able to communicate what we were trying to achieve at the right level of abstraction. Remember, coding is all about abstractions and software engineering requires being able to communicate these abstractions.
7. Lastly, learn to despise the big bang - don’t make the mistake of waiting till all your components are built before integrating them together into a complete working system. Build your code incrementally (aka iteratively) and integrate continuously - at every step, make sure you have a working product that has some subset of features/functionality. A working cycle is better than a hypothetical car - at least you can reach your destination.

All in all, yes, I made tons of mistakes, learned a lot from them, and overall, had an awesome time today! Now, it’s been a long day, and I’m going to sleep. 💤</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>5 Important Things I&apos;ve Learnt in the Past 5 Months</title><link>https://devanshshah.dev//posts/five-important-things-ive-learnt/</link><guid isPermaLink="true">https://devanshshah.dev//posts/five-important-things-ive-learnt/</guid><description>A reflection on the past 5 months of my life.</description><pubDate>Thu, 13 Apr 2023 00:00:00 GMT</pubDate><content:encoded>## 1. Who You Spend Your Time With Matters As Much As What You Do

You probably know that your life is shaped, to a great extent, by the people you’re surrounded by. I’ve come to realise that this is truer than most people would like to believe. In fact, the people around us, especially those we spend large proportions of our time, influence our actions, decisions, thoughts, and beliefs — and we often don’t even realise this.

This is not necessarily a bad thing — it just means that we have to be careful and conscious of who we choose to spend our time with. Surround yourself with the right kind of people and you’ll see the positive impact extremely quickly!

I’m deliberately being vague by saying “right” kind of people here (without defining what “right” means); it depends on you — your personality, your goals and aspirations. Different people thrive in different environments — this applies to social environments too. Figure out what’s (and who’s) best for you

For example, when you’re deciding which company to join (or if you’re a student like me, which CCA/extra-curricular to join in university/school), think about the people you’ll be hanging out with too. The organisation’s culture should be an important factor while making such decisions.

From the organisation’s perspective, this is also why hiring the right kind of people is crucial to its success. Simply hiring for skills isn’t enough. The guiding question should be: “Would I want to work with you?” (an even more potent question to ask is “Would I want to work for you?” — especially if they’ll be managing people, either now or in the future).

The bottom line is really simple: people matter more than progress. An organisation can only succeed if everyone in it succeeds together.

## 2. Slow Down

We’re constantly made to feel guilty for doing “nothing” or not being productive enough or just chilling around. But why does everyone want us to be busy all the time? Why do people that barely get any sleep wear that as a badge of honour?

Being busy is not the same as being useful. In fact, there’s rarely more than 3–4 important things you have to do in a day — the people that generally look “busy” all the time are probably doing a whole bunch of unnecessary and unimportant stuff just to avoid the difficult but necessary tasks.

Also, there’s seldom a good reason not to sleep for 7–8 hours every night; it doesn’t really matter if that’s from 11pm to 7am or from 1am to 9am — just make sure to get your sleep. I’ve found that sleep literally makes me more productive, helps me concentrate better, increases creativity, and reduces stress levels. The contrapositive is probably easier to visualize: a lack of sleep makes me cranky and unable to focus. If this applies to you too, do yourself a favour and sleep.

Want to take this even further? Don’t feel guilty about taking a short nap every now and then if you feel that’s what you need — trust me, sometimes taking a nap and then getting back to doing whatever you were doing makes you so much more productive (and happy!) than forcing yourself to labour through it despite your exhaustion.

Lastly, not doing anything actually gives your mind the chance to catch a break and wander around — which is how most creative insights are discovered.

## 3. Actively Learn Something New Every Week

I know it’s probably hard to find time to learn something new every single day, but once a week sounds reasonable right?

I mean really schedule 2–3 hours a week sincerely to read up on something that fascinates you — I don’t care what that “something” actually is. It just has to be something that you’re genuinely interested in. Then, understand it deeply — write it in your own words or try to explain it to someone else who doesn’t know the topic.

I also find it particularly useful to keep track of the stuff I’ve learnt so far and stuff I find interesting that I can learn in future. I’ve realised that my list of “stuff to learn” grows much faster than my “stuff learnt”, which motivates me to keep going forward.

Of course, it’s also humbling to see that it is virtually impossible to know everything, given that there’s so much you don’t know. In fact, this list of “stuff to learn” only contains the things you know you don’t know — it doesn’t even account for the (much much longer) list of things you don’t even know you don’t know!

## 4. Every Aspect Matters

Does happiness come from spending all your time with friends and family? Or from being financially stable? Or from doing something you like doing? Or what?

I feel it’s not a single thing , but the balance of every aspect of life, that makes us happy and content. I know it’s true for me.

Life’s all about finding the right balance between everything important.

But what is this “everything important”? I see it as 5 different things:

1. Social life — spending time with friends and family
2. Work — pursuing something meaningful and worthwhile
3. Physical health — keeping yourself fit and healthy
4. Mental abilities — keeping your mind sharp and engaged
5. Emotional health — taking care of yourself.

An important realisation is to see that you can’t try and fill a void in one part of your life, no matter how much you overcompensate in another. For example, your gigantic bank balance can’t make up for your lack of agility and energy, stemming from your poor physical health.

More generally, anything in extreme (e.g. working for 14 hours everyday, or partying 5 nights a week) isn’t good for you and isn’t going to make you happy in the long run. But don’t be too rigid either — give yourself the flexibility to go out-of-balance once in a while (i.e., don’t take this idea of moderation to the extreme either). Quoting Oscar Wilde,

&gt; Everything in moderation, including moderation

## 5. Take Responsibility

If you’re in a team and you’re the leader, and anything goes wrong, take responsibility. As Terry Pratchett said,

&gt; Even if it’s not your fault, it’s your responsibility.

In case you’re wondering: “But Devansh, why should I take responsibility for something that wasn’t my fault??” Because you’re the leader! You’re responsible for not only your own actions and mistakes, but also those of every other person in the team. That’s what being a true leader is about.

Also, in case it has to be said, don’t do this as a pretentious act of showmanship (people can see through that kind of charade, really).

It is only through such a form of, what Jocko Willink calls, “Extreme Ownership” that people will know you’re not someone who passes on the blame or lets someone else take the fall. They’ll respect you for your courage and honesty.</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>How to Ideate Effectively</title><link>https://devanshshah.dev//posts/how-to-ideate-effectively/</link><guid isPermaLink="true">https://devanshshah.dev//posts/how-to-ideate-effectively/</guid><description>A framework for creative thinking</description><pubDate>Thu, 12 Jan 2023 00:00:00 GMT</pubDate><content:encoded>Here, I’ll give you a simple 5-step process on how to generate better ideas that have a real impact.

But first, let’s talk about some other things you absolutely must keep in mind while ideating!

## Solving Real Problems

Most people don’t realize this but finding the right problems to solve is actually much more difficult than solving the problems themselves. In particular, many startups tend to build solutions to problems that are not “real”, i.e., they assume that others face this problem and decided to solve it without actually testing whether it is a problem.

The key here is that real problems come from real people. So, the only way to find real problems is by listening to real people. More on this later :)

&gt; Focus on solving problems, not on building solutions.

When defining a problem, be sure to understand it very well — know your target audience and the specifications/constraints. The details matter too. Depth of understanding is critical.

## Hmm… Is now the right time?

And, don’t wait for the perfect time to start working on an idea you have! (Unless you have a very very good reason not to — e.g. the infrastructure/technology you require hasn’t been developed yet)

The only way to really learn something is by doing — experiential learning. This kind of learning is far more superior than intellectual learning, i.e., learning by reading textbooks or watching videos or even attending lectures.

&gt; Done is better than perfect!

## The Power of Abstraction

In general, the ability to create abstractions and explain something complicated to someone in a manner that they understand exactly how much they need to is an incredible skill. It’s also invaluable when trying to pitch to investors — you only have 2 minutes to describe your idea (that you probably spent 2 months thinking and working on) and excite them to join your journey. Use abstractions to only talk about the relevant details and hide everything unnecessary. In particular, when pitching, focus on the problem + existing solution, and how your solution is better → it is necessary to problematize before talking about your solution so they can see the value of it. Don’t talk about the cool technical aspects of it (unless the other person is super geeky) because they probably don’t care.

## Creative Confidence

As people get older, they start to think they’re less and less creative. This is because they do less artistic things (e.g. stop playing the violin, which they used to as a kid), etc. But creativity and artistic talent are very different things. Creativity is what drives innovation — it’s everywhere. One of the key things that you should strive to develop is creative confidence — the confidence that you are as creative as anybody else.

## The 5-Step Process of Ideation

Let me introduce to you a framework for ideation that will allow you to express your creativity better and come up with higher-quality ideas and solutions.

It consists of 5 easy steps:

1. **Empathy**
   - Conduct interviews to search for problems.
   - Be empathetic — don’t judge — just collect data. Hear the unsaid things. Care about their emotions.
   - Withhold any experience or expertise — this is just a data gathering stage, not a validation stage.
   - Be curious
   - Try to understand the other person better than they understand themselves.
   - Feelings &gt; functionality : at the end of the day, people use apps that make them feel good/cool/happy. Creating the functionality is very easy — evoking emotions is not. (e.g. teenagers tend to stay away from Facebook as they think its “uncool”)
   - Keep asking why (about 5 times is generally good enough) — get to the root problem
2. **Define**
   - Verbs &gt; Nouns: it turns out that oftentimes, verbs are more effective at defining problems than nouns (e.g. The goal is to be able to reach a destination faster, travel from one place to another quicker. Then, as an innovative thinker, you can think of how to achieve these goals — instead of describing the problem as increasing the speed of carriages, which would restrict you to only think of ways to improve the carriage, not come up with a radical new idea altogether).
     &gt; “If I had asked people what they wanted, they would have said faster horses” — Henry Ford
3. **Ideate**
   - The crazier the idea, the better
   - Be as radical as you can to solve the problem
   - The only way to increase the odds of hitting the next big idea is to come up with lots of ideas — so just keep thinking from different points of views.
4. **Prototype**
   - Fail as soon as possible — cost of failure increases exponentially with time and you’d rather know an idea is stupid much earlier than much later
   - Test as often as possible — the world is rapidly changing and what is true today might not be true a few months later — so you need to test if there have been any changes in user application usage or preferences that you need to adapt to.
5. **Test**
   - Get feedback from users by listening to them.
   - Don’t get defensive — use their feedback to iteratively improve your product/solution till it matches user expectations.

Here’s another useful tip for you: know your own strengths and weaknesses and the strengths and weaknesses of others. Be sure to bounce ideas of each other and play to your strengths. Self-awareness, i.e., knowing you are not good at something, is great — because you can get people who are better at it to help you with it.

Thanks for reading! This article was inspired by a workshop conducted by Dr. Mikhail and I hope it was useful to those of you looking for ideas for your future-startups or just searching for problems to solve in general 🙌</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>What I Learnt From My First Internship</title><link>https://devanshshah.dev//posts/what-i-learnt-from-my-first-internship/</link><guid isPermaLink="true">https://devanshshah.dev//posts/what-i-learnt-from-my-first-internship/</guid><description>Key takeaways from my first software engineering internship.</description><pubDate>Mon, 12 Dec 2022 00:00:00 GMT</pubDate><content:encoded>My first internship was as a Full Stack Developer (for my dear non-technical audience, don’t worry, it’s not a technical article 😄) in the summer of ‘22.

During these 3 months, I learnt a lot about Software Engineering, most of which can be generalised to other domains too, and had quite a few important realizations. Here, I’ve summarised the ones that I think will benefit you the most. Some of them (admittedly) sound platitudinous but once you truly internalize them, I hope you’ll be able to see their value.

**Disclaimer**: Any opinions expressed are solely my own and do not express the views or opinions of my former employer.

## Key Takeaways

1. Don’t make promises you can’t keep.
2. Doing the right thing is far more important than doing the thing right. Doing the right thing focuses on a higher goal, a sense of purpose, the destination, the “top line”. Doing the thing right focuses on the details, the journey itself, the “bottom line”. It’s more important to be going in the right direction than to be going fast.
3. Don’t be in a rush to prove yourself right. Be in a rush to understand clearly what’s going on and try to get to the bottom of things, i.e., find out the truth or reality. If you’re right now, you’ll probably be right 5 minutes later too.
4. Spend your energy in areas of high-impact rather than just “being busy”. You can be extremely busy, yet extremely unproductive. Have your priorities clear.
5. When you don’t know the answer, say so. Be humble. Admitting you don’t know something is a prerequisite for learning. You can’t put water into an already full glass.
6. Most difficult questions in life don’t have a model answer. It depends on the context.
7. When there’s a problem, don’t jump to fix it. It’s much more effective to first focus on diagnosing the problem and designing a solution. Treat the illness, not the symptoms.
8. Switching costs are often significant. That is, it takes energy (and effort) to switch between contexts and solve different problems concurrently. Sometimes, it’s often more effective to laser-beam your focus on one problem at a time, solve it, and then move on to the next one.
9. Don’t be overconfident about your opinions. If you really want to increase the chances of being right, ask others to “stress-test” your opinion. The more number of (reasonable and smart) people you can get to agree with you, the greater the degree of confidence you should have.
10. Precise communication is crucial. Make sure everyone in the team is clear on what is going on and what needs to be done. Synergy between team members is pretty important for the project to be a success. The whole is greater than the sum of its parts.
11. Don’t feel afraid to ask for help from others when you need it.
12. “Just okay” is not okay. Even “good” is not good enough. Strive for greatness.
13. Metacognitive thinking accelerates growth. Understand what works for you and what doesn’t.
14. Knowing what you don’t know is far more important than knowing what you already know.
15. Asking the right questions is perhaps the most important skill. Force yourself to think of alternatives even when you’re quite sure of something, just like lawyers preempt the opposition’s arguments.
16. All (important) decisions should be made by considering the trade-offs between possible routes. More specifically, every decision is an expected value calculation that involves considering the probabilities and returns of each possible outcome (while ensuring that the risk of ruin is nil).

---

Okay, here’s where it gets slightly software engineering (SWE) specific (though you can feel free to extend these insights across domains).

Also, these are just my thoughts/learnings — so don’t treat them as objective truths. (I’m not really qualified to make bold statements regarding SWE anyway 😅)

## SWE Learnings

1. Understanding the client’s requirements is often much harder than actually implementing them.
2. Software engineering is less about writing code, and more about solving problems.
3. Not all software engineering problems are tech problems. They are often people problems, process problems, operational problems, management problems, etc. In other words, technology is just a means to an end — not the ultimate goal. Coding isn’t the solution to all problems. A hammer cannot replace a screwdriver.
4. Receive, refine and reject client requirements as you deem fit.
5. Nothing is free — everything has a trade-off. Consider the tradeoffs between complexity, generalisability, maintainability, ease of use, scalability, extensibility, etc. and pick the design that fits your context.
6. “Make it work, make it right, make it fast.” — Kent Beck
7. Building a useful product is more important than building the perfect app (in terms of UI/UX).
8. Use the white elephant test to prioritise what to do: think what would happen if a certain feature was removed from the product. How much impact would it have on the clients? The greater the impact, the higher the priority.
9. Having an operational plan is as important as building features. Don’t neglect one for the other.
10. It’s better to underpromise and underdeliver than overpromise and underdeliver.
11. While designing a SWE solution, imagine yourself using the product/feature/whatever. Visualize the entire process in your head. Simulate the user-flow (to see if it makes sense). Exercise imagination and creativity.
12. Context is critical while coding. Context refers to everything you have to consider regarding the business-domain, i.e., the problem you’re trying to solve. Many times, when new teams take over a project, they miss out on the context details that the previous team had and then they make blunders by trying to “improve” (because they think they can write “better code” than the previous team when in reality, the previous team’s code was more robust and bug-free than the current one). Realize that all the weird chunks of code you see in a legacy codebase are probably there for a reason and possibly solve some issue faced by an earlier team. Don’t just remove them without understanding their purpose, i.e, don’t throw away bug-free code in exchange for cleaner and simpler code: that’s a bad deal (especially when clients are already using your code!).</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item><item><title>The Secret to Being a Great Leader</title><link>https://devanshshah.dev//posts/the-secret-to-being-a-great-leader/</link><guid isPermaLink="true">https://devanshshah.dev//posts/the-secret-to-being-a-great-leader/</guid><description>A recipe for successful leadership.</description><pubDate>Thu, 01 Dec 2022 00:00:00 GMT</pubDate><content:encoded>I’ve always been interested in leadership. Ever since primary school. I’ve been fortunate enough to be given many opportunities to serve in leadership positions, be it in the Student Council in my secondary school or in clubs and societies at NUS (National University of Singapore).

In all these years, I’ve learnt a lot about what makes a great leader.

I think at the heart of leadership lies a simple formula:

&gt; Leadership = Character + Communication.

Simple enough?

Well, it actually is.

Except that character and communication are difficult to practice in themselves.

## Character

When I say practice “character”, I mean actually walking the talk. All of us (hopefully) agree that honesty is important but how many of us actually abide by that principle? When was the last time you said you were busy to make it for something when you actually just didn’t want to go? When was the last time you said you would do something, but didn’t end up doing it?

I think character can be broken down into 2 separate factors: honesty and integrity. Honesty is just saying what actually happened, or how you actually think about something. Integrity is doing what you said you would do, keeping your promises — to yourself and others.

The easiest and fastest way to lose all your integrity is by talking behind someone’s back about something that you wouldn’t say to their face. So, if you have something to say to someone, say it directly to them.

A simple test to decide whether or not you should say something is Socrates’ triple filter test. It basically says that before you say anything, ask yourself the following 3 questions:

1. Is it true? (Or are you just passing around information that you heard from someone else, i.e., gossiping?)
2. Is it good? That is, do you think the other person would be happy to hear this?
3. Is it useful? That is, do you think this helps the other person in any way?

If you fail all the 3 questions, it’s best not to say anything at all. (Though sometimes, even if it is true and useful but not good, you should say it — depends on the context).

In the short term, honesty and integrity might lead to a lot of conflict. People might get mad at you, or fight with you. But, eventually they will come to respect you for being upfront about things.

Oftentimes, people think it’s kind to lie to someone so that the other person’s feelings aren’t hurt. I don’t think that’s a very kind to thing to do. I think it’s kinder to the the person to be told the truth, which they later realise anyway, as it at least shows you respect and trust them enough to take it the right way. There’s nothing noble or kind about deceiving someone in order to protect their feelings. I think that’s just an excuse to avoid having a difficult conversation that might result in a fight (or them disliking you) — which makes it a selfish, not selfless, act.

Look, don’t get me wrong. There’s no need to be “brutally honest” about everything and go around making people mad just to say what you think.

If you get a sweater for Christmas from your Aunt and she asks you whether you like it or not, I don’t think you need to tell her “It’s the ugliest sweater I’ve ever seen.” You can always say how you actually feel — that you really appreciate the gesture and that you’re very grateful for it (without any mention about whether or not you like the sweater).

But at least, if asked a question point-blank, don’t lie about it.

The key idea behind the formula of leadership is that no matter how good your communication skills are, without character, words mean nothing. Talk is cheap. Why should anyone believe what you say? Anyone can fake niceties for their own selfish interests.

## Communication

On the other hand, a good character is a necessary (but not sufficient) condition to make a good leader. To be able to win the trust of others, you need to be able to effectively communicate with them.

Let me be clear: effective communication doesn’t mean using fancy words or being extremely eloquent. In fact, that’s a very small part of communication. We often forget that communication isn’t just about speaking, it’s about listening (I’d even argue that listening is more important than speaking).

So, effective communication isn’t about being able to convince other people by speaking effectively or being manipulative. If you have dubious intentions, people will figure them out eventually. The only way to have a sustainable impact on people is through a genuine expression of empathy and respect.

The best leaders I’ve seen so far wait for everyone to finish making their points, before they make their own. This way, everybody feels valued, and treated like an equal. It sounds quite easy to wait until everyone is done speaking but in reality, it actually isn’t. It takes great self-restraint to stop yourself from saying what you have to, and patiently listening to others.

Another simple idea to remember is this:

&gt; It’s not what you say that matters, it’s how they feel.

People might forget what you said or did, but never how you made them feel.

## Leadership in Practice

Let’s understand all of this with an example: imagine you’ve to give feedback to someone (say, John) about their performance. It’s your responsibility to help John grow and become better by giving him accurate feedback. At the same time, you know that John is known to get defensive quite easily and doesn’t like when others point out his mistakes. What do you do?

Well, firstly, it helps to have a high-trust relationship with John before you give him the feedback. If he doesn’t trust that you have his best interests at heart and you genuinely want him to improve, nothing you say to him is going to matter.

Secondly, it matters how you give the feedback. Obviously, it’s not a very pleasant experience for John (or even you) so it’s necessary to try and make it as comforting as possible, while saying what you need to. Start off by asking him how he thinks he is doing — more often that not, people know their own strengths and weaknesses and they might have reasons for not doing as well as you were hoping (e.g. something else might be going on in his life that could be affecting his performance). Give him a chance to reflect on his own performance before you give your opinion/feedback.

When you start speaking, give him credit for everything he has done well, and how much he has learnt. Then (and only then), you can tell him about some things he can improve on (this is the part where you have to be most careful — use the right words). Using words like “weakness” is usually not a good idea as it indirectly implies that one’s abilities are static, thereby subscribing to the notion of “fixed mindset”. Instead, use words like “progress” and “improvement” to indicate that you have faith that he can do better by working harder.

At the end of the day, it’s not just the feedback that matters. What matters more is how the receiver (John, in this case) take the feedback and what future actions he plans to take. Does he feel more motivated or demoralized? Is the relationship between the two people stronger or weaker than it was before?

If you give the “right” feedback in the wrong manner, it does no good (it might actually cause harm to your relationship).

So, in summary, you may be dead right about something but you will never be able to have an impact on someone or help them see things differently if they don’t trust you, or they’re not willing to listen to you, or they think you’re duplicitous or malevolent or vain.

Tldr; leaders become great when trust and integrity surround their character, and they’re able to effectively communicate that to others in order to make an impact.

John Maxwell put it quite nicely,

&gt; “All things being equal, people do business with people they like. All things not being equal, they still do.”</content:encoded><author>Devansh Shah &lt;undefined&gt;</author></item></channel></rss>