Do you need a CS degree to work in software engineering? Sort of.

Introduction

In some circles I am used to provide some inspiration to aspiring software engineers with non-traditional backgrounds. A non-traditional background here just means the lack of a college degree in either computer science, mathematics, or electrical engineering. The difference between a traditional and non-traditional background has profound socioeconomic implications. It’s not really a secret that non-traditional candidates have to overcome unusually high barriers to entry to enter the field of software engineering. While the idea of facing more obstacles as an outsider is not controversial, few lack the first-hand experience to tell you how hard it is, and insiders underestimate the difficulty. In my case, I was more non-traditional than most: No formal CS education, no bootcamp, and no network. I also did well for myself: I eventually had offers from Microsoft and Facebook (though it was not my first job in SE). That said, I have unusual but first-hand advice for people looking to get into software engineering from non-traditional backgrounds.

Continue reading “Do you need a CS degree to work in software engineering? Sort of.”

Generalized partition sort

Introduction

Generalized partition sort is the very cool, mysterious algorithm you’ve never heard of. What surprises me about this algorithm is that it’s so performant, but I haven’t seen it discussed explicitly and in the way I am about to show you. By customizing generalized partition sort with the right function, it can solve any of the following problems:

  • Find the smallest k elements from a collection
  • Find the largest k elements numbers in one-dimensional space
  • Find the closest k elements to k’ in euclidean space
  • Find the closest k to j elements from k’ in euclidean space

All of the above are reformulations of the same general problem: Find the slice of elements from a set of values ordered by their image of some function.

Continue reading “Generalized partition sort”

How to pass your technical phone screens

Introduction

The general format of the interview process at software companies for software engineers consists of three parts: recruiter screen, technical screen, and on-site interview. A phone screen is usually the only part of the technical screen and the immediate barrier to being brought on-site for the final stage. The technical phone screen is where you complete a set of coding challenges given through some shared collaboration editor while speaking to another person who is evaluating your performance.

Continue reading “How to pass your technical phone screens”

Interesting case study in dynamic programming

Introduction

Dynamic programming (DP) is just recursive programming with caching. The cache comes in for saving the results of smaller subproblems.

Because we ultimately have to solve smaller subproblems, we have to traverse our solution space. You can think of the solution space as a directed acyclic graph where each node represents a subproblem. Each outward edge from a node represents immediate dependence on a smaller subproblem. The solution space DAG (directed acyclic graph) will have leaf nodes which have no outward edges. These leaf nodes are base cases.

There are two general ways we might go about solving a dynamic programming problem and they are labeled top-down or bottom-up. Solving a DP problem top-down is like traversing the solution space in post-order depth first search (DFS) starting at the root node. Solving a DP problem bottom-up is like processing the nodes in breath first search traversal starting at the leaf node. That last statement is not quite true from a technical standpoint, but the general idea of computing sub-problems in order of “closeness” to the base case is accurate. In the bottom-up approach, we only compute a sub-problem when all smaller sub-problems have been computed. One implication of this is that the bottom-up approach doesn’t involve recursion.

Continue reading “Interesting case study in dynamic programming”

What technical recruiters and managers don’t know about physics students

A hint of an undercurrent

Undercurrent: an underlying feeling or influence, especially one that is contrary to the prevailing atmosphere and is not expressed openly.

When I see job listings in software engineering, there are three frequently listed areas of study: computer science, electrical engineering, and mathematics.

That computer science and electrical engineering are on the shortlist is not surprising. The core curriculums involve a substantial programming component and promote an understanding of computer architecture.

The odd one out is mathematics. It is strange because the core curriculum is not particularly relevant for writing software. It’s easy to graduate with a degree in mathematics without ever having written a computer program. If fluency in mathematics is a qualification for software engineering, it has to be something other than exposure to software engineering concepts.

Continue reading “What technical recruiters and managers don’t know about physics students”

Top down and bottom up dynamic programming simplified

Pre-requisites: A conceptual understanding of what recursion is, as well as other basic concepts in algorithms like: asymptotic notation, time complexity, and graph traversal.

Dynamic programming is an optimization of recursive solutions by using a cache. If you have a recursive solution (e.g. Fibonacci sequence), then we call it dynamic programming if we make use of a cache to optimize performance. Dynamic programming is a trade-off where we use extra memory to reduce the time complexity by more than a constant factor. For traditional dynamic programming problems, we are forced into this choice by an exponential recursive solution with unacceptable performance. DP is probably fascinating because with a relatively small optimization, exponential recursive solutions are transformed into linear solutions.

Continue reading “Top down and bottom up dynamic programming simplified”

Big four elements of branding for a software engineer in the early stages of your career

When I transitioned from physics to software engineering, it felt as if I was playing life on hard mode. Learning about academic computer science, coding, and taking coursework wasn’t the difficult part, though. What was challenging, and this often surprises people, was that I was often discounted because of my background. It was a bizarre situation where it was easier to pass interviews than it was to get them. The details of this are for another post, but this weird situation made it prudent to understand some core aspects of what profile recruiters are looking for. That is, among an ocean of resumes that pass the minimum requirements of a job listing, who gets picked to interview and why, when the choice is completely at the discretion of the recruiter? From my conversations with recruiters, some AB testing, and other surreptitious methods, I found that there were four factors that really stood out as good predictors that recruiters would want to network with you. These factors are part SEO and part unconscious biases.

Continue reading “Big four elements of branding for a software engineer in the early stages of your career”

Post-mortem of a strange bug: dependencies that aren’t what they appear to be

This is my favorite case study among bugs I encountered while working on a search engine at FactSet.

Some context is necessary: The front-end for this search engine is html-based, and it has a feature where charts are shown for some queries. For example, type in “price ibm” and a little chart might show the stock price over the last 5 years. It’s an attractive visual component and also a core part to this kind of feature (showing data in response to a query in addition to links). We have maybe 10 – 15 direct javascript dependencies, each of these having their own dependencies, etc. This chart is rendered by an internal charting library at FactSet. There’s a CDN for which we use a CDN resolver. This CDN resolver takes those script element source files and changes them to direct CDN links if possible. This CDN resolver is buggy so some dependencies are hard-coded to use the CDN directly. Managing these dependencies as they update versions is challenging. We promote devel to QA on Tuesdays. We have internal tools to quickly test the product, which is very close to a clone, but technically a similar imitation.

Continue reading “Post-mortem of a strange bug: dependencies that aren’t what they appear to be”

Programming oddities: Multi-threaded Hello World program

To run

g++ --std=c++11 -g -pthread [source-code-file]

Summary:
We spawn one thread for each character we wish to print and force all spawned threads to sleep with a condition variable. With the go() function all threads are woken up. Each thread has two parameters: the character it is meant to print and a value which forces synchronization among the threads so that the threads execute in a specific order. The synchronization value is the test condition for a while loop whose body forces the thread to go back to sleep, and the test evaluates to false when this synchronization value is equal to a global counter. Once a thread exits this while block, it prints its character, increments the global counter, and wakes up all other threads waiting on the condition variable.

Continue reading “Programming oddities: Multi-threaded Hello World program”

Genesis post

Dear reader,

If you have just realized the magnitude of your misfortune by stumbling into this strange place I am sure you doubtlessly have many questions. Like:

  • How did I get here?
  • Who are you?
  • What are your intentions?
  • Are you going to let me go?
  • How do I get home?

The first question has a simple but unsavory answer: You were simply unlucky. You probably were driven to the edge of sanity with yet another opaque and awesomely inscrutable compiler error and had an epiphany. That epiphany, at least for me, was that compilers couldn’t exist in a fair and just world. If compilers exist, so must the devil. In your desperate search for meaning in an unjust world, you probably slipped on a hyperlink and fell far into the deepest pit of the clearnet, where we made our chance acquaintance upon your awakening.

Continue reading “Genesis post”