Author: mattchung

  • Why I picked up the guitar

    Although I’ve been playing the ukulele for over a year, I decided to pick up the guitar four months ago, when I returned to Seattle after spending the Christmas holidays in sunny southern California.

    During my visit, my little 13 year old brother and I would occasionally jam. Me on my tenor ukulele strung with a low G, him on his electric guitar (and occasional grand piano).  We’d take turns playing rhythm, a steady tempo of 80 beats per minute.  I would start with strumming a simple I, IV, V progression (i.e. C, F, G), him soloing in the key of C. Then we would swapped roles, him shredding his guitar, me applying my (little) music theory, picking and plucking away, one note at a time.

    One day, while driving in the car by myself from Orange County to Northridge to my mother’s house, I was playing Spotify on my iPhone, music blaring through my Black Mazda hatchback’s speakers, acoustic and indie songs playing, one after another.  Spotify was playing songs listed in my “discover weekly”, a playlist algorithmically Spotify created based off of my listening behavior (i.e. listening to a handful of 80s music and acoustic guitar, over and over and over again).  Anyways, I’m driving up the 405 freeway, two hands on either side of the steering wheel, passively listening to the music in the background. And then, my attention shifts to the song playing, which was about already two minutes in, a song titled “When you love someone — James TW”.  At first, my ears perked up at the beautiful sound of the acoustic guitar, a combination of picking and strumming with an upbeat tempo.  In addition to the guitar, the melody was catchy, although I couldn’t really make out the lyrics.

    With two eyes glued to the road, I hover my right hand over to the center console, grabbing my phone and swiping the phone unblock, tapping on the back, restarting the song to the beginning. And then I intently listened to the song, as I continued to drive up the highway.

    The second time around, the song hit me emotionally, forcing tears to my eyes. Unexpectedly, the song’s lyrics revolve around a young boy whose parents are divorcing. “It don’t make sense. It don’t add up. We’ll love you. No matter what. ” – for some reason, those words shredded me apart. To be honest, I had not cried that hard in a long time (last time, if I can recall correctly, was during the episode of “This is us”, the episode where, spoiler alert, Randall’s father laid in the hospital bed, passing away and dropping words on wisdom before his consciousness faded).

    Anyways, after listening to that beautiful song play about three or four times, I decided that I wanted to learn the guitar and not only play that song, but accompany myself (i.e. sing).

    And for the past four months, that’s what I’ve been doing. Learning that song on the guitar, and only that song, one bar at a time.

     

  • Wrapping up discrete mathematics course

    Last Friday, I took the final exam for my (distant learning) discrete mathematics course and just now I had logged into the student portal (i.e. Blackboard), surprised to find that my exam had not only been graded but my final grade had been posted as well. I finished the course with an 88%, a B, a few points short of an A.  In the past, I would’ve incessantly beat myself up over not achieving the highest grade, denigrating myself with self destructive thoughts: if only I tried harder … if only I studied more … if only I was smarter …

     But not this time.

    This time, I’m inhibiting those thoughts. Instead, I’m celebrating. Celebrating that I’m fortunate enough to be able to take this mathematics course, a course where I learned about: writing proofs, solving Diophantine equations, applying set theory, counting with modular arithmetic, proving assertions with mathematic induction, converting recursive functions into closed form functions using characteristic equations method. Prior to the course, I was never exposed to those concepts.  Looking back, I only vaguely heard of those terms.  And who knows if I get to apply any of those concepts as I pursue a master’s – maybe a PhD, one day. Who knows if I’m lucky enough to apply that knowledge to my job as a software engineer.

    But who cares?  Because really, my goal was to stretch myself, learning more about my field and craft: computer science.

  • Graph theory and upcoming final exam

    I just scheduled my final exam for my discrete mathematics course, now that I submitted my homework for the final assignment covering graph theory. Throughout this assignment, I was introduced to a variety of concepts: Leonard Euler and his discovery of Euler paths and circuits, Hamiltonian paths and circuits, and a handful of graph related terminology (e.g. vertex, edges, degrees, bridge, cut-vertices, isomorphic graphs, trees, forests).

    In addition to the concepts above, I learned two different ways to represent graphs in (computer) memory. One approach is using adjacency matrix, a matrix whose columns and rows are represented by each vertex. The second way to represent a graph is by an incidence matrix; unlike an adjacency graph, an incidence matrix’s columns are vertices, the rows representing edges.

    Star like graph
    Star like graph
    Adjancey and Incidence matrix
    Two ways to represent the (above) graph

    Although the lesson only scratched the surface on graph theory, I reveled in the fact that many of the terms I learned were actually terms that I encountered at work, terms that I had no idea were rooted in mathematics.

    For example, the term forest (in graph theory) is defined as a collection of trees; I encountered this term while working as a system administrator, a time when I managed Active Directory (a centralized authentication system) and all the security rules and policies bound to a forest.

    In addition to the example above, I find comfort in the fact that some data structures (e.g. binary search tree) and algorithms (e.g. breadth first search) that I’ve studied in the past build on top of graph theory.

    Star-like graphs that are nonisomorphic
    Star-like graphs that are nonisomorphic

    In any case, I really enjoyed learning about graph theory, a lesson I’ll continue to build on top of as I pursue my life long study of mathematics and computer science.

  • Career contentment

    Lately, I’m feeling very content with my career.

    For the majority of my life, I’ve been constantly searching for some job that would fulfill me. Like many others working in the tech industry, I had a tendency to hop around from company to company every two years, always switching it up, never allowing myself to settle down. This tactic, of shuffling my career, was somewhat deliberate and strategic in the sense that salaries leap when switching from one company to another. In other words, if you want a substantial increase in your salary, you need to move. Otherwise, your stuck with receiving incremental pay raises that are considered trivial in comparison. For example, when I left Cisco to join Fox Networks, my salary increased by 40% .

    In addition to increasing my salary, I had vigilantly switched from one company to the next because I was afraid of intellectually stagnating, as if the company I was working at would potentially hinder my personal development. And this can be true, to a certain degree, since working for a small mom and pop software company will never present the same technical challenges as working for a large, cloud computing company.

    Regardless, I no longer feel as though there’s some magical company where I would work on a magical team that writes magical code.  In fact, as much as I enjoy working on new features or new products, I revel in maintaining software and systems.  In short, I realize that I control my technical growth and that regardless of what company I work for, I’ll always strive to improve my craft. Moreover, the more I study computer science, the more problems rise to the surface, problems that I would otherwise dismiss due to my lack of understanding.

    Despite my contentment, I’m not saying I’m going to settle down in my current role and current company for the rest of my life. Nobody can predict what’s going to happen in a year (or even tomorrow).  But for the foreseeable future, I see myself staying put, working for Amazon Web Services, developing software and building systems, one byte at a time.

     

  • Software and system ownership

    Although I sometimes find getting paged for operational issues enervating, I wouldn’t have it any other way.

    It’s well known that software engineers at Amazon (Web Services) own their systems, end to end. This means that we not only develop and maintain our software, but we operate the underlying system, complete ownership.

    From a software point of view, one can run into an infinite number of issues. Got a build error? Roll up them sleeves and start digging through the compilation errors.  You committed some code that broke the build? Fix or rollback the changes. You defined a dependency that’s deprecated? Update the dependency and ensure your unit and integration tests pass.

    Similarly, we maintain the underlying system. If we deploy our systems to a servers, physical or virtual (e.g. EC2), we must keep it alive, like a breathing entity. From checking disk performance, to checking heap allocation, we monitor our systems closely, configuring monitors to alarm us when any component misbehaves.

    In other words, there’s no divide between development and operations. There’s no separate team that handles operational issues, no DevOps. There’s no nonsense like writing our software and then chucking it over to another group to deploy it, a group that would otherwise find it annoying at best and frustrating at worst.  Because I’ve been in those positions, where I’m on the hook for deploying software that I cannot fix. Similarly, I’ve been in situations where the deployment fails and then I must ring in someone who’s more familiar with the code base.

    But now, I’m in a position where I’m responsible for the code I write.

    Why is this important?

    Although some would argue that software developers should stick to software development, and that there should be a clear separation of duty, I believe that owning a system end to end promotes operational excellence and a sense of ownership.

     

  • Where discrete mathematics meets an interview question

    Last week, I was sitting behind my desk at work, surfing hacker news and and at the top of the website floated an article by the co founder of “Daily Coding Program”, a small tech start up that e-mails daily newsletters with a programming question.  The article shared some of their insights over the past year and how they bootstrapped the company and eventually grew to $2,000 in monthly revenue.

    Although I was interested in reading the blog post, I ended skipping over most of it and navigated to their front page, where I scrolled up and down and read more about the company’s product.  When I reached the end of the front page, I was confronted with a sample interview question:

    There’s a staircase with N steps, and you can climb 1 or 2 steps at a time. Given N, write a function that returns the number of unique ways you can climb the staircase. The order of the steps matters.

    This question, I had initially thought, could be solved using some techniques that I recently learned from taking my discrete mathematics course. But to confirm whether or not I could apply permutations and combinations, I hollered at my colleague, repeating the question out loud and asking him how this problem could be solved. And as I started reading the question out loud, “There’s a staircase with N steps, and you can climb …” he interrupted me, finishing my sentence with, “1 or 2 steps at a time.”

    Apparently, while preparing for interviews with Google and Microsoft, he had stumbled across this same practice problem.

    So after letting him interrupt me, I asked him if this particular problem could be solved with permutations or combinations. In other words, do these two mathematical concepts apply to the problem. He confidently answered, “No — dynamic programming.” He then proceeded to step me through his solution, scribbling down his work on a white piece of 8.5 x 11 that sat on my desk.

    Fast forward to now.

    I’m at home, starting the next lesson for my discrete mathematics course, the lesson title: “Counting using Recurrence Relations” and “Solutions to Recurrence Relations.” I’m skimming the chapter, building a mental model of what the entire chapters entail, an overview.  And when I reached the end of the first chapter, where exercise problems live, I couldn’t help but form a little grin.

    To my surprise, the following chapters cover topics relating to the interview question that I had just read. In fact, the exercise in the chapter is phrased almost identically:

    Sal climbs stairs by taking either one, two, or three steps at a time. Determine a recursive formula for the number of different ways Sal can climb a flight of n steps.

    So, I find it always nice and serendipitous when what you are learning, either in school or on your own, can be applied to real life examples. Albeit, this application was only for an interview question.

    But I’ll still consider that as a victory.

     

  • Blistered fingers

    When I first started playing ukulele, about six months ago, I would occasionally wince when lifting my fingers off of the nylon strings.  Because in the beginning, the flesh of my fingertips were fresh, no callouses. But slowly, over time, after repeatedly striking down on the strings, my fingers gave birth to a new layer of skin, a thick coat protecting them from the piercing pain caused by the strings.

    And now my fingers are repeating the same painful cycle.

    About a week and a half ago, I started playing my new guitar that’s strung with steel strings, thin and sharp. And last Saturday, I lost track of time, jamming away for a little over an hour. The next morning, my index finger was throbbing, a blister forming at its very tip. As a result, I’ve been unable to play any of my instruments, giving myself a week to let the blister heal (and hopefully develop into a callous). Even now, as I type this up, I twinge in pain every time my left index finger strikes the keyboard.

  • Lessons learned coding the quicksort algorithm in assembly (i.e. MIPS)

    About six months ago, I enrolled myself in a computer organization (i.e. CS1410) course offered by University of Northern Iowa and I’m taking it remotely from Seattle, where I work full time as software engineer at Amazon (Web Services).

    I’ve completed about two thirds of the course, which consists of sixteen homework assignments and three proctored exams, my most recent homework assignment requiring me to code in MIPS, a low level programming language known as assembly. More specifically, I’m tasked with implementing the quicksort, a recursive algorithm, to sort a sequence of integers.  This homework assignment targets teaching two important computer science concepts: the run-time stack and calling conventions.

    Normally, I complete one homework assignment per week. However, this homework assignment was extremely challenging, taking roughly two and a half weeks to complete. The first couple days I dedicated to drilling the quicksort algorithm into my head, ensuring that I could visualize how the program actually sorts elements in the sequence, reading article after article (and sections from the books that have been collecting dust on my bookshelf); the remainder of the time I spent deep diving into writing the assembly code, typing code and executing in a MIPS simulator.  I cannot explain the number of times I grew frustrated, banging my head into the keyboard, because of program crashing.  At one point, I was stuck — for three days straight. None of my troubleshooting skills pinpointed me to the root cause.  After three days of staring at the code, I finally discovered the problem: I was corrupting the run-time stack.  After modifying one single line, updating the instruction to subtract 24 instead of adding 24 to the stack pointer (i.e. $sp register), the quicksort program ran flawlessly.

    All in all, I found the homework assignment as challenging but rewarding.

     

     

     

     

     

  • Dog palace

    On Saturday, just before the sun began to rise, Jess and I began loading our luggage into black Mazda hatchback for our Christmas trip from Seattle to Los Angeles. Normally, when packing, we haphazardly shove our suit cases into the trunk and squeeze bags between the front and back seats. But this year, we decided to leverage the installed roof rack, purchasing a black cargo bag capable of storing up to 15 cubic feet.

     

    Roof rack from Amazon basics
    Roof rack from Amazon basics

    Storing all our luggage — two ukuleles, a carry on suit case, Christmas presents for family, dry freezed raw dog food-— overhead freed up the entire rear of the car, allowing Jess to set up what she calls the dog palace:

    Metric sprawled out in the dog palace
    Metric sprawled out in the dog palace

     

  • Reading my first science fiction book

    I just finished reading my first science fiction book!

    Up until three years ago, I really only read non-fiction books (e.g. The Power of Habit, Outlier) with the single purpose of expanding my intellectual knowledge.  I read to increase my depth in a subject (e.g. programming) or read to pick learn about an entirely new subject (e.g. locksmithing). However, I’ve come to realize, after my wife pursuaded me to read the Harry Potter novels, that I can read for fun — no pressure to soak in new information.

    So, about six months ago, my Italian colleague (who wears a heavy beard) from Dublin flew over to Seattle, where the Amazon headquarters lives.  While he was in town, I suggested that, since he’s an avid reader, we swing by my favorite local, Seattle book store: The Elliot Bay.

    Elliot bay bookstore in Seattle
    Elliot bay bookstore in Seattle

    So after work one day, we made plans to hit the book store so I launched the Lyft app (sorry, no Uber for me since reading Susan Fowler’s post that revealed the company’s rampant misogynistic culture) and popped in the destination address.

    When we arrived at the bookstore, we scattered in different directions. While mindlessly sauntering, I recalled a memory of me visiting (about 8 months ago) my team’s office located in Dublin in order to ramp up as a new hire.  One afternoon, I was sitting next to my colleague and on next to his laptop sat a thick, six inch novel — a science fiction book, the front cover painted with emerald green.

    So, back to the book store. While we were walking up and down the various aisles at Elliot Bay, I leaned over and asked him if he could recommend me a science fiction book, a genre I was unfamiliar with and a genre that, up until that point, I had zero interest in. As if he was born for this very moment, he scuttled over from the poetry aisle over to the science fiction section and began scanning the shelf, his index finger running horizontally along the books, his focused eyes rapidly reading the titles. And then, he stopped.  He gripped a tiny blue paperback, the title boldly printed with: Caves of Steel.

    Front cover of Caves of Steel
    Front cover of Caves of Steel

    I ended up purchasing the book but maintained my low expectations.  I had always imagined that science fiction was too abstract, a genre rammed with plots and story lines that disconnect from anything resembling reality.  I preferred literary novels — To kill a mockingbird, Boys in the boat; novels that capture the human struggle.  Science fiction is just unrealistic, right?

    I couldn’t have been more wrong.

    I absolutely fell in love with the book (and the genre) and blasted through it within a couple days.  Although the book centered around robots, the plot was not so farfetched. In fact, reading page after page, I found myself empathizing with the main character, Elijah, a police detective who laments working with his robot partner and who fears that one day, he’ll be automated out of a job.

    The book was written and published in the 1950s and the author — Asimov, the defacto father of robots — paints such a realistic picture of the dystopian future, a future not so out of the question, considering that I currently live in a modern day dystopia: net neutrality was killed in the US today. Furthermore, after finishing up the first book in the series — I’m now on to the second book, The Naked Sun — I can better understand how Elon Musk’s vision (immigrate to outer space) was shaped by Asimo.

    In short, if you think that science fiction only appeals to a certain group of people, do yourself a favor and go pick up one of Asimov’s books (e.g. iRobot, Caves of Steel) and I promise you that you’ll lose yourself in the plot, in the writing, in science fiction.