Impressed but not impressively- A friend’s interview code sample

So a friend of mine is currently employed at a large multi-national IT contracting company. Well, that’s not entirely true, the company does staff augmentation for many sectors, IT being one of them, and while they can provide full software development life cycle services, they are typically staff augmentation.

That being said, he’s a developer. And a developer who came to developing later in life after learning, living, and dumping a previous career. He’s been doing professional development (i.e. it is his sole income) for 6 years and of the many developers I know he’s a natural, learns quick and the “right way” and the why’s. I’d hire the man for a senior developer position in a minute.

However, the economy being what it is, he is currently working a junior developer position. By which I mean doing senior developer work for junior developer money. Hey, it’s beats unemployment, no doubt, however things could be better along the compensation lines. As I’ve said, the man does not play around and he’d be a bargain at 3 times his salary (straight up.)

Well like any sane person (well as sane as one can be and still want to be a software developer), he’s taking the initiative and looking around for other employment where the compensation will be more commensurate with his efforts, and the challenges will be developmental and not overcoming ridiculous arbitrary management process (again, you’ll have to take my word that the problems are ridiculous and that he can not change them.)

So one of the places his recruiter is submitting his resume to is requiring he write a small windows console application that satisfies the following requirements:

  • Counts from between 1 and 100 inclusively
  • When the number is evenly divisible by 3, it should print “One
  • When the number is evenly divisible by 5, it should print “Two
  • When the number is evenly divisible by 3 and 5, it should print “OneTwo
  • When the number is not evenly divisible by 3 or 5, it should print the number
  • Ok, fair enough. I love that they asked for a code sample. At the end of the day, writing the code is part and parcel for software developers and I feel that the trend of those “what did you have to do”, “what were the results of doing it”, and “what could you have done differently” interviews… Sure you need to make sure the person is a good fit for the team as far as socializing, personality, not an asshat, but if they are a good fit, can they design and/or write the code.

    Well, I’ll say you have to at least consider it for a second but the above is not that challenging. Basically it will show you know how to nest/cascade if’s and perhaps know about the modulo operator.

    I would have been more impressed if they asked for a super and derived classes using interfaces to model a car, motorcyle, and airplane. But, I don’t know the company’s true needs so I’ll give them the benefit of the doubt.

    Anyway, good luck my man!

    Below is what I did… I feel it could be more performant but is pretty readable and gentle enough on resources for most stuff (I had to take a swing right?!?) …

    static void Main(string[] args)
    {
        StringBuilder valueBuilder = new StringBuilder();
        for (int counter = 1; counter <= 100; counter++)
        {
            if (counter % 3 == 0) valueBuilder.Append(“One”);
                if (counter % 5 == 0) valueBuilder.Append(“Two”);
                if (valueBuilder.Length == 0) valueBuilder.Append(counter.ToString());
                Console.WriteLine(valueBuilder.ToString());
                valueBuilder.Clear();
            }
        }
    }

    Another Amazon.com Win

    Recently, a friend of mine switched his web hosting to an Amazon Elastic Compute Cloud (EC2)  and was very pleased with the results; so much so that I decided I needed to look into this myself as a currently provide web hosting for a number of small domains and while I am satisfied with my current provider, as it turns out Amazon offers deep discounts for longer term agreements (one or three years) which are very competitive.

    As I like to do, before I get into the Amazon.com win, I’d like to provide a little backgroundSmile

    Amazon’s description of their service is (ref: http://aws.amazon.com/ec2/) :

    Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.

    EC2 is Amazon’s version of Virtual Private Server hosting which in a nutshell is renting a an actual server computer that is located and run by the hosting provider and they give you an administrator account to that server such that you can use to install and maintain any software the server can run, such as web servers, DNS servers, source control, even video games. The advantage to a VPS hosted environment over traditional web hosting is that you get to decide exactly what services the server runs. Traditional web hosting generally provides you with a web server and usually an FTP server, and sometimes SSH access to a remote command line. You can then upload content to and not what web server software you’d like to use, or install any additional custom services.

    Currently (1/15/2010) Amazon has a Free Tier which, if you are eligible for, you can get a linux based micro instance free for a year. This tier comes with a limited but what I feel is a generous amount of bandwidth and storage use.

    From Amazon’s AWS Free Usage Tier product page:

    AWS Free Usage Tier (Per Month):

    • 750 hours of Amazon EC2 Linux Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month*
    • 750 hours of an Elastic Load Balancer plus 15 GB data processing*
    • 10 GB of Amazon Elastic Block Storage, plus 1 million I/Os and 1 GB of snapshot storage*
    • 5 GB of Amazon S3 standard storage, 20,000 Get Requests, and 2,000 Put Requests*
    • 15 GB of bandwidth out aggregated across all AWS services*
    • 25 Amazon SimpleDB Machine Hours and 1 GB of Storage**
    • 100,000 Requests of Amazon Simple Queue Service**
    • 100,000 Requests, 100,000 HTTP notifications and 1,000 email notifications for Amazon Simple Notification Service**
    • 10 Amazon Cloudwatch metrics, 10 alarms, and 1,000,000 API requests**

    In addition to these services, the AWS Management Console is available at no charge to help you build and manage your application on AWS.

    * These free tiers are only available to new AWS customers and are available for 12 months following your AWS sign-up date. When your free usage expires or if your application use exceeds the free usage tiers, you simply pay standard, pay-as-you-go service rates (see each service page for full pricing details). Restrictions apply; see offer terms for more details.

    ** These free tiers do not expire after 12 months and are available to both existing and new AWS customers indefinitely.

    The price, is Free for the limits above (assuming you are eligible). Were you to exceed any of the limits, you will be charged the normal fees for a linux micro instance (generally under $.20 USD an hour for the exceeded limit.) For full pricing structure see: Amazon’s EC2 Pricing page.

    The eligibility requirements may be found on Amazon’s AWS Free Usage Tier Offer Terms page, and as of this writing, are as follows. (I high-lighted one in particular for it’s relevancy to this post) :

    Terms and Conditions

    • Only individuals who have not previously created an AWS account are eligible to participate in the Offer. You will not be eligible for the Offer if you or your organization create(s) more than one account to receive additional benefits under the Offer or if the new account is included in Consolidated Billing. You will be charged standard rates for use of AWS services if we determine that you are not eligible for the Offer.
    • You must create and maintain an AWS account in good standing (including a valid credit card) to participate in the Offer. Your participation in the Offer and your use of the AWS services is subject to the AWS Customer Agreement. The Offer is a Special Pricing Program under the AWS Customer Agreement.
    • Only accounts created after October 20, 2010 are eligible for the Offer. The Offer does not apply to any use of the AWS services prior to November 1, 2010.
    • You will be charged standard rates for use of the AWS services prior to November 1, 2010 or after the Offer expires. You also will be charged AWS’s standard rates for any use that exceeds the free usage amount provided under the Offer.
    • If you have not used the AWS resources provided under the Offer during the previous 3 months, we may reclaim those AWS resources after giving you 30 days notice. Even if your AWS resources are reclaimed, you may continue to participate in the Offer using new AWS resources.
    • You may participate in the Offer for one year from the date you first sign up for any of the services provided under the Offer.
      Unused usage amounts remaining at the end of the month do not roll over to subsequent months.
    • When calculating your use of AWS services under the Offer, we will aggregate your use across all AWS regions.
    • We may stop accepting new registrations for the Offer at any time.
    • Existing free tier offers for Amazon SimpleDB, Amazon Simple Queue Service, and Amazon Simple Notification Service are subject to separate terms and conditions described on the pricing pages for those services and the AWS Service Terms.

    So, as I stated before, I was pretty excited about the offer to check out what Amazon had to offer, especially in that I am a software developer that frequently works with web services and internet connected applications and Cloud Computing is a Big Thing in my world these days. So I grabbed my credit card and signed up immediately!

    Well as it turns out I completely forgot that I did in fact already have an AWS account that I had gotten a number of years ago to play around with some of their web API’s. This made me ineligible for the Free Tier.

    I proceed to load the server up and get it running the way I wanted to and two days later I checked back at the billing page to ensure I hadn’t messed anything up during the sign-up process. I found the process to be slightly confusing. The way what you are ordering is clearly defined and great, what was not intuitive was if what I was ordering was eligible under the micro account. You can absolutely get a Free Tier instance and purchase and pay for anything above and beyond what’s in the Free Tier, no problems. Which is great, but I found myself wishing for a way to limit the products and services to those only included in the Free Tier.

    And they may actually be, I am not certain because I was not eligible at sign-up and the UI may very well have been tailored to that of a long time user. I’m certainly not going to slight them much for that, but if that was the case, it would have been nice to know before I pulled the trigger.

    At any rate, I ended up being charged $.71 USD for 2 days of the service. Completely no big deal but if money keeps adding up and being budget wise is never a bad thing. So I quickly filled out a customer support form asking about it. This was a Friday evening and I heard back on the following Sunday morning.

    Below is a portion of the response:

    Hello John,

    I’ve researched your account and it appears your AWS account was created before October 21, 2010. This would ordinarily make you ineligible for the Free Usage Tier Offer.  However, because of your limited use of our services, as an exception I have manually signed you up for the free tier services of EC2 and S3 effective January 1, 2012.

    I was completely satisfied with the outcome. I wasn’t really sure what to expect, I was not aware that I was ineligible. I figured, worst case scenario, I pay the $.71 USD and cancel the account. And I feel that Amazon would have been completely within their right to rigidly stick to their terms. But they sure surprised me!

    Amazon’s customer service is simply excellent. It’s one thing that, I feel, sets Amazon apart from its competitors. Their commitment to making their customers happy is truly one of the reasons I keep giving them my business. I’ve had to contact customer support a few times for my regular shopping using their site, and have always been happy with the outcome. It really is nice to see a company provide the same great service across all their product offerings.

    Tip of the hat Amazon.com, thank you!

     

    On moving, home buying, and me

    Well, it’s been much longer than I had planned between writing here. But I have a reason excuse?

    I just purchased my first home. It’s pretty exhausting and umm just really a general pain in the ass. However it is also pretty damn exciting. I’m relatively late to the game at 38 for a first home. I’ve been making enough money to get the job done for quite some time now but due to a marriage, child, divorce. I ended up doing some moving around and really grew to enjoy the freedom of being able to be where ever I really needed to be, if I really needed to be there.

    My general first time home buying view is not as great as it could have been. But it certainly was an interesting learning experience. The home that I purchased was the second home I brought into the underwriting stage. Which, for the uninitiated I’ll just say is pretty far into the “buy it” portion of the game. All the inspections, appraisals, repair work, documenting repair work, re-repair work due to lack of work permit originally had already been completed it was simply the act of jumping through the lender’s financial hoops for final thumbs up.

    The annoying part is that the financial guy should have caught the problem the second he had all the financial numbers. In a nutshell, since the whole housing market collapse debacle, the mortgage industry does a lot more due diligence (as then damn well should have been doing all along!) which basically results in many small rules changing every week. Well, absolutely your financial guy should be on top of every nuance of it. That’s his job. However in this case, since I earned my income though contracting, I had to prove a years worth of uninterrupted employment instead of a standard six months, for you average permanent employee.

    Make no mistake, I am happy to abide by any laws / rules that guide this process, but this was something that could have saved a whole lot of people a whole lot of time. In the end, the sellers did not want to risk not selling their house on the hopes of my employment not being terminated (which was never an issue, but how do you really prove that anyway.) I can’t blame them, though sadly, their house is still for sale and I live in a larger house around the corner for the same price. Sometimes gambles don’t pay off, or maybe they just didn’t care.

    It was tough getting that far invested into a house and then have it unravel. It all worked out for the best and my financial guy did in fact come through come close time, which I really appreciated and totally helped out at the exact second I needed it to!

    The second house, the one in I did in fact buy, really felt like home the second I walked into it, and the seller was great and easy to work with. I like to think I was a good buyer as well. After negotiating the price that is Winking smile

    It’s just almost a surreal feeling to sit in my basement in front of my computer and bang out a post in my own home. I honestly thought I would never buy one. It’s amazing how much life changes, and how good it can turn out being despite hard-times, penny-pinching, and life’s not-so-little obstacles.

    Overall, the whole experience is a must have. +1

    Windows 8 Preview Task Manager Screen Shots

    Well this is more of a bag of screen-shots than a blog post, but check this out. Now this is one nice taskman!

    The default opening tab is “Processes” and the CPU, Memory, Disk, and Network throb a darker yellow then there is notable activity

    Taskman - Processes

    Then the “Performance” tab which has sub views for CPU, Memory, Disk, and Networking

    Taskman - Performance - CPU

    Taskman - Performance - RAM

    Taskman - Performance - Disk

    Taskman - Performance - Network

    The “App History” tab follows and shows you how your applications are using your machine’s resources

    Taskman - App History

    The “Startup” tab details the applications that automatically run at startup and tries to assess the impact on start-up (which I assume to mean startup time during a boot or log-in)

    Taskman - Startup

    The “Users” tab breaks down the currently logged in users and the processes they have spun up and their resource usage.

    Taskman -Users

    The “Details” tab is the Old School Task Manager’s “Process” view

    Taskman - Details

    And finally the “Services” tab which details your currently running services

    Taskman - Services

    And while we are at it, here is a screen shot of the Windows 8 Preview’s “File Copy” dialog

     [Update: 11/16/2010]

    I just stumbled on a Task Tray icon that indicated my Location has been accessed. Apparently that ends up in the Event Viewer with Windows8, not terribly fancy but handy. All of the ones in the screen shots below are from Desktop Gadgets, I’m not sure which one which I find disappointing, but maybe I’m missing an easy way to correlate them.

    And here are a few of the event viewer. “Sensitive” data has been erased, but it is there if you were doing this yourself.

    If This Then That [ IFTTT.com ] – A MUST try!

    I’ve been hearing about ifttt for a few weeks now so I thought I would pop on by to check it out. To say it is freakin’ amazing is grossly understating the matter.

    In a nut shell, the site allows you to pick events supported by various web applications (the This portion of IFTTT) and push information from said event to other various web applications (the That component).

    For example, If I post a new blog entry here Then tweet the URL and title of the blog post to my twitter account. If you saw this post on twitter, that is in fact how it got there, it was my first test of the IFTTT.

    It supports many web applications such as Twitter, Facebook, WordPress, RSS feeds, LastFM, Craigslist, SMS messaging, the list goes on an on (No Google+ yet, but I assume it is because the API has not been formally released yet). It’s like playing with legos and you can build exactly what you need.

    So far, the best treatment of how it works and examples I’ve seen has been from Microsoft’s Scott Hanselman, his blog post on the matter is terrific: Scott’s IFTTT post

    I strongly urge you to investigate ifttt.com!