Author: mattchung

  • 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.

     

     

  • Dog done run & pool party

    Last Saturday, I woke up at 06:00 AM (about 30 minutes later than I normally wake up on weekdays) and slipped into a striped, cotton t-shirt that my sister bought from target for my last birthday and my favorite knee length corduroy shorts, dressing myself in preparation for a 2 mile, dog friendly run in Tacoma, a city 45 miles south of where I live in North Seattle.  I found this event advertised in the pet connection magazine, a free and well circulated newspaper that’s often laying around in the local coffee shops and I decided that, since my wife was gone for the weekend on a women’s retreat, me and our two dogs would kick start the morning off with some exercise.

    The night before: eating sorbet ice cream with the dogs
    The night before: eating sorbet ice cream with the dogs

    In addition to the 2 mile run, the event included exclusive access to a city owned swimming pool that was opened up for pet dogs.  The pool was to be drained and emptied out since summer was coming to an end, so the parks and recreations center decided to allow, for a small fee, owners to bring their dogs in for a swim.

    So after getting dressed, I loaded the two dogs in the trunk of my ford escape, fired up the engine, popped the address of the parks and recreation center into Google Maps and then hopped on the I-5 freeway.  I had left the house an hour and a half before the event started, leaving myself 45 minutes of buffer; I did this for two reasons: I hate being late and I almost always get lost despite having directions.  And good thing I did, because the latter proved true once again, because when I arrived at the destination that I had initially keyed into Google Maps, I found myself pulling the car into an empty parking lot, a clear sign that I was in the wrong place. While idling in the parking lot, I opened up my phone’s browser and began typing away, searching for the correct address.  Eventually I landed on the event website, which had the address plastered across the front page.  So I took this new address and proceed to hop back on the freeway.

    After driving 10 minutes back in the direction I came from, I eventually made it to the right location.  I was certain I was in the right place this time but not only was the parking lot packed like a can of sardines, but when the drivers (dressed in running clothes) opened up either the doors of the backseats or trunks, their dogs would leap out.

    Now that I was in the right place, I harnessed Metric and Mushroom, and the three of us sauntered over to the center of the park that was bustling with people and dogs, finalizing my registration under registration canopy and then pinning my micro-chipped racing tag to my chest.  I then stepped over to the next canopy, where grocery sized bags, filled with goodies sponsored by Mud Bay, were laid out in rows along a table.  I grabbed two bags, one for each dog, and then returned to my parked car, where I locked all my belongings (e.g. phone, wallet) into the glove compartment.  With my pockets empty and with the two dogs amped up, ready to go, I proceeded to the starting line.

    Two canopies, one for registration, the other for gift bags
    Two canopies, one for registration, the other for gift bags

    A crowd of us runners and our dogs huddled around the starting line, where the event coordinator, a tall man with the voice of a lion, was making some announcements, primarily house keeping items like thanking the sponsors of the event and directions on how to navigate the course.  While he wrapped up his speech, I snaked my way to the front of the line, a leash gripped in either hand.  After his final announcements, he announced that the race was beginning and counted down, ending with “Go!”

    And we were off.

    I began jogging at a reasonable pace, a pace of about 9 minutes per mile.  But after the first mile, Metric and Mushroom were no longer bolting in front of me.  Initially, they were galloping like horses, practically dragging me to the front of the race. But they slowly began to run out of steam, their tongues flopping to the side of their mouth, panting louder with every step.  And even though I wanted to power through and maintain my position in third place, I decided (after realizing that I was damn happy that the dogs were healthy enough to run this race with me) to reduce my jog down to a walk, stopping at the next check point, where bowls of water were laid out for the dogs.  Metric and Mushroom practically slurped up the entire bowl.

    We ended up finishing in 4th place, both dogs completely drained and ready for their nap.  But as soon as I walked them over to the swimming pool, they were suddenly filled with energy, as if they didn’t just run 2 miles.  I unleashed them from their harnesses and the two of them dashed into the water, spending the next hour paddling in the pool, constantly fixing their gaze at me, their way of signalling me to toss a tennis ball for them to fetch.

    I really enjoyed the event—running 2 miles and letting the dogs to swim—and will definitely return to Tacoma next year for round two.

    Metric and Mushroom staring me down, saying "THROW THE BALL!"
    Metric and Mushroom staring me down, saying “THROW THE BALL!”
  • Practicing my ukulele

    Over the past month, I’ve been investing more time in learning the ukulele, sitting in the office area in the morning, strumming and picking my soprano ukulele for at least 30 minutes either in the early mornings or just before hitting the sack.  In addition to my daily routine, I’ve not only been taking weekly, 1 on 1 lessons from a local instructor in Seattle but I’m also reading books (favorite one so far was a short, 40-page book on music theory) and watching videos, playing along with the instructors from The Ukulele Underground.  I find this website very impressive not only for the content itself, but how well organized it is, breaking down the website into different levels: beginner and intermediate and advanced.  The organization of the website allows me to find exactly what I’m looking for. And when I cannot find the content I’m looking for, their staff is very responsive, replying to my messages.

    In addition to my practice routine, where I drill scrumming patterns and drill my understanding of music theory, I make sure to carve out time (even if it’s just a few minutes) to just enjoy the instrument, playing songs that I like.  Isn’t that the whole point—enjoying the beauty of music?

    Speaking of songs that I like, here’s a video of me practicing the introduction to the song Stand by me. If you watch the entire 20 second video, you’ll be blessed with the special cameo appearance.

  • Returning to social media?

    For the past year and a half, I’ve disconnected myself from all my social media accounts: Facebook, Twitter, Instagram.  Those platforms still presumably store my data (e.g. posts, images, chat logs) but I no longer log into the system, neither consuming or contributing any content. This disconnect was motivated by several reasons.

    First, I had originally cut myself off from social media because I found myself mindless scrolling through the posts, spending an hour here, an hour there.  This would happen multiple times throughout the day; anytime I needed to occupy myself with something.  I felt as if I losing what I consider the most valuable currency: time.

    The second reason is privacy.  It’s not that I’m looking to retreat into a hole, never to be seen, hiding from the government.  If that was the case, I wouldn’t be posting on my blog.  But I do struggle with the idea that these organizations (e.g. Facebook, Twitter, Instagram) mine my data, applying algorithms and selling my behavior to other organizations, other organizations that then, in turn, shove unsolicited advertisements down my throat.  But I’m not surprised: these organizations are in the business of selling information. You and I are not the customer; we’re the product.

    But, despite my long absence from social media, I’m reconsidering using these platforms.  Because during lunch this past weekend, my sister’s 11 year old step daughter shared a different perspective, a glimpse of the value of social media.

    Since she lives in southern California, only able to visit my wife (who she absolutely adores) and I about once every few months, she stated that with social media she was able to “stay connected … the only way [she] could see what’s going on in [our] lives.”

    Touché.

    Unless I’m blogging, unless I’m sending them direct e-mails, nobody has a damn clue what’s going on in my life. So, she’s got a point.

    Unfortunately, I tend to forget that other people (i.e. close friends and family) might be interested in what’s going on in my life, just as interested as I am in theirs.

  • A sneak peak of my wedding photos

    Although Jess and I legally married six months ago (February) in King County Court, a municipal court in Seattle, we threw our wedding ceremony just three weeks ago.  The Saturday ceremony was held in Malibu at Great Spirits Ranch, a ranch that overlooks the Pacific Ocean and Ojai mountains.  Most importantly, this venue was dog friendly, allowing our two dogs—Metric and Mushroom—to roam free throughout the entire day.  It was at this spiritual ground where 120 of our closet friends and family from all over the world—New Zealand, Texas, London—gathered around to celebrate our special day.  Below are a sneak peek of some photos, while I draft up another post on lessons learned from being married.