Haseeb Qureshi

The Time I Had to Crack My Own Reddit Password

I have no self-control.

Luckily, I know this about myself. This allows me to consciously engineer my life so that despite having the emotional maturity of a heroin-addicted lab rat, I’m occasionally able to get things done.

Mm, a waste of time!

I waste a lot of time on Reddit. If I want to procrastinate on something, I’ll often open a new tab and dive down a Reddit-hole. But sometimes one needs to turn on the blinders and dial down distractions. 2015 was one of these times — I was singularly focused on improving as a programmer, and Redditing was becoming a liability.

I needed an abstinence plan.

So it occurred to me: how about I lock myself out of my account? 

Here’s what I did:

I set a random password on my account. Then I asked a friend to e-mail me this password on a certain date. With that, I’d have a foolproof way to lock myself out of Reddit. (Also changed the e-mail for password recovery to cover all the bases.)

This should have worked. 

Unfortunately it turns out, friends are very susceptible to social engineering. The technical terminology for this is that they are “nice to you” and will give you back your password if you “beg them.”

After a few rounds of this failure mode, I needed a more robust solution. A little Google searching, and I came across this:

(Looks legit.)

Perfect — an automated, friend-less solution! (I’d alienated most of them by now, so that was a big selling point.)

A bit sketchy looking, but hey, any port in a storm.

For a while I set this up this routine — during the week I’d e-mail myself my password, on the weekends I’d receive the password, load up on internet junk food, and then lock myself out again once the week began. It worked quite well from what I remember.

Eventually I got so busy with programming stuff, I completely forgot about it.

Cut to two years later.

I’m now gainfully employed at Airbnb. And Airbnb, it so happens, has a large test suite. This means waiting, and waiting of course means internet rabbit holes.

I decide to scrounge up my old account and find my Reddit password.

Oh. Oh. Oh shit.

I didn’t remember doing this, but I must have gotten so fed up with myself that I locked myself out until 2018. I also set it to “hide,” so I couldn’t view the contents of the e-mail until it’s sent.

What do I do? Do I just have to create a new Reddit account and start from scratch? But that’s so much work.

I could write in to LetterMeLater and explain that I didn’t mean to do this. But they would probably take a while to get back to me. We’ve already established I’m wildly impatient. Plus this site doesn’t look like it has a support team. Not to mention it would be an embarrassing e-mail exchange. I started brainstorming elaborate explanations involving dead relatives about why I needed access to the e-mail…

All of my options were messy. I was walking home that night from the office pondering my predicament, when suddenly it hit me.

The search bar.

I pulled up the app on my mobile phone and tried it:

Hmm.

Okay. So it’s indexing the subject for sure. What about the body?

I try a few letters, and voila. It’s definitely got the body indexed. Remember: the body consisted entirely of my password.

Essentially, I’ve been given an interface to perform substring queries. By entering in a string into the search bar, the search results will confirm whether my password contains this substring.

We’re in business.

I hurry into my apartment, drop my bag, and pull out my laptop.

Algorithms problem: you are given a function substring?(str), which returns true or false depending on whether a password contains any given substring. Given this function, write an algorithm that can deduce the hidden password.


The Algorithm

So let’s think about this. A few things I know about my password: I know it was a long string with some random characters, probably something along the lines of asgoihej2409g. I probably didn’t include any upper-case characters (and Reddit doesn’t enforce that as a password constraint) so let’s assume for now that I didn’t — in case I did, we can just expand the search space later if the initial algorithm fails.

We also have a subject line as part of the string we’re querying. And we know the subject is “password”.

Let’s pretend the body is 6 characters long. So we’ve got six slots of characters, some of which may appear in the subject line, some of which certainly don’t. So if we take all of the characters that aren’t in the subject and try searching for each of them, we know for sure we’ll hit a unique letter that’s in the password. Think like a game of Wheel of Fortune.

We keep trying letters one by one until we hit a match for something that’s not in our subject line. Say we hit it.

Once I’ve found my first letter, I don’t actually know where in this string I am. But I know I can start building out a bigger substring by appending different characters to the end of this until I hit another substring match.

We’ll potentially have to iterate through every character in our alphabet to find it. Any of those characters could be correct, so on average it’ll hit somewhere around the middle, so given an alphabet of size A, it should average out to A/2 guesses per letter (let’s assume the subject is small and there are no repeating patterns of 2+ characters).

I’ll keep building this substring until it eventually hits the end and no characters can extend it further.

 But that’s not enough — most likely, there will be a prefix to the string that I missed, because I started in a random place. Easy enough: all I have to do is now repeat the process, except going backwards.

Once the process terminates, I should be able to reconstruct the password. In total, I’ll need to figure outL characters(where L is the length), and need to expend on average A/2 guesses per character (where A is the alphabet size), so total guesses = A/2 * L.

To be precise, I also have to add another 2A to the number of guesses for ascertaining that the string has terminated on each end. So the total is A/2 * L + 2A, which we can factor as A(L/2 + 2).

Let’s assume we have 20 characters in our password, and an alphabet consisting of a-z (26) and 0–9 (10), so a total alphabet size of 36. So we’re looking at an average of 36 * (20/2 + 2) = 36 * 12 = 432 iterations.

Damn. 

This is actually doable.

The Implementation

First things first: I need to write a client that can programmatically query the search box. This will serve as my substring oracle. Obviously this site has no API, so I’ll need to scrape the website directly.

Looks like the URL format for searching is just a simple query string, www.lettermelater.com/account.php?qe=#{query_here}. That’s easy enough.

Let’s start writing this script. I’m going to use the Faraday gem for making web requests, since it has a simple interface that I know well.

I’ll start by making an API class.

Of course, we don’t expect this to work yet, as our script won’t be authenticated into any account. As we can see, the response returns a 302 redirect with an error message provided in the cookie.

[10] pry(main)> Api.get(“foo”)
=> # ...
{“date”=>”Tue, 04 Apr 2017 15:35:07 GMT”,
“server”=>”Apache”,
“x-powered-by”=>”PHP/5.2.17",
“set-cookie”=>”msg_error=You+must+be+signed+in+to+see+this+page.”,
“location”=>”.?pg=account.php”,
“content-length”=>”0",
“connection”=>”close”,
“content-type”=>”text/html; charset=utf-8"},
status=302>

So how do we sign in? We need to send in our cookies in the header, of course. Using Chrome inspector we can trivially grab them.

(Not going to show my real cookie here, obviously. Interestingly, looks like it’s storing user_id client-side which is always a great sign.)

Through process of elimination, I realize that it needs both code and user_id to authenticate me… sigh.

So I add these to the script. (This is a fake cookie, just for illustration.)

[29] pry(main)> Api.get(“foo”)
=> “\n<!DOCTYPE HTML PUBLIC \”-//W3C//DTD HTML 4.01//EN\” \”http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n\t<meta http-equiv=\”content-type\” content=\”text/html; charset=UTF-8\” />\n\t<meta name=\”Description\” content=\”LetterMeLater.com allows you to send emails to anyone, with the ability to have them sent at any future date and time you choose.\” />\n\t<meta name=\”keywords\” content=\”schedule email, recurring, repeating, delayed, text messaging, delivery, later, future, reminder, date, time, capsule\” />\n\t<title>LetterMeLater.com — Account Information</title>…
[30] pry(main)> _.include?(“Haseeb”)
=> true

It’s got my name in there, so we’re definitely logged in!

We’ve got the scraping down, now we just have to parse the result. Luckily, this pretty easy — we know it’s a hit if the e-mail result shows up on the page, so we just need to look for any string that’s unique when the result is present. The string “password” appears nowhere else, so that will do just nicely.=op

That’s all we need for our API class. We can now do substring queries entirely in Ruby.

[31] pry(main)> Api.include?('password')=> true[32] pry(main)> Api.include?('f')=> false[33] pry(main)> Api.include?('g')=> true

Now that we know that works, let’s stub out the API while we develop our algorithm. Making HTTP requests is going to be really slow and we might trigger some rate-limiting as we’re experimenting. If we assume our API is correct, once we get the rest of the algorithm working, everything should just work once we swap the real API back in.

So here’s the stubbed API, with a random secret string:

We’ll inject the stubbed API into the class while we’re testing. Then for the final run, we’ll use the real API to query for the real password.

So let’s get started with this class. From a high level, recalling my algorithm diagram, it goes in three steps:

  1. First, find the first letter that’s not in the subject but exists in the password. This is our starting off point.
  2. Build those letters forward until we fall off the end of the string.
  3. Build that substring backwards until we hit the beginning of the string.

Then we’re done!

Let’s start with initialization. We’ll inject the API, and other than that we just need to initialize the current password chunk to be an empty string.

Now let’s write three methods, following the steps we outlined.

Perfect. Now the rest of the implementation can take place in private methods.

For finding the first letter, we need to iterate over each character in the alphabet that’s not contained in the subject. To construct this alphabet, we’re going to use a-z and 0–9. Ruby allows us to do this pretty easily with ranges:

ALPHABET = ((‘a’..’z’).to_a + (‘0’..’9').to_a).shuffle

I prefer to shuffle this to remove any bias in the password’s letter distribution. This will make our algorithm query A/2 times on average per character, even if the password is non-randomly distributed.

We also want to set the subject as a constant:

SUBJECT = ‘password’

That’s all the setup we need. Now time to write find_starting_letter. This needs to iterate through each candidate letter (in the alphabet but not in the subject) until it finds a match.

In testing, looks like this works perfectly:

PasswordCracker.new(ApiStub).send(:find_starting_letter!) # => 'f'

Now for the heavy lifting.

I’m going to do this recursively, because it makes the structure very elegant.

The code is surprisingly straightforward. Let’s see if it works with our stub API.

[63] pry(main)> PasswordCracker.new(ApiStub).crack!ffjfjpfjpefjpeffjpefofjpefojfjpefoj4fjpefoj49fjpefoj490fjpefoj490rfjpefoj490rjfjpefoj490rjgfjpefoj490rjgsfjpefoj490rjgsd=> “fjpefoj490rjgsd”

Awesome. We’ve got a suffix, now just to build backward and complete the string. This should look very similar.

In fact, there’s only two lines of difference here: how we construct the guess, and the name of the recursive call. There’s an obvious refactoring here, so let’s do it.

Now these other calls simply reduce to:

And let’s see how it works in action:

Apps-MacBook:password-recovery haseeb$ ruby letter_me_now.rbCurrent password: 9Current password: 90Current password: 90rCurrent password: 90rjCurrent password: 90rjgCurrent password: 90rjgsCurrent password: 90rjgsdCurrent password: 90rjgsdCurrent password: 490rjgsdCurrent password: j490rjgsdCurrent password: oj490rjgsdCurrent password: foj490rjgsdCurrent password: efoj490rjgsdCurrent password: pefoj490rjgsdCurrent password: jpefoj490rjgsdCurrent password: fjpefoj490rjgsdCurrent password: pfjpefoj490rjgsdCurrent password: hpfjpefoj490rjgsdCurrent password: 0hpfjpefoj490rjgsdCurrent password: 20hpfjpefoj490rjgsdCurrent password: 420hpfjpefoj490rjgsdCurrent password: g420hpfjpefoj490rjgsdg420hpfjpefoj490rjgsd

Beautiful. Now let’s just add some more print statements and a bit of extra logging, and we’ll have our finished PasswordCracker.

And now… the magic moment. Let’s swap the stub with the real API and see what happens.

The Moment of Truth

Cross your fingers…

PasswordCracker.new(Api).crack!

(Sped up 3x)

Boom. 443 iterations.

Tried it out on Reddit, and login was successful.

Wow.

It… actually worked.

Recall our original formula for the number of iterations: A(N/2 + 2). The true password was 22 characters, so our formula would estimate 36 * (22/2 + 2) = 36 * 13 = 468 iterations. Our real password took 443 iterations, so our estimate was within 5% of the observed runtime.

Math.

It works.

Embarrassing support e-mail averted. Reddit rabbit-holing restored. It’s now confirmed: programming is, indeed, magic.

(The downside is I am now going to have to find a new technique to lock myself out of my accounts.)

And with that, I’m gonna get back to my internet rabbit-holes. Thanks for reading, and share this if you enjoyed it!

-Haseeb


2016 donations and some thoughts on the “Muslim Ban”

I was originally planning to write this post reflecting on 2016 and my year-end donations (I know, better late than never). But given the political climate in the U.S. right now, I’m feeling pretty shaken. I don’t usually write about politics, but I decided I needed to share a few thoughts.

First, donations.

[Note: for those who don’t know my background; I am an effective altruist, and I earn-to-give. This means I entered into the tech industry so I could donate 33% of my pre-tax income to high-impact charities every year. I also blog openly about it.]

I first started earning-to-give when I landed my first job in the tech industry in June 2015. In 2015 I donated a total of $21,200.

In 2016, my donations totaled $50,600. My finances this year were little more complicated, but that was my best estimate of 33% of my pre-tax income. (That income does not include RSUs; whenever I can liquidate them, I will also donate 33% of their value.)

Below are the organizations I donated to and why.

The Against Malaria Foundation

Donation: $12,650 (25%)

The Against Malaria Foundation distributes low-cost anti-mosquito bednets in parts of Africa that are ravaged by malaria. AMF has been repeatedly ranked by Givewell as the dollar-for-dollar most impactful charity in the world.

It’s important to make speculative and high-risk altruistic investments. But there is some straightforward value in just rewarding and spreading the word about organizations that rock at saving lives (and in the worst case, to have no doubt that one’s donations are having real positive impact). I also donated to them in 2015, and good chance I’ll donate again in 2017.

.impact

Donation: $12,650 (25%)

.impact is a grassroots EA organization that maintains a lot of Effective Altruism’s infrastructure, including the EA Forum (which I highly recommend). One of their most exciting projects is LEAN (Local Effective Altruism Network), which helps to seed and support university EA organizations. I also donated to them in 2015.

Young people have already shown that in many ways they are going to be the primary vector for change in this world. And as those young people come into power, I’d love to see more of them thinking rigorously about how to do good. 

In short, I think influencing more young people to think critically about effectiveness is one of our best levers for ensuring a positive future.

80,000 Hours

Donation: $25,300 (50%)

My largest donation this year was to 80,000 Hours (80K). 80K is an organization that advises young people on how to do the most good with their careers. They analyze different career paths, balancing career capital with altruistic aims.

80K actually strongly affected my own trajectory when I was considering career pursuits. Reading through their career guide on tech entrepreneurship influenced my original decision to enter into the tech industry.

80K has had had impressive growth and has done a lot of good for influencing more students on the path to altruistic lives. There’s a big talent gap in effective altruism right now, and 80K seems like the best investment for filling that gap. I’m excited to see what they can do in 2017.

So that wraps up my donations. Now I’d like to do what I normally never do, and say a few words about the political climate in the U.S.

Authoritarianism, walls, and the “Muslim Ban”

Far more capable minds than mine have spilled enough ink on this topic, so I’m going to keep my words brief.

Things are moving faster than anyone expected. But history has seen this before. Our environment is likely to change fast, and unpredictably.

Keep your eyes open. Be vigilant. Know your power and use it wisely, and where you have none, stay safe.

It’s a scary and saddening time. History books will struggle to make sense of this. And when we are old, we will look back and talk with shame about the barbarism that America, for a time, succumbed to.

But I am optimistic. When I see the protests happening across the U.S. and around the world, the international condemnation of these regressive and protectionist policies, when I see the power and fury of a culture founded on inclusion and love—it gives me confidence.

The world is changing. Though we may have stumbled, we are going to take two steps forward.

I, for one, am going to keep fighting in my own way. 

I hope you do the same.

-Haseeb


10 Principles I Want to Live By

I just came home from a vow of silence at a meditation center in northern California. It’s a strange feeling coming back to city life after five days of silent meditation.

Looking around at puffing joggers, Christmas wreaths, eager couples waiting outside restaurants, the stop and start of traffic — it’s almost too much for my senses.

The last time I took a vow of silence was 5 years ago. It lasted ten days. I had just walked away from my career as a poker player then. I was lost, confused. I was angry at myself. Entering the veil of silence, I expected to come out the other side with answers.

(more…)

How Not to Bomb Your Offer Negotiation

So you know the first 6 rules. You’ve maneuvered through the initial offer conversation, you’ve lined up counteroffers from other companies, and now it’s time to move into the actual negotiating.

Naturally, this is the part where everything goes horribly wrong.

But worry not. Stick with me, and I’m going to make you into a superhuman negotiator. (Or at least an eccentric billionaire negotiator, which is sometimes better?)

Seriously though. In this article I’m going to deep dive on the whole negotiating process, and discuss the final 4 rules on how to negotiate a job offer.

Right. Let’s start from the top.

What does it take to be a good negotiator?

(more…)

Ten Rules for Negotiating a Job Offer

When the story of how I landed a job at Airbnb went viral, I was surprised at how infatuated people were with my negotiations. Media stories portrayed me as some kind of master negotiator—a wily ex-poker-player who was able to con the tech giants into a lucrative job offer.

This is silly. It’s silly for a lot of reasons, but one of the main ones is that in reality, my negotiation skills are nothing special. There are lots of job candidates who are better negotiators than I, to speak nothing of recruiters and other professional negotiators.

It just so happens that most people don’t negotiate at all, or if they do, they just negotiate just enough to satisfy themselves that they did.

Worse yet, most of the advice out there on negotiation is borderline useless. Almost anything you read on the subject will be a vague and long-winded exhortation to “make sure you negotiate” and “never say the first number.” Beyond those two morsels of advice, you’re pretty much on your own.

I thought to myself: why is there so little actionable advice out there about negotiation? I suspect it’s because deep down, many people believe that negotiation is inexplicable, that it’s something some people can do and others can’t, and that there’s no real way to break it down so anyone can learn it.

I say that’s bullshit. Negotiation is a skill that can be learned just like any other, and I don’t believe it’s particularly elusive or hard to understand. So I’m going to try to explain how anyone can do it.

Three caveats.

First: I’m not an expert. There are people who really are experts at this, and when my advice contradicts theirs, you should assume I’m wrong.

Second: negotiation is tricky to generalize about because it’s deeply intertwined with social dynamics and power. The appropriate advice for an Asian male in Silicon Valley may not be appropriate for a black woman in Birmingham, Alabama. Racial, sexual, and political dynamics accompany you to the negotiating table.

At the same time, I want to caution against overemphasizing these factors. Being afraid to negotiate out of fear of discrimination can often be just as deleterious as discrimination itself.

Ceteris paribus, negotiate aggressively.

Third: I’m the first to admit that negotiation is stupid. It’s a practice that inherently benefits those who are good at it, and is an absurd axis on which to reward people. But it’s a reality of our economic system. And like most collective action problems, we’re probably not going to be able to abolish it any time soon. In which case, you might as well improve at it.

So here’s my guide to negotiation. It’s going to be split into two parts: this first part will be about conceptualizing the negotiating process, about how to begin the process and set yourself up for maximal success. The second part will be advice on the actual back-and-forth portion of negotiating and how to ask for what you want.

Let’s take it from the top.

What it means to “get a job”

In our culture we call entering the employment market “trying to get a job.” This is an unfortunate turn of phrase. “Getting a job” implies that jobs are a resource out in the world, and you’re attempting to secure one of these resources. But that’s completely backwards. What you are actually doing is selling your labor, and a company is bidding for it.

Employment is just striking a mutual deal in the labor market.

Like any market, the labor market only functions well if it’s competitive. This is the only way to ensure fair and equitable pricing. Imagine you were a farmer selling watermelons. Would you just sell your watermelons to the first buyer who agreed to purchase them? Or would you survey the marketplace of buyers, see the best price (and business partner) you could get, and then make an informed decision on which buyer to sell to?

And yet, when people talk about the labor market, they think “oh, a company wants to give me a job! What a relief!” As though having a job were in itself some special privilege for which a company is the gatekeeper.

Dispel yourself of this mindset.

A job is just a deal. It is a deal between you and a company to exchange labor for money (and other things you value).

This might sound like an abstract point, but you should absolutely approach negotiation from this perspective.

The role of negotiation

Negotiating is a natural and expected part of the process of trying to make a deal. It’s also a signal of competence and seriousness. Companies generally respect candidates who negotiate, and most highly attractive candidates negotiate (if for no other reason, because they often have too many options to choose from).

At the risk of spouting truisms: always, always negotiate. Doesn’t matter how good or bad you think you are. You never damage a relationship by negotiating.

In all my time as an instructor at App Academy, out of hundreds of offers negotiated, only once or twice were offers ever rescinded in negotiations. It basically never happens. And when it does, usually the candidate was being an unconscionable asshole, or the company was imploding and needed an excuse to rescind the offer.

You might think to yourself: “well, I don’t want to set high expectations, and the offer is already generous, so I ought to just take it.

No. Negotiate.

Or maybe: “I don’t want to start off on the wrong foot and look greedy with my future employer.

No. Negotiate.

But this company is small and—

No. Shut up. Negotiate.

We’ll talk more in the next section about why a lot of these objections are bullshit, and fundamentally misapprehend the dynamics of hiring. But for now, just trust me that you should always negotiate.

The ten rules of negotiating

I’ve tried to boil down negotiation to ten rules. The rules, in order of appearance, are:

  1. Get everything in writing
  2. Always keep the door open
  3. Information is power
  4. Always be positive
  5. Don’t be the decision maker
  6. Have alternatives
  7. Proclaim reasons for everything
  8. Be motivated by more than just money
  9. Understand what they value
  10. Be winnable

We’ll only get through some of these in this blog post, and the rest will appear in the second part. But I’ll explain each rule as we get to it.

So let’s start from the top and try to walk through a negotiation process from the very beginning. For most, that starts when you receive an offer.

The offer conversation

You’ve just received the phone call: your interview went well, and after much deliberation they decided they like you. They want to make you an offer. Congratulations!

Don’t get too excited though. The fun is just getting started.

Thank your recruiter. Sound excited—hopefully this won’t be hard. Before jumping into details, try to ask for specific feedback on your interview performance. If they give it to you, this will help you gauge how much they want you, as well as tell you things you can improve on in your next interview(s).

Now time to explore the offer.

Rule #1 of negotiating: have everything in writing.

Eventually, they’ll give you information about the offer. Write it all down. Doesn’t matter if they’re going to send you a written version later, write everything down. Even if there are things that are not directly monetary, if they relate to the job, write them down. If they tell you “we’re working on porting the front-end to Angular,” write that down. If they say they have 20 employees, write that down. You want as much information as you can. You’ll forget a lot of this stuff, and it’s going to be important in informing your final decision.

Depending on the company, they’ll also tell you about the equity package. We’ll look more specifically at equity in part II, but be sure to write everything down.

The rule from here on out is that everything significant you discuss will have some kind of a paper trail. Often, the company won’t even send you an official offer letter until a deal is finalized. So it falls to you to confirm all of the important details in subsequent e-mails.

So yadda yadda, lots of details, writing stuff down, oh there’s a joke, time to laugh. Now the recruiter is done talking and you’re done asking all of your questions.

Your recruiter will now say something along the lines of “so what do you think?

This seems innocuous, but your reply here is critical, because there’s a lot you can say to weaken your position. This is your first decision point.

A decision point is a moment in the negotiation where your interlocutor wants to compel you to make a decision. If they succeed in tying you to a position, they will close the door on further negotiating. Of course “what do you think?” is a subtle prod. But it is the beginning of many attempts to get you to make a premature commitment.

This leads to rule #2 of negotiating: always keep the door open. Never give up your negotiating power until you’re absolutely ready to make an informed, deliberate final decision.

This means your job is to traverse as many of these decision points as possible without giving up the power to continue negotiating. Very frequently, your interlocutor will try to trick you into making a decision, or tie you to a decision you didn’t commit to. You must keep verbally jiu-jitsu-ing out of these antics until you’re actually ready to make your final decision.

Protecting information

There’s an uncomfortable silence by now, and their “what do you think?” is hanging in the air.

If you say “yes, that sounds amazing, when do I start?” you implicitly accept the offer and completely close the door on the negotiation. This is your recruiter’s number one favorite thing to hear. It stands to reason you probably shouldn’t do this.

But their second favorite thing to hear you say is “can you do 90K instead of 85K?” This also closes the door, but for a different and more subtle reason. And it’s the number one reason why most people suck at negotiation.

Rule #3 of negotiating: information is power. To protect your power in the negotiation, you must protect information as much as possible.

A company doesn’t give you insight into what it’s thinking. It doesn’t tell you its price range, how much it paid the previous candidate with your experience, or anything like that. It intentionally obfuscates those things. But it wants you not to do the same.

A company wants to be like a bidder in a secret auction. But unlike the other bidders, it wants to know exactly how high all of the other bids are. It then openly intends to exploit that knowledge, often by bidding one cent more than the second highest bid.

Yeah, no. Screw that. It’s a silent auction, and to keep it that way, you must protect information.

In many situations, the only reason why you have any negotiating power at all is because the employer doesn’t actually know what you’re thinking. They might not know how good your other offers are, or how much you were making in your last job, or how you weigh salary vs equity, or even how rational you are as a decision-maker. Bottom line, you want them to be uncertain on exactly what it would take to sign you.

When you say “can you do 90K instead of 85K,” you’ve told them exactly what it will take to make you sign. The sheet’s pulled back, the secret auction is up, and they’re going to bid 90K (or more likely, 87K). And they know there’s almost no risk in doing so, because you’ll probably accept.

What if you were the kind of person who wouldn’t even consider an offer below 110K? Or the kind of person who wouldn’t consider an offer below 120K? If you were, you wouldn’t ask for 90K, and if they offered it as conciliation, you’d tell them to stop wasting your time.

By staying silent, they don’t actually know which of those kinds of people you are. In their mind, you could be any of the three.

A corollary of this rule is that you should not reveal to companies what you’re currently making. There are some exceptions, but as a rule you should assume this. If you must divulge what you’re making, you should be liberal in noting the total value of your package (incorporate bonuses, unvested stock, nearness to promotion etc.), and always mention it in a context like “[XYZ] is what I’m currently making, and I’m definitely looking for a step up in my career for my next role.

Companies will ask about your current compensation at different stages in the process—some before they ever interview you, some after they decide to make you an offer. But be mindful of this, and protect information.

So given this offer, don’t ask for more money or equity or anything of the sort. Don’t comment on any specific details of the offer except to clarify them.

Give away nothing. Retain your power.

Say instead: “Yeah, [COMPANY_NAME] sounds great! I really thought this was a good fit, and I’m glad that you guys agree. Right now I’m talking with a few other companies so I can’t speak to the specific details of the offer until I’m done with the process and get closer to making a decision. But I’m sure we’ll be able to find a package that we’re both happy with, because I really would love to be a part of the team.

Think like the watermelon farmer. This offer is just is the first businessman who’s stopped by your watermelon patch, glanced over your crops, and announced “I’ll take all of these right now for $2 a melon.”

Cool. It’s a big market, and you’re patient—you’re a farmer after all. Just smile and tell them you’ll keep their offer in mind.

And this is super important: always be unequivocally positive.

The importance of positivity

Staying positive is rule #4 of negotiation. Even if the offer is shit, it’s extremely important to remain positive and excited about the company. This is because your excitement is one of your most valuable assets in a negotiation.

A company is making you an offer because they think you’ll do hard work for them if they pay you. If you lose your excitement for the company during the interview process, then they’ll lose confidence that you’ll actually want to work hard or stay there for a long time. Each of those makes you less attractive as an investment. Remember, you are the product! If you become less excited, then the product you’re selling actually loses value.

Imagine you were negotiating with someone over buying your watermelons, but the negotiation took so long that by the time you’d reached an agreement, your watermelons had gone bad.

Companies are terrified of that. They don’t want their candidates to go bad during a negotiation. Hence why they hire professional recruiters to manage the process and make sure they remain amicable. You and the recruiter share the same interest in that regard. If a company feels like you’ve gone bad, suddenly they’re a lot less willing to pay for you.

So despite whatever is happening in the negotiation, give the company the impression that 1) you still like the company, and that 2) you’re still excited to work there, even if the numbers or the money or the timing is not working out. Generally the most convincing thing to signal this is to reiterate you love the mission, the team, or the problem they’re working on, and really want to see things work out.

Don’t be the decision-maker

You can wrap up the conversation now by saying: “I’ll look over some of these details and discuss it with my [FAMILY/CLOSE_FRIENDS/SIGNIFICANT_OTHER]. I’ll reach out to you if I have any questions. Thanks so much for sharing the good news with me, and I’ll be in touch!

So not only are you ending the conversation with the power all in your hands, but note there’s another important move here: you’re roping in other decision-makers.

Rule #5 of negotiation: don’t be the decision-maker. Even if you don’t particularly care what your friends/family/husband/mother thinks, by mentioning them, you’re no longer the only person the recruiter needs to win over. There’s no point in them trying to bully and intimidate you; the “true decision-maker” is beyond their reach.

This is a classic technique in customer support and remediation. It’s never the person on the phone’s fault, they’re just some poor schmuck doing their job. It’s not their decision to make. This helps to defuse tension and give them more control of the situation.

It’s much harder to pressure someone if they’re not the final decision-maker. So take advantage of that.

Okay!

We have our first offer. Send a follow-up e-mail confirming all of the details you discussed with your recruiter so you have a paper trail. Just say “just wanted to confirm I had all the details right.

Groovy. Next step is to leverage this to land other offers and find the best deal we can find in the job market.

Getting other offers

Turns out, it doesn’t matter that much where your first offer is from, or even how much they’re offering you. Just having an offer in hand will get the engine running.

If you’re already in the pipeline with other companies (which you should be if you’re doing it right), you should proactively reach out and let them know that you’ve just received an offer. Try to build a sense of urgency. Regardless of whether you know the expiration date, all offers expire at some point, so take advantage of that.

“Hello [PERSON],

I just wanted to update you on my own process. I’ve just received an offer from [COMPANY] which is quite strong. That said, I’m really excited about [YOUR AMAZING COMPANY] and really want to see if we can make it work. Since my timeline is now compressed, is there anything you can do to expedite the process?”

Should you specifically mention the company that gave you an offer? Depends. If it’s a well-known company or a competitor, then definitely mention it. If it’s a no-name or unsexy company, you should just say you received an offer. If it’s expiring soon, you should mention that as well.

Either way, send out a letter like this to every single company you’re talking to. No matter how hopeless or pointless you think your application is, you want to send this signal to everyone who is considering you in the market.

Second, if there are any other companies you are looking to apply to (whether through referral or cold application), or even companies at which you’ve already applied but haven’t heard back, I would also follow up with a similar e-mail.

So why do this? Isn’t this tacky, annoying, or even desperate?

None of the above. It is the oldest method in history to galvanize a marketplace—show that supplies are limited and build urgency. Demand breeds demand. Not every company will respond to this, but many will.

Isn’t it stupid that companies respond to this though?

Why companies care about other offers

When I wrote about the story of my own job search, I mentioned how having an offer from Google made companies turn around and expedite me through their funnels. Many commentators lamented at the capriciousness of these companies. If Uber or Twitch only talked to me because of Google and until then weren’t willing to look at me, what did that say about their hiring processes? What legitimately are they evaluating, if anything at all?

I think this response is totally backwards. The behavior of tech companies here is actually very rational, and you would do well to understand it.

First, you must realize what a company’s goal is. A company’s goal is to hire someone who will become an effective employee and produce more value than their cost. How do you figure out who will do that? Well, you can’t know for certain without actually hiring them, but there are a few proxies. Pedigree is the strongest signal; if they did it at other companies, they can probably do it at yours. And if someone trusted within the organization can vouch for them, that’s often a strong signal as well.

But turns out, almost everything else is a weak signal. Weak in the sense that it’s just not very reliable. Interviews, if you think about it, are long, sweaty, uncomfortable affairs that only glancingly resemble actual employment. They’re weird and can’t tell you that much about whether an individual will be a good at their job. There’s no way around this. There are a few stronger signals, like bringing someone in for a week or two on a contract-to-hire position, but strong candidates won’t consider this. So candidates as a whole have effectively forced companies to assume almost all of the risk in hiring.

The truth is, knowing that someone has passed your interview just doesn’t say that much about whether they’ll be a good employee. It’s as though you knew nothing about a student other than their SAT score. It’s just not a lot of data to go off.

Nobody has solved this problem. Not Google nor anyone else.

And this is precisely why it’s rational for companies to care that you’ve received other offers. They care because each company knows that their own process is noisy, and the processes of most other companies are also noisy. But a candidate having multiple offers means that they have multiple weak signals in their favor. Combined, these converge into a much stronger signal than any single interview. It’s like knowing that a student has a strong SAT score, and GPA, and won various scholarships. Sure, it’s still possible that they’re a dunce, but it’s much harder for that to be true.

This is not to say that companies respond proportionally to these signals, or that they don’t overvalue credentials and brands. They do. But caring about whether you have other offers and valuing you accordingly is completely rational.

So this is all to say—tell other companies that you’ve received offers. Give them more signal so that they know you’re a valued and compelling candidate. And understand why this changes their mind about whether to interview you.

As you continue interviewing, remember to keep practicing your interview skills. The single strongest determinant of your final offer will be the number and strength of offers that you receive.

Some advice on timing

You want to be strategic about the timing of your offers. Generally, you should try to start interviewing at larger companies earlier. Their processes are slower and their offer windows are wider (meaning they allow you more time to decide). Startups are the other way around.

Your goal should be to have as many offers overlapping at the same time as possible. This will maximize your window for negotiating.

When you receive an offer, often the first thing you should ask for is more time to make your decision. Especially in your first offer, more time is by far the most valuable thing you can ask for. It’s time that enables you to activate other companies and end up with the strongest possible offer. So be prepared to fight for time.

How to approach exploding offers

Hoo boy.

Exploding offers are offers that expire within 24-72 hours. You won’t see this much at big companies, but they’re becoming increasingly common among startups and mid-sized companies.

Exploding offers suck, and I share most people’s disdain for this practice. But I do understand it. Exploding offers are a natural weapon for employers to combat a strong hiring market for tech workers. Companies know exactly what they’re doing with exploding offers—they play on fear and limit your ability to seek out counteroffers.

In a sense, it’s unsurprising that if startups have more difficulty attracting and securing talent, they’d resort to this practice. What I don’t like is the dishonesty about it. Employers often justify this by saying “If you need more time than this, then that’s a sign you’re not the kind of person we’re looking for.

Please don’t buy this crap or feel guilty over it. They’re simply doing this to improve their chance of closing candidates. Needing more than three days to make a life decision isn’t a sign of anything other than thoughtfulness.

So what should you do if you receive an exploding offer?

Exploding offers are anathema to your ability to effectively navigate the labor market. Thus, there is only one thing to do. Treat the offer as a non-offer unless the expiration window is widened.

In no uncertain terms, convey that if the offer is exploding, it’s useless to you.

Example conversation: “I have one big concern. You mentioned that this offer explodes in 48 hours. I’m afraid this doesn’t work at all for me. There’s no way that I can make a decision on this offer within a 48 hour window. I’m currently wrapping up my interview process at a few other companies, which is likely to take me another week or so. So I’m going to need more time to make an informed decision.

If they push back and say this is the best they can do, then politely reply: “That’s really unfortunate. I like [YOUR COMPANY] and was really excited about the team, but like I said, there’s no way I can consider this offer. 48 hours just too unreasonable of a window. The next company I join will be a big life decision for me, and I take my commitments very seriously. I also need to consult with my [EXTERNAL_DECISION_MAKER]. There’s no way that I can make a decision I’m comfortable with in this short an amount of time.

Pretty much any company will relent at this point. If they persist, don’t be afraid to walk away over it. (They probably won’t let that happen, and will come grab you as you’re walking out the door. But if they don’t, then honestly, screw ’em.)

I was given several exploding offers during my job search. And every time, I did essentially this. Every single offer immediately widened to become more reasonable, sometimes by several weeks.

I want to emphasize, lest I be misunderstood here—what I’m saying is not to just silently let an exploding offer expire, and assume that everything will be fine and they’ll still hire you. They won’t. For exploding offers to be a credible weapon, a company has to have a reputation of enforcing them. I’m saying explicitly call this out as an issue when they make the offer.

Don’t let a company bully you into giving away your negotiating power.

The Negotiating Mindset

Before we enter into the actual back-and-forth, I want to examine the mindset you should have as a negotiator. This applies not just to how you approach the conversation, but also to how you think about the company.

Do not fall into the trap of valuing companies solely along one dimension. That means don’t just value companies based on salary, equity, or even on prestige. Those are all important dimensions, but so are cultural fit, the challenge of the work, learning potential, later career options, quality of life, growth potential, and just overall happiness. None of these inherently trump any of the other. Anyone who tells you “just choose wherever you think you’ll be happiest” is being just as simplistic than someone who says “just choose the one that offers the most money.” All of these things matter, and your decision should be genuinely multi-dimensional.

Be open to being surprised as you explore different companies.

It’s also important to understand that companies don’t all value you along the same dimension either. That is, different companies are genuinely looking for different skills, and there are some companies at which you will be more and less valuable. Even at peer companies this is true, especially so if you have a specialized skill-set.

The more companies you talk to, the more likely you are to find a company to which you are significantly more valuable than the rest. Chances are this is where you’ll be able to negotiate your strongest offer. It might surprise you which company this turns out to be; keep an open mind, and remember that a job search is a 2-sided process.

One of the most valuable things you can do for yourself in this process is to really try to understand how employers think and what motivates them. Understanding your interlocutor is extremely important in negotiation, and we’ll be exploring that a lot in the next blog post.

But most of all I want to emphasize: be curious about the other side. Try to understand why employers think the way they do. Be sympathetic toward them. Care about what they want and help them try to get it. Adopting this mindset will make you a much stronger negotiator, and accordingly, a much better employee and team member.

Okay. That’s as far as we’re going for today. In the next blog post, I’m going to cover the last four rules of negotiation. I’ll also go over the actual back-and-forth process—how to ask for what you want, how to strengthen offers, and how to dismantle the tricks that companies will try to pull on you. Also a lot more on the theory of negotiation, which I really dig.

Do share this post if you found it useful! And follow me on Twitter.

You can read part 2 here!

Until next time,

-Haseeb