The Coding Challenge

I finally got what I’ve been asking for, an opportunity to bypass all the crap I’ve complained about, an opportunity to show a potential employer what I can actually do, an opportunity to show what I’m capable of, an opportunity that may not present itself again …. and I fucked it up.  Yeah, you know it’s serious when I use that kind of language.

First let’s go back to my last post, one I’m not exactly proud of, but this blog is about my journey, the good and the bad.  In that mess of negativity and whining, I mentioned one company I applied for whose CEO was quoted as saying that he only cares about what a person is capable of and not they’re background.

In that application I was given an assessment.  One of those aptitude tests that have absolutely nothing to do with programming followed by a personality test.  You know the one, where you’re asked things like “have you ever stolen something” and then asked that same question 5 more times but reworded to try and trip you up.  Well, I never made it past that. I know I KILLED the aptitude portion, which means there was something in my personality assessment they didn’t like.  Man, talk about feeling rejected.  It’s different when it’s personal like that.

So about a month ago I was at a local React meetup and met a person who was working with someone who filled in most of their senior and mid level developers and were about to start on filling in with juniors.  Fast forward almost 2 weeks and I got a call from this person.  He started to talk about the position and I recognized it right away.  He told me the company name and I smiled.  It was the same one I had already been rejected from because of the assessment tests.

I go on to tell him about it and he agreed that those assessments are a ‘crock of shit’ and that even the director at the company was opposed to it, but it was an HR thing.  Well, it just so happened that they figured out a work-around, and he needed people quick.  I’m getting pretty excited at this point, I already know what the company does and would love to be a part of it, and as a bigger bonus, their office is literally less than 2 miles from my home!  In so many ways this was the perfect role for me, and finally, the stars were starting to align!

All I needed to do was take their coding challenge, completely bypassing all the initial crap.  I even felt like the person I was speaking to was rooting for me.  He told me if I knocked it out of the park that I would be ‘golden’ and it would be a big ‘F U’ to that stupid assessment.  I can’t even begin to describe the level of excitement going across the phone.

I get the challenge e-mailed to me, and start digging in to it.  This is going to be fun, I get to finally prove myself, and dive into a topic I haven’t had a chance to before, cryptography!

The challenge provided 3 files, 2 of which were encrypted and a regular plain text file.  At a minimum, I had to write an algorithm that would decrypt the easier of the 2 encrypted files using the plain text file as a base.  As an added bonus, and to really impress, I would of had to also decrypt the harder version, and could create an API and/or a Single Page App (SPA).

So where do I begin? I had no clue, other than the Little Orphan Annie decoder pin from ‘A Christmas Story’ and having recently watched the movie ‘The Imitation Game’ about Alan Turing, I knew absolutely NOTHING about cryptography.  It’s always seemed an interesting field and from what I knew you could spend years trying to master it.

Not knowing anything, I go to a developers best friend, google. I start reading up on some basics of cryptography and really just barely scratch the surface with the different types of ciphers that can be used in a ‘simple substitution’ encryption.  Think ‘A Christmas Story’ here where you simply substitute a letter with another one.  The simple part is that the substitute letter never changes.

At this point I figure the easy encrypted version has to be one of these simpler substitutions.  Especially after looking at the text patterns I could just tell that these letters weren’t changing.

But how do I use the plain text?  The instructions said to use it as a base, but I had no clue what that meant, and didn’t find anything anywhere that talked about ‘using plain text as a base’.  I ended up assuming that the encrypted text was from some part of this plain portion (which was over 5 million characters long).  And since all the spacing, punctuation, and capitalization was preserved, I decided to try and find where the word letter count, spacing, punctuation, etc. matched between the two versions.  Once I found that, I started writing out the letter substitutions.  Things were coming together and I noticed a pattern, which I could instantly see matched a couple of the types of ciphers I read about earlier.

Once I knew the type of cipher used, I was able to write up an algorithm to find it on it’s own.  One requirement of the challenge was to not ‘brute force’ the solution as the cipher could change anytime.  While the algorithm I created could figure out the cipher no matter what the substitutions were, it did have to know what TYPE of cipher is used to work, and in this case one specific type.  So not technically brute force.  Plus I was explained ‘brute force’ meant not hardcoding the cipher as in ‘A’ is always ‘F’, ‘B’ is always ‘C’, etc., and my solution definitely wasn’t that.  The letters could have been substituted with anything and still worked.

With that part done, I decided to start on some sort of SPA.  I decided to write it up using the MEAN stack, leaving out the M since I didn’t need a database for anything.  So it’s all JavaScript built on Node.js with Express.js and Angular.  I was trying to make something that would hopefully impress so I used Angular 1.x since the majority of my experience is with that version.  I didn’t want to waste time trying to use something I had to learn at the same time.

During this time, I got a follow-up call from the person who got me this chance to see how I was coming along.  I had told him and he seemed excited about my progress.

I didn’t have any time limit but it was coming close to a week and I figured I had to get something turned in.  Of course I had a bunch of other things going on so I didn’t actually have all of that time to dedicate to this challenge.  I knew I wasn’t going to have my SPA where I wanted it in the time I allowed myself so I took on the harder encrypted challenge.

My algorithm wasn’t even close to working on this one, which I expected.  And unlike the easy version, whatever this translated to, it wasn’t going to be found within the plain text.  So now I had to rack my brain trying to figure out what to do.  I began searching google for other types of substitution ciphers (even though this was harder it still looked to me like a simple substitution), and stumbled upon a short article about frequency analysis.  Basically what this does is just use the most commonly found letters, words, etc. and starts substituting them.  Based on the odds, this could get you something to work with.

First I started with one letter words, which there are really only 2, ‘I’ and ‘A’.  I found all of the one letter occurrences and started my cipher.  These are actually easy to find because ‘I’ is always capitalized when used, versus ‘A’ which can be either.  This time, I was hard coding, a.k.a ‘brute forcing’, the cipher and using my previous decryption algorithm to start decrypting the text, leaving spaces for the letters I haven’t figured out yet.  Then I looked at 3-letter words, specifically ‘and’ and ‘the’, which are the most common of all of them. I already had the ‘a’ figured out so I could tell which one was which and added those letters to my cipher.  Decrypt again and things were looking good.  Next I looked for twin letters.  There’s not many of those either and ‘LL’ is the most common.  Added that to my cipher, decrypted, and things were starting to look up.  I started looking at other more common things, like after an apostrophe you normally see either a ‘t’ or ‘s’.  I already had the ‘t’ so the ‘s’ was easy to figure out.  Decrypt again and now it became a game of Wheel of Fortune.  Words were coming together and I was feeling just like young Ralphie, licking my lips with excitement and anticipation of figuring out the encryption.

Finally I figured it out, except there was a problem.  Looking at the cipher, there was absolutely no pattern at all to the substitutions.  Nothing to tell me what type of cipher was being used or how it was made.

My personal time limit was nearing an end.  The hard encryption was a bonus anyway so I said I had to brute force it but at least I figured it out on my own.  All the code was up on github and I told him he could submit it.  I was having a lot of fun with this though and told him that I would keep working on it anyway and would be updating github as I continued.

That was a couple weeks ago, and I haven’t heard anything since.  But I kept working on it.  I even got my SPA somewhat presentable and went ahead and deployed it live via AWS EC2.  As soon as I did that I called him up and left him a message to get an update and tell him about my new progress.  I emailed him as well and included the IP address.  That was about a week ago, again, still haven’t heard anything back.

At this point it’s safe to say what I had wasn’t good enough, this job just isn’t going to happen.  I had my chance, the one chance I’ve been begging for, and I blew it.  I didn’t crush this challenge like I believed I could.

I wasn’t lying though about enjoying this challenge, so I kept working on it, trying to figure out how to get a computer to figure out what I did on my own.  Then one night, as I was half asleep, it hit me like a Mack Truck.  Using the plain text as a base didn’t mean it contained the encrypted message (even though it actually did for the easy version).  It was all about the ‘frequency analysis’ I did myself, and what I should have done, is created an algorithm to parse through the plain text and determine the frequency of letters, words, patterns, etc.  Then using those frequencies, have the computer figure out what to start replacing the same way I did.  Then it was a matter of getting the computer to play ‘Wheel of Fortune’ to fill in the gaps.

And now we come to today.  I’m currently working on getting the algorithm to work.  I’m partially there, but it’s a bit ugly with a lot of conditionals.  For the ‘Wheel of Fortune’ part, I plan to use a word or dictionary API to cross-reference the words.  One issue I know is going to come up is made up names, names that aren’t going to be like any word in a dictionary.  But one step at a time for now.

This challenge has turned into a full-blown project for me, one that is going to be on my portfolio.  I have a vision for it and once I make it a reality, it’s going to be impressive.  It might be too late for the original position I was vying for, but I’m going to make sure it helps me with the next.

Before I end this post, I have one last thing I want to say:

He okpe ms lpytw dskp Sjcvmyte!

In case you can’t figure it out, just go to the ‘decrypt your text’ section of my app and use the keyword ‘challenge’.  It’s still in its early stages of development so don’t expect anything too amazing….yet!

Cryptography and Ciphers

MY work finding process (and the college divide)

A while back I had a guest poster talk about his job finding process, this is mine. Except I refuse to use the word job (I went on that little rant some time ago in a post I can’t remember), so I use the word work, because that’s what it is, even if it does have to do with something that I really enjoy doing.

I’m going to start by using a technique in movies and tv that I hate, telling you the end first.

So here I sit, starting this post, at Coding Dojo. Why am I at Coding Dojo well over 2 months after I graduated? Because as of last Friday, I’m officially an Apprentice Bootcamp Leader, and in front of me is a new cohort of 21 people that just started today.

New Cohort, New Career

Now that I’ve spoiled the ending, let’s go over the journey getting here.

(and break….I started the above on Monday the 19th. It’s been such a crazy busy week that it is now Friday as I come back to finish this post)

Although the process started before graduating from Coding Dojo on July 1st, it wasn’t until much later in the month that I started to actually apply for positions. Reason being, my resume, portfolio, linkedin, etc. weren’t anywhere close to being presentable. My portfolio didn’t even exist yet. Factor in time spent with the family and loss of any type of structure that I had in the Dojo and things just didn’t progress as fast as they should have.

I already spoke about the career services issues so I won’t go into that again (those issues have been remedied though). I also had my eyes set on a specific company that I wanted (and still would like) to work for so a lot of my focus was geared toward them (no pun intended…or was it?).

Besides that I’ve interviewed and worked with recruiters, applied for a bunch of positions, interviewed with prospective employers, and didn’t get very far. To be fair, because of where I live I mostly just applied to companies in Frisco and North Plano, I just didn’t want to deal with the long commute anymore. That left out Downtown Dallas, Richardson, and Addison, which seem to be the biggest tech hubs here in North Texas.

First, lets talk about coding bootcamps. Besides the fact that they’re generally a newer thing, there just aren’t many around Dallas. This means a lot of employers didn’t seem to be familiar with them, what they do, or what they can expect from the graduates.

That ties in to the biggest issue I faced out there….experience. It almost always boiled down to exactly that. What sounds better to you? “I’ve been coding for 6 months” or “I’ve been coding for 2 years”. Here’s the thing, time is a relative thing and you can’t base skill solely on time. What if I said the former put in over 1000 hours of coding within a span of 3.5 months plus another 500 hours for the remainder of the 6 months. And the latter mostly just coded over the weekends and over the course of 2 years maybe has about 1200 hours. Makes a difference doesn’t it. I don’t think some of these companies out there truly understand the amount of time coding bootcamp grads put in to learning the craft.

But that’s not professional experience, which is obviously more important, but everyone has to start somewhere, right? On the other hand though, professional experience doesn’t always mean the person knows what they’re doing. I was recently talking to a very experienced programmer who told me he worked with a Sr. Front-end developer once who actually asked him where JavaScript runs. This guy apparently had 10 years experience and this was before the time of Node.js. Even in my short time I’ve seen a person with about 6 months experience run circles around another person with 3-4 years experience.

It’s not even in programming, take any career in any industry out there. I can’t tell you how many times I’ve run into people with 5,10,even 20 years experience in their field that didn’t have a clue what they were doing.

More recently, I interviewed with a company that I was brought in for specifically because they “wanted someone new that they could take under their wing, train and mold”. A couple of my cohort-mates actually interviewed with them as well and we were all denied because we didn’t have enough experience and they wanted someone that’s been professionally programming for a few years. Seems a bit contradictory to me.

I actually received a bit more specific feedback as to why they passed me over. They were apparently thrown off by my answer to a question about if I consider myself a Jr. or Mid level developer.

I’ll take some of the blame here. Recently, and I’m sure it’s come off in some of my posts, I’ve gotten a little cocky. Anyone that’s known me for any period of time knows that I’ve never been one to be cocky and that if anything I’m the polar opposite. But after 28 years of working (yes I started working as a paperboy at the age of 11), I’ve learned what I’m capable of and how I perform in whatever scenario I’m thrown in. I think I’ve earned the right to be confident. Even after everything I was still worried when I first started to learn to code. I didn’t have that confidence coming into a coding bootcamp, but then I did really good, really really good. After that I had no doubts whatsoever about what I can do and I may have let some of it get to my head.

So, the question. I told them that “I realize I’m technically a Jr. right now, and I’m not a mid-level yet, but I feel I’m somewhere in between and I know that I can get to a mid-level in a few more months”. I don’t think that was too bad, buuuuut, I didn’t stop there. Nope, I had to keep going. I went on to say that a lot of companies that look for Jr.’s want 2-3 years experience, and that by the time I have 2-3 years experience I’ll be overqualified for those positions and I’ll be at a Sr. level.

Um, yeah, looking back I may have gone a bit far and definitely didn’t do a very good job of communicating my strengths in a manner that doesn’t come off as a cocky bastard. Yup, it’s a fine line and I crossed it.

I didn’t realize it though until last week when I was at lunch with the career services manager and other instructors, told them about that and I got a pretty bad reaction with a bunch of ‘no’s. It made me think about what I said and how I’ve been coming off lately. I know I have a LOT to learn still, and that’s the part I failed to convey.

Moving on, the other thing I’ve found out there is that it’s really hard to find available Jr. level and even mid-level positions. Most of the stuff advertised is for Sr. levels. The lower levels come by word of mouth, who knows who, and meetups. That is why meetups are SO important. Other than a couple notable exceptions, the closest any of us bootcamp graduates here in Dallas have come to finding work has been through meetups.

It was through a meetup that I met someone who later on contacted me about a position he had at his company. That position wasn’t right for me so I had to pass, but I did get a couple of my cohort-mates in for interviews there. Another cohort-mate got as far as completing a coding challenge with a company before being told they’re really looking for Sr. levels at the moment. Through a meetup a different cohort-mate actually got a paid internship, working on .NET!!!! Yeah, something completely different than what he learned, had zero experience in, and he got in and is getting paid to learn it on the job.

That’s the best tip I can give for anyone looking for work. GO TO MEETUPS! GET CONNECTIONS! MEET PEOPLE IN THE INDUSTRY! You never know, one day, someone at that person’s company will ask them if they know anyone for an open position. That anyone could be you!

Next tip, don’t give up! Don’t take no for an answer either, (but don’t be crazy about it). One of the recruiters I worked with almost didn’t happen at first. During my first call with the recruiter, once we got into the issue of my experience, they told me they don’t have any Jr./entry level positions and was about to end the call. I wouldn’t let it go that easily though and before the call could be ended, I interjected and went on about what I’ve accomplished so far with regards to coding and what I’m capable of (without being cocky like I was above). My passion came out and next thing I know I was setting up an in-person interview with them.

Two days later I went through a round-robin of interviews with 4 different people at the recruiter’s firm. I got a great vibe with all of them and one of them told me that they were able to recently place someone with the same experience as me in a company that wanted more. She said this persons passion just came out and she convinced the company to give him a try and not only did everything work out great, the company was absolutely happy with the decision.

The initial call that almost ended prematurely ended up with a great connection, and turned into an interview directly with an employer, another possible interview with a startup, and who knows what else in the future.

Finally, I want to talk about the whole college thing. It’s no secret that I don’t have a degree of any kind. One of the main things that drew me into pursuing coding was that you can get around the college degree requirement and experience by showing off your skills. If you can create a full-blown application, if you can create something amazing, then your past history or having a degree no longer means as much.

I’m not saying college is a waste of time, if you have the ability to go through it and get the education that results in a degree than by all means do it. Even though it shouldn’t matter in some situations, having it can only help you, it won’t hurt you. And that leads into this divide.

There are those that do believe college is a waste of time, and they’re wrong. At the same time there are those that have a college degree that think you can’t be a great programmer without one, and they’re wrong too.

I may not have a degree, but I did take some courses for several semesters at Central Michigan University as well as at a community college. There were a bunch of classes that I absolutely loved and I can tell you that, 20 years later, I probably couldn’t tell you 98% of what I learned. What does that say about if I had a degree? A piece of paper doesn’t mean I’m going to just start remembering everything.

Having said that I’m sure it’s a little different if you go straight into the industry that you degreed in and keep building on top of it.

Problem is that some people think, “I went through it, so you should as well”. That’s the overall vibe I got from one interview I did. From the research I did on the company, majority of them and the founders were all graduates from the same university with some sort of CS degree. I was specifically asked if I took any CS classes at all, and after I said I hadn’t, I was asked if I knew any ‘logic’ or worked with ‘logical problems’. I just got the feeling that they didn’t believe anyone could become a great programmer without a formal CS education.

I think I was able to overcome that last part pretty well though, mostly thanks to how Coding Dojo emphasizes algorithms and had us working through them everyday. I also went into how I decided to first get more in depth into learning how a computer actually works at the lowest levels before starting the bootcamp. Plus I have watched most of the CS50 lecture videos put out by Harvard, so I ‘kind of’ took a CS class (I didn’t mention that part though).

Cut back to the present. Because of my performance throughout the bootcamp, I had the opportunity to become an Apprentice Bootcamp Leader, which gets you started on the track to possibly becoming an instructor. Of course I still had to get through a couple interviews, some whiteboard algorithm challenges, some efficiency requirements on past assignments and finally a coding challenge.

For my coding challenge I created a program to generate a random binary search tree that would come out invalid and unbalanced. I then created functions to check if a tree is valid, what its height is, and if it was balanced. Then I had to turn the tree into a valid binary search tree in place (meaning I couldn’t just copy the values and create a new tree). Finally the hardest part, balancing the tree. I learned a LOT here and have become somewhat obsessed with trees now. In fact I’ll be writing a technical post about them in the near future.

But wait, didn’t I NOT want a long commute? No, I didn’t, which is why I didn’t start the process straight out of graduation (plus I was really shooting for the Gearbox position). But my wife understood and was the one to ask why I wasn’t applying for it, so I did.

Outside of the commute, there was pretty much nothing but pro’s on why I should do it. Even at the start of the bootcamp when I heard about the program I was interested in it. One of the things I loved doing while going through it was being able to help others whenever I could and the feeling that came with helping to fix something broken or better yet, when you see someone have the a-ha moment that you helped bring (I know that might sound a bit cliché, and I think I’ve read it in several other blogs, but it really is true).

That’s not it though, by doing this I’ll only solidify further and expand the knowledge I already have. I’ll be able to take on those more advanced optional assignments that I never did the first time. I’ll even have the opportunity to go through the Python and iOS tracks and add those to my knowledge base. I’ll be able to vastly improve my portfolio and gain more experience.

This is only a 6 month deal though, what happens after that is an unknown. Maybe I’ll have the option to advance further with Coding Dojo, or maybe I’ll move on to other things, or maybe a spot will open up again at Gearbox. Who knows, but whatever happens, I’ll be much more prepared with a whole lot more to offer.

The Challenge!

To say that going to a coding bootcamp is going to be a challenge is putting it lightly, but it’s a challenge that I’m really looking forward to.  The logistical challenges are one thing, you know, how to pay for it, how to keep some sort of income flowing, figuring out the commute that’ll be at least an hour long each way, etc., but that’s not what this post is going to be about.  There are also some emotional challenges, like not being able to see my daughter at all Monday thru Friday, that I’ll touch upon.  Mainly I’m talking about the learning challenge, and the challenge to not only succeed but set myself up for life afterward.

One of my greatest strengths has always been my ability to learn things fast and to be able to excel at them.  It’s been such a strength in fact, that I rarely worried about taking on new endeavors.  Take for example when I was training to be an auto damage adjuster.  The company I worked for basically sends you out to a 4 week auto damage bootcamp in the D.C. area.  Prior to that though you go through some fundamentals in your region, and then some post-training afterwards.  Going through the fundies was easy for me and I breezed through it.  Then, before I left for the bootcamp, my regional instructor said that they acknowledge a top 5 in the class at the bootcamp and that he never had someone come back to his region in that top 5,  and that he thought I could be the first.  I honestly just laughed and said “Top 5?  I’ll be Top 1!”  That’s the type of confidence I had.  Granted, I’ve been around cars my entire life, but I had zero experience in the collision side of it.  This bootcamp wasn’t just an easy breezy training session either, the company actually paid up to 3 hours of overtime every day just to allow you to study, and my class still lost about 8 people along the way that couldn’t keep up.  As for me, I honestly barely even studied, and yes, I came back to my region as #1.  There was even an exam during the course of it that the instructors prefaced with by saying that everyone would struggle and no one’s ever come close to getting a 100% on it.  When they were handing out the scores they actually seemed somewhat upset when I had earned a perfect score.  Same went for everything else I’ve done.  When I was in the Air Force I graduated through all of my tech training in aircraft maintenance at the top of my class, nearly going through it with a perfect score as well.  In fact, during the 6 months of training I only missed 1 single exam question.  More recently I took a college accounting class, I aced through it so easily that during the final exam I finished in half the time of the next quickest student, and still scored a 100% on it.

I don’t mean to brag by bringing all that up, I’m just trying to convey how I usually go into things knowing that I’ll not only succeed, but also be the best of the best.  Well, ok, maybe I’m bragging a little, but here’s the thing, I don’t have the same, um, cockiness about going into this coding bootcamp.  I’ve read other blogs of people that went through it, but they mostly had at least some form of computer science or programming background/experience.  Some were even studying for their Masters degrees.  Yet many of these clearly smart people still struggled at times.  Add to the fact that it’s extremely important for me and my family that I get a good paying job soon afterwards, really puts on the pressure for me to succeed.  This time I can’t guarantee it though, but don’t get me wrong, I’m going to do everything I possibly can to come out on top, I’m just much more humbled and know that I’m going to have to work harder than I ever have before.  That’s also a good thing, knowing it’s going to be a challenge has gotten me more excited than ever to tackle it head on, especially since if I don’t succeed, then all my talk of always being the best will just blow up in my face.

So what am I doing to help prepare for basically what’s the biggest challenge of my entire life?  Well first of all, it helps that so far I ABSOLUTELY LOVE IT!  I’ve started looking at some intro courses, learning some basics, and going through algorithms, and already can’t get enough of it!!  It’s all I want to do all day.  If I didn’t have to worry about doing other things to help with some of those logistical challenges I mentioned, learning to code would be the only thing I would be doing at the moment.  I also started this blog, not only to hopefully one day be able to inspire someone like me, but also to help myself in truly engaging in everything I’m learning and to really hold myself accountable.  I’m pretty much putting my life and all of this out there in the public, so not only is failing not an option, it would be humiliating.  As I go through the Coding Dojo bootcamp, writing daily posts will only help solidify whatever it is that I learned that day.  To further point out how much of a challenge I expect this to be, I’m even preparing myself physically, taking vitamins and going so far as to learn what foods help keep your brain sharp!  I’m definitely not taking this lightly! Lastly, I already know that there are going to be down times, days that are so challenging that it may make me question everything, but the one thing I know I have to help me get through it all is my daughter.  All I have to do is take one look at her to know that I can do this, that I can take on this challenge, no matter how hard it might get, and push through the tough times.

If you follow my blog, you’ll get to see everything I do along the way to get to whatever point I get to in my coding career.  I’ll make note of the courses I take, videos I watch, books I read, etc.  We’re still in the early stages here and I haven’t even got to the whole admissions process as promised.  As I’ve stated before, we still have some catching up to do.  As I’m writing this post it’s already February 3rd, 2016, less than 2 months before my official start of the bootcamp, yet I haven’t even discussed all of what I’ve done up to this point to prepare, and it didn’t really kick off until just before Christmas 2015.