Search Engine Series Part II – Exact pattern matching

In Part 1 of the series (here: https://codeandcodes.com/2015/10/04/search-engine-series-basic-ngram-indexing/), I described how to construct ngram indices for a body of text.  We saw however, that ngram matching while quick, is imprecise because it matches too greedily.  By parsing the query also into ngrams, we ended up getting matches that the user would not have been looking for.

In this part II, I discuss how to achieve exact pattern matching.  Relevance is more than a function of matching a query to a list of results.  There is a psychological component.  The gist of surfacing relevant data thus means returning results that are in the realm of expectations for a user.  In other words, while a result set can be filtered in a technical sense to a set of results to return, it’s no good if a technical match is out the realm of expectation for the user.  For example, using a simple weighting function like Levenshtein distance may yield a technically high scoring result, but if the minimal string transformations yield an unexpected result, the result is no good (e.g. “and” and “end”).  We can minimize the effect by naively enforcing exact pattern matching.

Algorithm

In part I, parsing the users query and piping it through the ngram map yielded an array of matching words to any ngram. We stripped the array of duplicates and returned the entire set to the user. However, we saw many false positives returned along with the good results. How do we eliminate those false positives?  It turns out that achieving exact pattern matching is pretty simple and elegant. Each ngram array returned (e.g. for the query “governmen”) included an array of results that could be potential matches. In order to eliminate extraneous non-matches (like “fundamentally” or “settlement”) which match on “men”, we simply need to take the intersection of all result arrays.  This yields a precise match against the string.

var merge = function(arrays) {
        var returnArray = [];
        if (!arrays) return [];
        var matches = {};
        arrays.forEach(function(array) {
            array.reduce(function(matches, word) {
                if (!matches.hasOwnProperty(word)) {
                    matches[word] = 1;
                } else {
                    matches[word] += 1;
                }
                return matches;
            }, matches);
        });
        
        //If the word intersects all arrays
        returnArray = select(Object.keys(matches), function(word) {
            return matches[word] === arrays.length;
        });
        return returnArray;
    };

Proof

Why does this work?  Essentially, with our prior greedy approach, as we parsed the user’s query and filtered our hash, keying on each trigram that was created, we were left with an array of arrays of all potential matches.  While this represented the complete set of matches, this also created situations where to qualify as a “result”, the word only needed to contain any trigram in the query.  Thus, each word within our filtered results represented in a partial match of the user’s query.  Ergo, to match a user’s query exactly, each word must match every ngram within the user’s query.  How did we find the list of words matching all trigrams within the user’s query?  Simple, just intersect the arrays.

See the implementation here: Part II: Exact Pattern Matching

Usual disclaimer applies: Keeping it simple for the sake of explanation, could be refactored, yadda yadda yadda.

Much better matching
Much better matching

Now we’re getting somewhere.  However, our search is still incomplete.  It’s not useful to simply return the word that matches the user’s query.

  • We want to return some context (i.e. the words before and after) the exact pattern match so the user can determine whether the result is useful or not.
  • We can also optimize our data structure for computeNGram.  Right now we store only unique matches per ngram, which was OK when determining if there is an exact match.  However, in order to store context, we can no longer quash duplicates.
  • We can optimize performance as well in order to still provide fast matches in the above bullet.

Stay tuned for part III.

Advertisements

Search Engine Series Part I – Basic ngram indexing

At Twitter, I’ve been spending a lot of time thinking about search engines and how to effectively index and surface data.  When it comes down to it, indexing methods mean a lot, but so do other some of “brute force” factors like:

  1. the quality of the data indexed
  2. the amount of data indexed
  3. transforming search queries through an effective DSL
  4. surfacing and ranking search results

Search has no silver bullet

Perhaps I’ve been learning more and more that there’s no magic bullet to search.  There’s several methods to indexing volumes of data, e.g. string tokenization, ngram tokenization; there’s levels of strictness of search, e.g. exact matches, fuzzy matches, partial matches; then there’s transformation of the search query itself, e.g. what indices to search, what parts of a query must be included in search results, fuzzyness matching and mispelling.

In this next series of posts, I’ll be describing some search basics that may be useful to the reader.

Computing NGram indices

Ngram indices are a good starting point for creating a searchable index of words.  I’ve included an example implementation here: Part 1: Constructing a Trigram index

Disclaimer: In this example, I use a toy implementation and trigrams for the sake of simplicity.  For the dictionary “corpus”, I use the Declaration of Independence.  The code examples are meant to only illustrate the basic implementation details and aren’t meant for production use (however, the code will be refined over time).

Constructing ngram indices is very simple – essentially one constructs a map of n-character length substrings from a dictionary of words, where each ngram maps onto the array of matching full words.  Different techniques can then be applied on top of this, including

  1. Scoring functions – for example, for the number of matching words in a document, take a basic distance b (where b is the # characters that match)
  2. Fuzzy matching – replace one character for each character of the trigram to generate a list of other potential matches
  3. Context – keep pointers to place in document to determine the contextual sentence

    // Compute NGrams
    var computeNGrams = function(dict) {     
        return dict.split(' ').reduce(function(hash, word) {
            return ngramize(hash, word);
        }, {});
    };
    
    // NGramize a word
    function ngramize(hash, word) {
        for (var i = 3; i < word.length+1; i++) {
            var s = word.substring(i - 3, i);
            if (!hash.hasOwnProperty(s)) {
                hash[s] = [word]
            } else {
                if (hash[s].indexOf(word) == -1) {
                    hash[s].push(word)
                }
            }
        }
        return hash;
    }

Algorithm

You can see that creation is simple:  Essentially, you just pass in a word of length i, traverse through the word creating all substrings of length N, where N is the “N” in “NGram”.  In this case, I’ve chosen to use trigrams, or NGrams of length 3.

As the user types in his/her query, we break that query apart into ngrams as well, and match against our ngram map (i.e. the corpus of data).  This gives us an array of arrays of matching words per query.  Then we simply flatten the array, remove duplicates and present the results to the user.

Example:

Too many matches
Too many matches

However, the astute reader will notice that matching ngrams to arrays of occurrences does not provide a useful search in itself whenever the query extends beyond the ngram length.  How do we solve for this?  The solution, it turns out is fairly simple.  Stay tuned for the next post.

Week 3, biglawrefuge. Just spitballing.

Week 3, what have we learned?

Biglawrefuge has been in existence now for three weeks.  This has been the slowest week for growth so far, adding only around 100 users.  The first week saw 250, the week after that another 300, then this week, the numbers have dropped back down to earth (for me).  There’s a limited audience to which biglawrefuge appeals at the moment, which is fine.  I just need to focus on making the product better while still getting the word out.  If it’s good enough, users will continue to come.

Screen Shot 2015-08-15 at 9.23.30 PM

This is an interesting statistic, provided by google analytics.  Biglawrefuge, though the numbers fluctuate drastically, sees on average about 1000 – 1500 page views a day and around 150 – 250 user sessions per day.  However, I’ve closely monitored the returning user count and the number keeps going up.  Maybe that’s because the number of new sessions is decreasing, or maybe it’s because the existing use base finds something of value on the site.

“What’s your number?”

In the past week, I’ve added the ability to find out your “contribution score.”  Contribution score is essentially a metric that is based on the number of jobs, reviews, interviews, and articles you contribute, which is then weighted by the number of likes each contribution sees.  It’s a quick and dirty estimate.  No science went into coming up with the weighting function (except just seeing that the numbers clustered closely together and that taking small actions would have an impact on your score).

Screen Shot 2015-08-15 at 9.27.51 PM
Woohoo! in zeroth place!

The idea of a contribution or user score is common to many websites.  I guess the rationale behind adding the feature is that users need to see a sense of change when they return to a website, a sense of progression, and a sense of reward.  When they contribute more, users end up forming a closer attachment to the website (probably by some combination of the sunk cost effect and the desire to achieve some goal).  I toyed around with the idea for a while, but finally implemented it.  To be perfectly honest, I have no idea if it’s a good feature or not.  However, I do have data relating to when users have contributed their data.  Hopefully this provides some motivation.

Likewise, I’ve also added the concept of achievements.  Achievements are really easy to get at the moment -they just consist of creating certain objects on the site, getting a certain number of likes on something you’ve contributed, and making comments and receiving comments.

Together we can achieve.
Together we can achieve.

Achievements are closely related to one’s score, but they’re more discrete and represent tangible steps to complete.  Now that I’m thinking of it, I should give a bonus to your score for each achievement.

What’s nice about biglawrefuge is the fact that there are no real expectations at the present.  It’s a website that has a moderate number of users.  They tend to be loyal.  They have been consistent.  It’s my first experience outside of work dealing with real users and the issues that go hand in hand with launching a product into the wild.  When I view it from that perspective, it makes it easier (mentally) to add in a new feature just to see if it works.  One thing I’m trying to avoid at least for now: Don’t quell innovation in the effort to maintain and grow one’s user base.  The bottom line is if I’m constantly worried about user growth, I’ll never take chances that could make the site great or teach me a valuable lesson.

Finally, some closing thoughts:

As for how things are going regarding biglawrefuge in general: To be frank, there have been mixed reactions so far.  Along with the mix of anonymous critiques, there are the doubters, those who are quick to find fault, and those who lack confidence in biglawrefuge’s ability to turn into something. Even for well-meaning friends, it’s all too easy to hop on that bandwagon.  That’s all right; I don’t blame them.   Going it alone is really really hard, because by yourself, you have to build, market, define and defend the product.  You have to establish the product vision, plans on how you scale it, plans on how to define when you’ve succeeded.  These are all things that companies founded by two or three co-founders have the luxury of handing-off to one person to focus on.

However, one article I read recently on hacker news provided some much needed encouragement: http://dontscale.com/stop-looking-for-a-cofounder/.  The article basically describes the nature of solo entrepreneurship and its pitfalls, but also describes the status quo as being better today.  PaaS like heroku really bring scalability to the masses.

Some other highlights from the article:

“Since it’s cheap and easy to spot faults in unproven business ideas, early votes of no confidence, even from well-meaning friends and family are standard fare. Expect and take them with a grain of salt.”

“…you need colleagues to brainstorm with, to talk you out of stupid decisions, and to cheer you up when things go wrong”

“In addition to crises, it’s also hard just staying motivated sometimes. The best way to cope is to maintain low expectations and stay busy working on things you can control.”

I love this article.  Maybe it’s just telling me what I want to hear, but it’s also a reminder that you don’t always need a team to succeed.  Drive and passion can take someone a long way, and can be that source of constant motivation even when there isn’t a reciprocal response.  Let’s get it done.

Week 2 of biglawrefuge, what have we learned?

Week 2 Stats

Two weeks have now passed since the launch of biglawrefuge.  It’s been really hectic, with trying to market the website through various channels.  Here are a few of the methods I’ve tried, along with how effective they’ve been:

1.  Emailing law journals/tabloids (e.g. Abovethelaw)/legal blogs

Effectiveness: Low

Description: I’ve tried emailing various online content providers like Abovethelaw, the National Law Journal, the WSJ Law Blog, and other legal bloggers.  So far, I’ve heard a “we’ll get back to you if we’re interested” from ATL, nothing from the NLJ or WSJ, and only one response from a legal blogger.  Not sure how to really grab their attention.  Maybe biglawrefuge needs to have more traffic before it’s worth of national attention.

2.  Direct referrals (e.g. posting in http://www.top-law-schools.com or http://www.jdunderground.com)

Effectiveness: High

Description: I started off by announcing biglawrefuge to TLS.  So far the community has been awesome.  Super supportive (mostly) and I’ve gotten both great feedback and really positive responses.  In many ways, that community represents the community that I’m directly marketing to.  The nature of biglaw hiring is that biglaw firms take disproportionately from the top law schools and the biggest confluence of students from that background gather on TLS.  Jdunderground is a MUCH smaller community.  Using google analytics as a guide, TLS drives 100x more traffic.

3. Social Networking (e.g. reddit posts, facebook announcements, tweets)

Effectiveness: Medium

Description: Every time I have something worth sharing, I’ve posted it to http://www.reddit.com/r/lawschool.  So far, I’ve made three self-referencing posts, which some users have not been too happy about.  Not sure why it’s that big of a deal, they’re not duplicative in any sense (except maybe by having the articles hosted on the same webpage).  In any case, the reddit community is large and the fact that everyone sees what’s on the frontpage makes it in many ways more effective than TLS.  The last two times I’ve posted an article, my average views has tripled or quadrupled.  Facebook on the other hand has been disappointing.  Most likely my friends are tired of hearing about biglawrefuge, so there aren’t many clicks driven by that.  Twitter has been useless, but that’s mainly because I have so few followers.

4.  Direct emailing (e.g. weekly emailing of users)

Effectiveness: Medium

Description: Each week so far, I’ve sent an email to all the users who are signed up for biglawrefuge. And as I send the email, I watch google analytics to see how many users get on the site.  It definitely brings people back.  I’ve heard from others that email campaigns are the way to go, but it seems like a fundamental problem with emailing users is getting the users first.  I understand that it’s a way to keep the momentum going, but obviously it doesn’t help to get the ball rolling.

Surprises, so far …. 

1. Content rules

Last week (or was it the first week? I don’t remember), I added the ability to add articles to biglawrefuge.  So far, I’ve kept this functionality locked down, but just added the ability for select users to contribute articles, subject to admin approval.  What’s been extremely surprising is that the few articles I’ve written have been incredibly popular:

http://www.biglawrefuge.com/articles/2-a-day-in-the-life-of-a-biglaw-attorney

http://www.biglawrefuge.com/articles/3-how-i-left-biglaw-part-i

When I post them to reddit or TLS, it ends up generating an enormous (for me) amount of traffic.  I know the articles are popular.  There’s the occasional bad comment here and there, but by and large people have all stated that they really like the content.  I think part of the reason for this reaction is my approach to writing the articles.  I’ve been 100% transparent when writing them, not hiding the ball, even at risk of my own reputation being tarnished.  That doesn’t matter.  I want to bring greater transparency to the legal profession, so what better way to do so than to lead by example?

2. Law students are shy

Despite having close to 600 users now, probably 3-400 of whom are going through OCI, there have only been 159 job postings.  I don’t know why law students are so secretive about this information.  I guarantee that extremely few people care one way or another.  So despite the thousands of views to the job postings and law firm reviews, law students are reluctant to contribute themselves.  I may eventually introduce some gating in the future to encourage more contribution, but won’t do that at first.  Cmon people, contribute!  I built this website for you.

3. Marketing is hard, as usual

It’s a constant battle to market the website.  I feel like my welcome is already wearing thin at TLS and reddit/r/lawschool.  Not sure what other channels there are besides direct contacting of various law schools career services offices.  And that’s an uncertainty, because I don’t know what the reception will be like.  The days I publish articles, traffic jumps sharply, but of course, it’s just a temporary spike.  Quickly after, the traffic mostly goes back to normal.  Hopefully, by the time I run out of content, the community will mostly be self-supported.

4.  Be honest with your community, and they’ll treat you well

I’ve been completely honest to the communities I’ve posted to.  I don’t plan on hiding the ball from them or suddenly changing what I’m doing.  I’ve been honest about the struggles of running biglawrefuge myself, with dealing with unfriendly folks, and with getting users to contribute.  Thank you ALL for those who have reached out to me to encourage me in the process.  It means a ton and it motivates me to continue writing and bettering biglawrefuge for you guys.

How I left biglaw (Part III)

… Dejected, I made the long trek back to my office, where I closed my door and contemplated my future as a lawyer.  I looked at the spreadsheet that I had made, counting down the months until I my net worth was $0.  Still over two years away.  I knew I wouldn’t make it.  I abandoned my plan to stay in law, and began to draft a new resume…

This is the final part of my story, and follows the trek from abandoning my plan to go in house to the decision to leave the law entirely.  On above the law, you often come across stories of biglaw associates who burn out and leave the law to do something else entirely.  For example, there’s the lego guy and the cupcake girl.  If you’ve been reading along, you’ll know my story isn’t as glamorous as the stories of those attorneys.  It’s just an ordinary tale of one biglaw associate who in desperation, decided to leave.

Part II of this post: How I left biglaw (Part II)

Part I of this post: How I left biglaw (Part I)

———

It turns out that no one outside the legal community cares that you work for a V5 law firm.  Lawyers, however, and law students in particular (myself included), are obsessed with prestige: “Where do you work?”, “How much were your bonuses?”, “Where’d you go to law school?”, “Where’d you clerk?”, “What’s your class rank?”  While in law school, I adopted this attitude, and it heavily influenced my decisions when applying to outside jobs.  After abandoning my plan to go in house, I was left with the alternative to reapply for engineering positions.  I had never stopped considering going back to engineering (from my first application submitted during Thanksgiving of the previous year), though I thought it would be more rational to try to get another job in a legal capacity first.  But after a string of failures, I reconsidered my reasons for wanting to stay in the law.  When viewed in retrospect, my reasons for wanting to stay in the law were very similar to the reasons I went to law school in the first place.  I wanted to continue telling others that I was a lawyer, I wanted to make my parents proud, and I wanted the financial security and social stature that came with being an attorney.  Compounding that was the harrowing sunk cost effect -hundreds of thousands of dollars and years of my life spent devoted to law, the mental effect of giving up, of facing my friends and family after the fact.  However, conspicuously absent from my set of reasons to stay was the desire to actually practice the law.  Law school was an isolated experience free from the restrictions of looming bills, demanding partners and a professional career.

By March, I had fully turned my attention from going in-house to going back to engineering.   When I began applying for software engineering jobs, my resume was still structured as a legal resume.  At the top, I listed my accolades: law school, legal journals, published papers, leadership experience, law firm.  Towards the bottom, I broke out my work experience into two sections, “Legal Experience” and “Software Engineering Experience.”  With each application submitted, I attached my cover letter, which I refined multiple times over the next several months of applications:

Dear [Company X],

I am a software engineer and attorney who has been working on coding projects for the [Y] since 2011 and was previously employed with [Z] in 2009 as a developer for our web portal on the __ team. I spent the last three years furthering my studies through attending law school and received my Juris Doctor degree from Stanford Law School in 2012. Since graduating and becoming an attorney, I have come to realize that my passion remains in software engineering. Though studying law is intellectually demanding and stimulating, I find software engineering to be a better outlet for my career goals. In short, I want to create products that help others and software engineering gives me that opportunity.

To that end, while I was in law school, I kept up with my software fundamentals through coding projects on the side. I am eager to more deeply engage in my software engineering career again, and I hope to be able to continue learning and doing so with [Company X]. Thank you for considering my application.

Sincerely,

Codeandcodes

I spent the next two months applying without any success.  At first, I targeted only well known companies, thinking that a bigger company would have the resources and financial security to take a chance on an ex-software engineer to do their coding.  But application after application was rejected or ignored.  By this point, I made my desire to leave biglaw public among many of my non-lawyer friends, many of whom were working in the software engineering field.  Some of them, to whom I’m still grateful, put their faith in me and referred me to positions with their companies.  I found, however, that even with their endorsement, I wasn’t able to even get past the resume screen. During this time, I kept an ace up my sleeve. I had spent several years in the software industry prior to going to law school, and one of my former companies had an office in my town. My old boss still worked there, and I had departed on good terms (for law school). I was fairly confident that if I reached out to him, he would be able to get me through the initial screen. However, I waffled back and forth on whether to reach out to him again. Part of me knew that by doing so, I had to commit to actually leaving the law or else burn bridges and perhaps my best hope of getting out. It felt final, and I kept asking myself if I was really prepared to leave everything I had spent the last four years working for. But after all my mental debate, I eventually decided to make the call. I was going to do this.

After contacting my old boss, the mental burden of leaving was lifted. I decided to widen my net.  I redoubled my efforts and by this point, 100% of my free time was devoted to applying to jobs or preparing for interviews.  I would come home weary from work each day, spend an hour or two looking at relevant job postings on any site I could find, and then spent a few hours brushing up on algorithms, data structures and catching up with the last several years of advancements made in software.  It was grueling.  Balancing individual study with a biglaw job is obviously not easy, but the allure of freedom kept up my morale.  At first, the challenge seemed insurmountable. However, with time, my efforts began paying off.  A few weeks after I started applying to startups, I actually began hearing back from recruiters.  Some were willing to talk with me, many others were simply curious about my background.  I still had many rejections.  However, even getting the opportunity to speak with a recruiter was a step in the right direction.  I even had a few phone screens in the beginning (all of which I failed miserably).  The software world had changed dramatically in the past four years that I had been out of the game.  Though I had kept up with programming on the side, I was woefully unprepared for jumping straight back in.

Then one day, which I consider the turning point of my application process, a contract recruiter contacted me regarding one of the many applications I had submitted.  She saw my background, was intrigued, and decided to submit my application to her client because she thought I was a good fit (that client eventually rejecged me without interview).  However, the most valuable thing she did for me was suggest that I remove references to my legal accolades from my resume, something I never considered.  The idea of removing my legal accolades was foreign to me. After all, they are the factors by which lawyers as distinguished.  I was skeptical about this advice, but since I wasn’t having much luck, I prepared a second resume (I still have it, and called it [codeandcodes SE.pdf).  I widened my net yet still, and began to apply to every job I could find, some with my SE.pdf resume, and others with my hybrid law/engineering resume. By the peak of my application cycle, I was applying to thirty jobs a day.  And I started getting hits back.  Previously, with only my hybrid resume, I had a response rate from recruiters of about 5% -for every 20 resumes and cover letters I wrote, I would receive about one response.  Out of all of those responses, I received only one phone screen.  With my new resume, which left off every tie to law (except my law school), my response rate from recruiters jumped to 20%.  And because my resume had no reference to the law firm at which I was currently employed, these recruiters viewed me without bias (except maybe as an unemployed software engineer with a very large gap on my resume).

Meanwhile, my late night study sessions were also paying dividends.  The concepts that I used everyday in the past as a software engineer started coming back to me, and I grew sharper and more familiar with the current technical buzzwords.  I also purchased several software engineering interview books, and attempted each problem, no matter how long it took me.  Slowly, I started getting more phone screens, and they started to go better.  I was still far from a callback, but my efforts showed promise.  This process continued for months.  By July, I had applied to hundreds of jobs and was speaking with recruiters on a regular basis.  Finally, the day came when one of my phone screens went well enough where the interviewer wanted to bring me in onsite interview.  The CEO of this startup told me that he would have his Director of Engineering contact me first to verify the interviewer’s feedback.  Long story short, after a conversation with the Director of Engineering, which fortunately was less technical in nature, the CEO and the director agreed to bring me in. The director gave me a homework assignment before my onsite interview, which I still have to this day.  He was experimenting with Scala (a functional programming language that runs on the JVM) and wanted me to research the pros and cons of Scala versus Java.  I had never heard of Scala or functional programming before, but I attacked this assignment with incredible vigor.  Before my onsite interview, I researched dozens of articles on Scala, Java and functional programming languages.  I put all my notes into a digestible chart in Microsoft OneNote, ironically my favorite application for note-taking in law school.  When the day of the onsite arrived, I was well-prepared.

The rest is mostly history.  Once I finished the onsite interview, I had a strong suspicion that an offer was coming.  But when it finally came, I didn’t celebrate or rejoice.  It wasn’t the compensation or the company.  Again, it came down to the decision to leave. Leaving the law was no longer just a fantasy.  It came down to the simple choice that I had debated all this time. All my work in the past half decade, from studying for the LSAT, to applying to law school, to my 1L year, my hours at the law firm, passing the bar, was about to become my past.  All of my fears were coming to a head.  I wasn’t sure if I was making the biggest mistake of my life by leaving the law behind and again, and the fears and doubts that I was just being immature about my job situation resurfaced.  I began reaching out to everyone I knew (including several people I didn’t know) who had left biglaw to do something else.  Over the next two weeks, before accepting, I sought the advice and counsel of many of these people.  All of them told me to take the leap of faith and leave.  In the end, their reassurances were all unnecessary, because I already knew what I wanted.  I finally realized that my life was being spent doing something I didn’t want to do.  I called up the recruiter and accepted.

Aftermath:

After accepting the position at the startup, I told my partner I was leaving.  He was respectful and supportive and wished me well.  It was done.  That moment, the moment where I gave notice that I was leaving, remains one of the happiest moments of my life.  It’s hard to describe the relief or joy, or whatever feelings that accompanied that decision.  It’s been two years since I departed, and I haven’t regretted my decision for a day.

How I left biglaw (Part II)

… Of course, nothing happened at first, but even the act of sending out my resume made me feel triumphant.  Though my grand plan to work for several years and go in-house flew out the window, I felt all right.  I felt hopeful for the first time since starting work that there was an exit, and that the wheels were in motion.  It turns out however, that it would be a long and arduous eight months before I finally had my opportunity…

The following is a continuation of my story of the next eight months, and how I eventually escaped from biglaw.

Part I of this post: How I left biglaw (Part I)

———–

Silence.  It turns out that getting a job requires a lot more than sending out a resume.  I was also unsure of my decision.  I had just spend the last 3 years in law school, just passed the bar exam, and had secured a position at one of the nation’s top law firms.  On paper, I looked great and outsiders looking in were impressed.  On the inside however, I felt a mounting desperation that working in biglaw was unsustainable.

After my Thanksgiving plans were interrupted by the ‘short-fuse’ deal, I sent out my resume to several engineering job ads which I had been browsing in the preceding weeks.  To me, it represented a mental hurdle that I had overcome.  I was no longer the golden example, the one people envied, but I was a quitter.  That was hard to come to terms with.  Law students in particular are a stubborn breed; the vast majority make the calculated decision to go to law school, and when there, attack their courses with tenacity.  I had done the same, passed all the hurdles to landing the biglaw job, and now after three months, was ready to quit.

To describe my thought process as clear and rational at the time would be giving myself too much credit.  I didn’t know what I wanted.  Part of me thought that I was complaining about nothing, that all biglaw associates went through the same thing, and that though attrition rates were high, the vast majority still took their licks and made it out.  No one had ever heard of someone lasting only three months in biglaw.  Another part of me however, possibly the more emotional part, thought that I was uniquely unsuited to being in biglaw.  I’m fortunate.  I have a background in computer science, which happened to be in high demand.  I had a backup plan.  However, my rational side constantly warred with my desire to leave: “why would you spend three years and $200k to get a J.D., go through all the suffering of law school tests, applying, the summer associate position, and the bar exam just to quit in three months?”  This was my constant debate over the next several months, up to the point where I left.

Thanksgiving came and went, and work actually slowed down.  My partner, to be fair, recognized that I had been burning the candle at both ends and thought I needed a break.  He avoided staffing me on a deal for the remainder of the year and my holidays were actually pleasant and restful.  And I forgot about sending out my resume.  Of course, this didn’t last very long and come the new year, I found myself in the same position as before, my personal life and time living and dying by the lifecycle of the deal.  It turns out that I had done a commendable job on my past deals, and I was ready to start operating without the guiding hand of a senior associate, at least with respect to the due diligence.  My workload increased again, but without my senior associate interceding and turning down the demands of other associates and partners, I found myself buried again.  Yet this time around, I held onto my quiet defiance with knowledge of the fact that my resume was out there, circulating.

Work continued to mount and I continued my late nights, while fighting against senior associates hounding me for work product and my partner staffing me on new assignments.  I closed my door purposely, in order to deter passerby’s from dropping in and in the natural flow of any conversation, deciding I needed more work.  I kept busy, and learned to work faster and more efficiently.  By the end, diligence became old hat, and I no longer feared the large document drops as I had in the first few months of my job.  However, new challenges always presented themselves.  I got staffed on a few licensing deals, which I knew nothing about.  Often times, as a specialist, I would jump onto a deal mid-cycle, feeling lost and inundated with deal documents.  I still rarely took a Saturday or Sunday off.  On one occasion, on the eve of deal signing after spending the last several nights working, I fell asleep instead of hopping on an 11PM conference call for the corporate attorneys.  I had already submitted my portion of the diligence memo, fully negotiated the IP reps and warranties, and thought I was in the clear.  Early the next day, I remember turning to my nightstand, saw that I had missed over 100 emails and felt a sinking feeling in my stomach.  I saw that the senior associate on the deal (my friend and also a mentor) had been up all night and took my place on the call while sending out emails at 4AM.  The deal had signed overnight.  I truly felt bad that I had dropped the ball by going to sleep instead of staying up for the call.

After that experience, I renewed my desire to get out.  By this time, it was around March, so I had around six months of experience under my belt.  As I said before, the rational side of me thought that by going back to software engineering, I would be throwing away years of my life and hundreds of thousands of dollars.  Yet I was still desperate to get out.  So I thought I would try my hand at applying for in-house positions.  There’s a website, called http://www.goinhouse.com, that lists in-house job postings.  I would check this site and linkedin daily for job postings for junior in house counsel positions.  Nothing took.  I prepared a detailed cover letter and resume, and submitted it to every junior in-house position I could find, but never received any response (some to this day).  I tried my network as well.  One friend, a director at his startup, told me of an opening on their legal team.  I applied there and most likely due to the strength of my friend’s recommendation, had a phone screen with the startup’s attorney.  I remember clearing my schedule that day and hopped in my car, trying to drive to a secluded parking lot where I could do the phone screen in peace.  I didn’t get far enough in time by the time the phone screen started, and ended up taking the call from my car.  The end result: while the interviewer was “impressed with my knowledge”, I was too junior.  Another time, my friend referred me to Google and I was flat out rejected for not having enough experience. After several failures, I finally found a position for a junior transactional attorney on goinhouse, with a new legal startup.  It was a contract position, which I had avoided until now.  For those readers who are not attorneys, contracting positions are generally looked upon with disfavor by law firms.  It’s a black mark on one’s resume.  Yet I was desperate enough to not care.  I reasoned to myself that even if I was leaving my law firm job after only half a year, I would still be leaving it for a legal job.  I could then evaluate whether I really wanted to leave law, so I wouldn’t be completely throwing away my education and time spent in the law.  I submitted my resume and to my surprise, heard back from the lead recruiter within a few days.  We had an initial phone screen, and she wanted to continue the conversation.

This legal startup is geared towards working mothers.  They call it “high end contracting” and claim to hire high-caliber attorneys to do biglaw type jobs at a cheaper rate.  The hours were flexible, and work could be picked up at the pace of the contract attorney.  It sounded perfect to me.  I scheduled the on-site interview for early in the morning, so I could wake up early and drive into the city and back to my law firm before the day started.  Anyone would just expect that I had gotten a late start.  On the day of the interview, I ended up underestimating traffic, and was five minutes late to the meeting.  It turns out that it didn’t matter.  I walked into the startup’s well-appointed office, took a seat and waited for my on-site interview to begin.  After a few minutes wait, the leader recruiter with whom I had spoken on the phone brought me into her office.  We started talking about my background, why I wanted to leave my law firm, and what this startup was trying to accomplish.  After half an hour of talking, the lead recruiter rejected me on the spot.  She told me that I was too junior for them to hire me, even for a contractual position.  She told me to reapply when I had more experience, and sent me on my way with some mints and lip balm.

Dejected, I made the long trek back to my office, where I closed my door and contemplated my future as a lawyer.  I looked at the spreadsheet that I had made, which counted down the months until I my net worth was $0.  Still over two years away.  I knew I wouldn’t make it.  I abandoned my plan to stay in law, and began to draft a new resume.

How I left biglaw (Part I)

Another popular question I received when I made the decision to leave biglaw was how I got out.  This is my story, and it won’t apply to everyone.  However, I hope that other associates can relate to the fears and feelings I had when I was planning my exit.  And I hope that it gives some hope to those friends and colleagues who feel stuck.  The story is long, so I’ll have to give you some background first.

———

My desire to leave biglaw really started during my summer associateship.  Bear in mind that this was back in 2011.  The legal economy was still reeling from the economic recession, law firms were facing bleak times, and though things were improving, law firms had still not recovered.  Salaries were still frozen, offer rates were way down, and law firm layoffs made the news daily.  I think Cravath’s class size had dropped from 120 to about 30.  Everyone I knew was worried about getting a job, even at the top law schools around the country.  I monitored ATL on a daily basis, had a massive spreadsheet of every law firm that had conducted layoffs (I purposefully bid them all lower during OCI) and concerned myself with finding the best law firm (read: most profitable and highest offer rate) I could get into.

The circumstances at the time colored my decision and my actions during my summer associateship. Essentially, I arrived for the summer with my other classmates fearful for my job and potential offer, so I was ready to hit the ground running.  I wanted to make sure that I stood out even among my other peers (no small task), so I would produce the best work quality I could while putting in the necessary time.  It turns out that that is a lot easier said than done.  On the third day of my summer associateship, I agreed to help one of the other junior associates with some bookkeeping tasks before a public filing goes out, a process called “circle ups.”  A circle up, for non-corporate attorneys, is essentially the process of going through a public filing (in this case, about a 100 page 10-K), identifying all the “material” numbers, then cross-referencing them with previous filings to see if they were missing any relevant information.  Then, the associate takes to the task of verifying these material numbers with accountants or other experts based on their level of significance.  It’s a ridiculously tedious task (you can imagine how many numbers there are in a public filing about 100 pages long).

That day I ended up staying in the office until around 1:30AM to finish circling and sticking post it notes next to all the numbers in the 10-K.  Tired from the long task, I turned in my work to the junior corporate associate thinking that I would finally go home.  However, much to my surprise/dismay, she said that we would be hopping on a call shortly to go over the results with a senior associate (also my associate mentor for the summer).  I was completely shocked.  It was already 1:30 in the morning, I had just spend the last 15 hours in the office circling hundreds of numbers and now it was time to verify them?  This was my first taste of the “real work” that corporate attorneys do.  I wondered what I had gotten myself into.  Things progressed much the same for the rest of the summer, but still at the end, and despite the long hours, I stilled needed a job offer (which I ultimately received).  I already knew I wouldn’t like the job, but I needed one because my student loans were mounting.  I remember on the last day of my summer associateship when my offer arrived, I felt a wave of relief but also the first feeling of desperation that this would be my life.  While waiting to go home on that day, I started browsing our school’s career website for other firms to interview at 3L year in case I wanted to go somewhere less intense.  I never tried.

Fast forward a year to my orientation week at this same law firm.  The law firm flew the incoming first-year associate class out first-class (my first time), put us up in luxurious accommodations and eased us into the law firm experience with relaxed sessions where other more senior lawyers told us battle stories and how to succeed at the firm.  In short, orientation week was good.  We celebrated the end of the week with a night out where we heard whispers of new associates already being contacted by partners looking for people to work the weekend (the partner eventually changed his mind when he learned that the new associate hadn’t been issued a laptop yet).  Though I laughed it off nervously, it turns out that this practice was not out of the ordinary at all, and the same fate was about to befall me.

Orientation week was the last time while at the firm that I called it a night at 5:00PM.  Pretty much from the next Monday on, I started getting slammed with work.  The trial run was over; this was real life.  I had chosen this career, my fate, my means of survival, and it would be a long stretch before getting out.  For the first three months, I never took a day off. I was on back to back deals, learning the ropes, drinking from the firehose, and working all the time.  I hated it.  My original plan of just biding my time for 4 years until I had saved enough to pay off my loans and gotten enough experience to jump in house eventually decreased in duration to three years, then to two, then finally to one.  Each day was tortuous, and while I liked my coworkers and the pay, I lived in constant fear that my schedule and life would get interrupted by a “hot” deal.  By November, I felt like I was burning out, and I looked forward to some respite over Thanksgiving.  I made plans with my family to go away for the long weekend, to relax somewhere and not think about work.  The plans were made, we were set to go.  Then it hit.  The Tuesday before Thanksgiving at 5:30PM, I received an email from our of counsel: “We just found out about a ‘short-fuse’ deal and need someone to staff it.  Looks like it will run over Thanksgiving.  Sorry.’  My heart sank.  I felt empty, broken, powerless.

I had thought about leaving before then.  It only takes so many late Friday night emails to break one’s spirit.  Maybe my peers or others have more guts or a stronger will than me, but every time I got a message like that, my desperation grew.  Somewhere during the two month marathon of work, I had actually prepared a resume, highlighting my software engineering background, which I planned to send out if things ever got really bad.  It was a symbol of defeat, my ace up my sleeve, but something to keep in the back pocket just in case.  I sent it out the same day the email came.

Of course, nothing happened at first, but even the act of sending out my resume made me feel triumphant.  Though my grand plan to work for several years and go in-house flew out the window, I felt all right.  I felt hopeful for the first time since starting work that there was an exit, and that the wheels were in motion.  It turns out however, that it would be a long and arduous eight months before I finally had my opportunity.