The Postmortem: Tesla (3/4)

Fuad Ali
Augment
9 min readMay 29, 2020

--

Thoughts on 4 months as a Software Engineering Intern on the Energy Products Software team at Tesla.

Disclaimer: The views in this article represent solely my personal views and opinions, and do not represent the views of Tesla or any other organization or individual.

Sexy Cars

When most people hear Tesla, their thoughts jump immediately to electric cars. As Elon’s moniker S.3.X.Y. (formed from taking the names of each of the models of Tesla vehicles) suggests, Tesla’s brand recognition is dominated by its flashy vehicles and flamboyant CEO. But while Tesla’s work on electric cars is market changing and central to the vision of an electric future, just as central to that vision is power generation. The fact remains that the total emission of CO2 over the lifetime of an electric vehicle is still only 50% less than the emissions from a gasoline-powered car [1].

This is due to the fact that electric energy in the US is still largely driven by non-renewable sources. According to the US Energy Information Administration, in 2019, renewable energy sources accounted for about 11% of total U.S. energy consumption and about 17% of electricity generation. [2]. This means that every time you go to charge your electric vehicle at home, over 80% of the electricity you use comes from sources like coal, natural gas, and diesel generators.

Enter Powerwall and Solar Roof. In order to solve this very real gap between energy sustainability and electric vehicles, Tesla aims to tackle the problem at the source; power generation. For too long, we’ve accepted a consumer model of the grid, where there are large inputs to the grid in the form of huge generation plants, and a cacophony of smaller outputs, represented by our homes and businesses. Tesla wants the world to move to a prosumer model, where traditional consumers of energy (you and me) are transformed into prosumers (those who both consume and produce energy), thereby improving the efficiency of the smart grid and offering economic, operational and environmental benefit. This is outlined in a great paper published in Energies, an open access, peer reviewed journal [3]. The idea is that homes would be equipped with Solar Roofs, allowing them to generate solar energy, and store that energy in a Powerwall (picture a giant, futuristic looking battery). You’d generate energy throughout the day while it’s sunny out, store it in the Powerwall while you’re not using it, and use that to power your lights and appliances at night when you’re back home. You’d also be able to charge your car, and offload extra energy you generate to help “peak shave” or reduce pressure on the grid on days when there is above average energy demand. The goal is to create an extremely integrated product family, and solve for both a local optimization of energy usage (your home) and a global optimization of energy usage (the country/state/province/grid at large).

So, how does this all relate to me and my 16 months of co-op?

For my third internship in 16 months, from January to April of 2020, I was very privileged to have been a part of the Energy Products Software team. The Energy Products Software team at Tesla is responsible for writing the code for the distributed systems and cloud software that manages, represents, and controls a fleet of Tesla devices, including Powerwall and Solar Roof (amongst other products). Their tools of choice include Scala, Akka and Kubernetes. Learning about the domain of clean energy and feeling like a contributor to a shared mission to get the world onto renewable energy was extremely rewarding and inspirational. As someone who is very mission-oriented, I was extremely grateful for this chance to work at the center of innovative new tech, and world changing ideas.

Keeping true to the goal of my postmortem series, I want to focus on the takeaways and lessons I learned from each internship, and honestly evaluate my experiences. With this in mind, I’ll be focusing on the following areas:

  • Learning to think functionally
  • Adjusting to the pace and nature of work at Tesla
  • Learning to work from home amidst the turmoil of COVID-19

Thinking Functionally

Functional programming, as opposed to object oriented programming, concerns itself (as the name might imply) with variables and functions over objects and methods. For those of you not as familiar with math or programming, it’s akin to focusing on representing information and data flow as functions operating on each other, rather than focusing on creating a software representation of something in the form of objects.

As you can see, it’s not as simple as it sounds, and adjusting to it was a huge part of my 4 month internship. Having gone through the gamut of beginner resources online, and landing (somewhat intact) on the other side of the divide between those who program using objects and those who program using functions, I must say I’ve opened my eyes to the merits of functional programming. Especially for the problem space we were operating in (distributed systems and IoT), there were a number of big wins to be gained by thinking functionally. Not worrying about state in a distributed IoT system was one of these; as you can imagine, keeping state consistent across thousands of different devices running different firmware versions would quickly prove to be a hassle. In addition to this, strict typing and immutability meant that it was much easier to write functions that were testable and specific. This lead to errors being caught at compile time rather than runtime, and helped tremendously with troubleshooting. Overall, I really enjoyed the switch to thinking functionally, and it helped build within me an appreciation of choosing the right tool for the right problem, rather than adapting old or commonly used tech to a new problem area.

Adjusting to Tesla

In addition to the learnings from functional programming came an adjustment to the pace and nature of work at Tesla. Tesla moves fast. They pride themselves on world class engineering talent, putting faith in their employees, and pivoting quickly from solutions that don’t work. Being new to this environment proved to be a learning curve. Breaking out of old hierarchical mentalities of who should be making decisions was a highlight of this. As teams move to decentralized models of leadership throughout the tech industry, it becomes increasingly important to recognize that every voice has value to add. Tesla embodies this from everything to their handbook, to who can speak during meetings. As my skills and comfort level in the new environment grew, I was amazed at how open people were to hearing ideas from all levels of the organization; not just the top. I strove to take advantage of this flat hierarchy by speaking to people who interested me, and trying to soak up as much as I could, including technical and non technical knowledge. This is, in my opinion, one of the biggest advantages of having a decentralized structure; people become empowered to collaborate and listen to ideas across the organization, leading to more diversity of thought and more robust solutions.

Working From Home

Towards the 10th week of my internship, COVID-19 hit the Bay Area, and the rest of the continental United States, hard. My team had already started a self-imposed work from home policy a couple weeks prior to the official shelter in place order. This proved to be likely my biggest challenge in an internship yet. Numerous work from home articles have been written, and I highly suggest you read one of those, including a great one by my Manager Colin [4]. I’m going to focus on how I dealt with work from home, and the effects it had on my internship experience.

Let me preface this by saying the following; I’m a natural extrovert. I feed off of people and the energy of crowds. I love coming into the office and am energized by seeing my coworkers wrestle with a problem at their workstations. Plenty of people hate meetings, but I love hearing new perspectives on problems and understanding what different stakeholders need. In short, the office provides a real sense of camaraderie and togetherness that I greatly appreciate.

However, circumstances aren’t always ideal. With COVID-19, the choice to work from home wasn’t a choice anymore, and I had to adapt. The beginning of the shelter-in-place period admittedly saw massive decreases in my productivity. I struggled to create a clear division between work and home; something that was especially hard given my living situation (I only had one bedroom to work, live, and relax out of). Advice on creating separate spaces for work and play is only valid if you’re privileged enough to have separate spaces in the first place, and that wasn’t the case for me as an intern in Palo Alto’s housing market.

Slowly but surely though, I began to adjust. I stopped waking up at 9am on Saturdays and instinctively opening up my laptop. Creating distinct time blocks of working hours and relaxing hours helped me to stop elongating my workday. At first, I found myself working from 9AM — 10PM at about 50% efficiency, but slowly I started to force myself to dial back my hours and focus on quality over quantity. Another thing that had held me back was a renewed apprehension of asking questions. Though I thought I had defeated this in my previous coop terms, I found that with the shift to remote work, I was wary of feeling like a burden on teammates. It’s very easy to tap someone on the shoulder in person and ask “Hey, can you look over this code real quick?” or “Can I bounce an idea off you for 30 seconds?”. It feels like much more of a commitment and a drain on the other person’s attention to force them onto a Zoom call for 20–30 minutes, and asking questions over Slack or email misses a lot of the nuance that bringing someone over to your computer has. Though I was lucky to have a mentor as supportive as Joe, it was hard for me to shake off off the feeling of being a burden. To improve on this, I started scheduling dedicated time in my mentor’s calendar, and even suggested having the concept of “office hours”, or dedicated time during which I knew Joe wouldn’t be working on deep work, so he would be available for a call. This helped tremendously, even amidst the confusion of booking flights back home to Toronto, checking in on family and loved ones, and making sure I had enough groceries to last the week.

Finally, I think what I missed the most from being in the office were the intangibles. I missed side table conversations on the merits of functional programming. I missed the talks on the way to weekly technical meetings, listening to people debate ideas back and forth. I missed taking a stroll through HQ and watching suspension teams, battery teams, and hardware engineers working on tech that I didn’t understand at all. Above all, team-bonding moments and happy hours couldn’t be replaced by a Zoom call and some beers at home (and especially not a Microsoft Teams call back when they didn’t have Grid View, because you couldn’t even see your whole team at once).

Can a team stay functional during work from home? Can you create a sense of belonging and stay mission oriented? Does it save time and money for people in the form of commute savings and less office spaced used? The answer to all these questions is yes. Working on a team that had already implemented a 2 day a week work from home policy before COVID-19 definitely helped with the adjustment. Personally, I’d still much rather work from the office.

Conclusion

As I’ve had some quiet time between internships during the month of May, I’ve spent some of that reflecting on my term at Tesla. In terms of technical experience and knowledge, my term at Tesla contributed by far the most growth of all my internships thus far. I also learned more about myself and my working preferences, especially after being forced to stay home.

From moving to California for the first time, to working for a company I’d admired and wanted to work for for years, it was a hell of an experience. Was California worth it, even though it was cut brief by a major historic event? Absolutely and resoundingly, yes.

Shoutouts: A huge thank you to Colin Breck for being a great manager, and Joe Norat for his amazing mentorship throughout my term! Glad to have been a part of such a high functioning team.

If you resonated with this article and wanna chat about my experiences, feel free to connect with me on LinkedIn and shoot me a message!

References and further reading:

[1] https://www.cbc.ca/radio/quirks/june-22-is-your-wi-fi-watching-you-dog-s-manipulative-eyebrows-darwin-s-finches-in-danger-and-more-1.5182752/do-electric-cars-take-more-co2-to-build-than-they-save-1.5182753

[2] https://www.eia.gov/tools/faqs/faq.php?id=92&t=4

[3] https://www.mdpi.com/1996-1073/11/10/2528/pdf

[4] https://blog.colinbreck.com/sars-cov-2-and-the-future-of-work/

--

--

Fuad Ali
Augment

it’s embarrassingly plain how inadequate language is