Interview Techniques

Interview Techniques… you are probably wondering what that has to do with technology.  This is partly to do with technology, partly a way for me to remember these, and partly, well, a ramble as usual.  I have been exposed to some simple interview techniques for “software engineering” positions and they are worth remembering.  These have come in a variety of difficulties, so I will attempt to organize them as such.

First, technology!  See Mike Code, is cool.  It is a way an interviewer can ask simple questions over the phone and see the person write the code.  That gets a darn cool in my book.  Perhaps it is as modern as VHS is these days, but who says a technology needs to be on the order of Star Trek to warrant recognition?

Also, I recently found this:  http://formatmysourcecode.blogspot.com/.  It is excellent for automatically formatting HTML/XML and code for posting in a blog.

Beyond the technology is the questions I have either been asked or found in my own prowling around.  These are thing ones I find to be the most interesting.

Practical Questions:

  • fizz-buzz, written in any language — basically, for some multiplier of a loop print “fizz”, for a different multiplier write “buzz”.  For a multiplier equal to one divisible by A and B, write “fizzbuzz”.
  • given two lists (e.g., friends lists), and assuming list-2 represents changes affected upon list-1, who was added, who was removed, who is the same.  Written in any language.
  • Extend a standard Java class (e.g., HashMap) such that it meets new constraints such as, and using HashMap as an example:
    • limit the number of values that can be stored popping off the oldest when a newer one is inserted
    • disallow overwriting an existing key; key/value must be removed first
    • lock the list if three unsuccessful attempts are made to retrieve a value
    • lock the list if three unsuccessful attempts are make to insert a value (e.g., inserting an existing key)
  • web application to retrieve basic statistics from somewhere like flickr, using web app technology of choice

Conceptual Questions:

  • What information should a bug tracking system have?  How should it be stored?
  • What project did you make the most difference on?  What did you learn?  What would you do differently?
  • Create an interface from a legacy system to a newer UI.  Assume an API or web service exists.  Describe the architecture you would use; describe high-level design considerations; define milestones.
  • A database has been demonstrating progressively degrading performance (either via an application or reports).  What diagnostic steps would you take?

Mean Questions:

  • I file lists like this as mean because they contain a lot of questions that either a person knows from practical use, or can look up.  To put someone on-the-spot to answer deep details like this in an interview is merely a test in making the interviewee squirm.  To me, these questions are a lot like asking a mechanic about metallurgy — while they use metal in their daily work, but they don’t need to know the minute details about the metals they use to get their job done or do their job well.

Upgrade Windows XP to Window 7 on a SATA drive

I chose to go the route of a Windows 7 Upgrade to save a little money.  I think perhaps the full install would have been worth the money to spare me the aggravation.  I will not try to recount this as an epic horror but instead list the series of steps that made this work.  It is worth noting that the “epic” nature of this event was incurred due to switching to a SATA hard drive.  Windows XP is not terribly friendly with these drives if you are installing anything older than Windows XP SP2.  As I understand it a slipstreamed SP2 installer should work fine, but I have not tested that.

Slipstream SATA Drivers to Windows XP Install Disk

There are blogs and directions out there for how to make this work.  Simply put, this didn’t work for me.  That was kind of annoying, but what I am glad about is that I found something that did work.  But for reference here are a couple of places that talk about this process (here and here).

Setting SATA Controller to IDE in BIOS

This is the process that worked for me.  I will note that I was shocked at first to see less than my full drive, but I was installing WinXP SP1.  There is a known issue with WinXP and SP1 where the drive only shows up with about 131 GB of space.  You can expand the partition post-install.  I started to recall past experiences with this issue when configuring my previous hard drive.

Step 1:  Set SATA controller in BIOS to IDE mode.

Step 2:  Install Windows XP, and don’t worry about the drive size being “wrong”

Step 3:  Install Windows 7 Upgrade … and this is where I resized the Windows partition (I halved the disk out of habit).

Step 4:  Set the AHCI parameter in the windows registry.  This was a problem under WinXP that required a lot of dancing around to make it work.  Being a bit of a Linux fan, I have to say that seeing this work so nicely under Win7 impressed me.  The “worst” part about this was the required reboot; and if that’s the worst, then I’m pretty happy.

Step 5:  Reboot and let drivers install

Step 6:  Be happy that Windows 7 installed!  Success is success.

Other Hurdles I Cleared

Sound Blaster Audigy (yes, Audigy) sound card with digital speakers:  Because I’m too cheap to get a new sound card in addition to all this, I had to download drivers, download updates to drivers, and fiddle around with settings to get my digital out to work.  But it works!  The unfortunate thing is that the toggle for the digital out is well hidden — which means switching to my headphones is going to be a process each time I was to do it.

nVidia GTX 460 SE drivers:  The only “hurdle” here is EVGA being unclear on the box that their card is an “SE” not a standard 460.  But, hey, the drivers installed and it works.  What is there to complain about?

Reconnecting my Linux drives:  Because I don’t entirely trust OS installers (any of them), I disconnected my Linux drives.  I had to make sure my SATA controller setting was set properly for them to work.  Once it was set back to AHCI, as apposed to “Standard IDE” or “RAID”, reconnecting the drives resulted in things starting up nicely into Linux.  All hail boot order in the BIOS!  So handy.

Reconfiguring GRUB:  I still use GRUB (not grub2) and setting up new entries is a simple matter of editing the /boot/grub/menu.lst.  And, viola, back to dual-boot.  Of course, there’s a little trial-and-error to figure out the proper drive reference for GRUB.  I was lucky and it was only a matter of uncommenting my Windows XP entry and renaming it — the basic drive reference had remained the same.

No Primary IDE Master:  This was resolved automatically by having my Linux drive connected to SATA-1 again.  I put my Linux drive on that and since I disconnected it for the install, this gave the BIOS something to complain about.  I really like “problems” that resolve themselves…!

And there you have my little journey.


Eclipse Project Natures

I recently made the horrible, horrible mistake of adding JavaScript support to my eclipse project.  After a bit of searching around I found absolutely no help on how to reverse this.  The answers I found basically said that once a kind of support/nature is added to a project, you are just up the creek.  Reversing it is nigh on impossible.

Not so!  Rejoice!

Here is my project file that gave me so much trouble:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
  <name>blah blah blah</name>
  <comment></comment>
  <projects>
  </projects>
  <buildSpec>
    <buildCommand>
      <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
      <arguments>
      </arguments>
    </buildCommand>
    <buildCommand>
      <name>org.eclipse.jdt.core.javabuilder</name>
      <arguments>
      </arguments>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
  </natures>
</projectDescription>

Okay, kids. Can you take a SWAG at what to remove?  Yeah, I thought so.  You are now one up on official responses from the Eclipse project.

I removed the obvious buildCommand element-block (…javascriptValidator) as well as the jsNature nature element.  A rebuild of my project no longer brought eclipse to its knees.

On another note, a super cool thing is that when I created this project, it did not have Groovy support.  Guess what I did to add that.  Of course, this isn’t official, and certainly not supported.  But it worked because I have the necessary plug-ins installed.

As a side note, it very well may be the case that there is detritus left behind.  Simply removing these elements may not completely clean up what “Right-Click-on-project | Configure | Convert to JavaScript Project…” may have added for files.  However it turned off eclipse from doing a lot of extra parsing and compiling that caused garbage collection and loop errors.  (Yep, I tried fixing those errors first, but it seems that with the volume of js files I have that eclipse just cannot handle that.)


Groovy, Grails, and Gradle. Oh My!

My long silence has largely been due to unemployment followed by starting a new job. I have a draft post waiting in the wings regarding some technology I observed during the interview process. Things certainly have changed since the last time I interviewed for jobs, and not just since I interviewed for my first technical job.

I am going to abstain from mentioning my company, but I can talk about some of the technology pretty freely. I have moved from working with EMC|Documentum products to working with eCommerce tools. It is still content management in some ways, but I am now more focused on making a product work as apposed to installations and integrations. In doing this, I am also working with Groovy, Grails, and Gradle. They are pretty neat technologies which I sorely underestimated. I should have started using these in my last job!

Groovy: It is Java with many additions. It isn’t some poor little scripting language, but definitely takes Java programming to a new level. You simplify a lot of what you are doing, add the power of closures, and do away with specific declarations when you don’t really care what the object is that you are working with. That is pretty nice. I’ve decompiled some of the classes created with “groovyc” and it is crazy what happens to permit the many assumptions to be made about what a class might do. This doesn’t result in compact byte-code, but it makes coding a lot easier!

Grails: Maybe this could have been used. It is a bit light weight for a full-blown web server, but for a development environment it is pretty cool. The integration of unit, integration, and functional tests is darn nice. It helps to promote a test-driven development model.

Gradle: This really blows my mind. It takes ANT to a whole new level where you can do Groovy coding in your build script to improve the build process. Let’s say you have some modules you need to build in one order, and then clean up in a reverse order. That is a nuisance with ANT, but with Gradle you can declare an array and then iterate over it in the appropriate direction in the appropriate target. Very nice!

So, yeah. My technology juices are flowing again. Hooray!


Steps in the KDE development direction

I embarked on a simple investigation today:  get kdevelop setup on one of my machines so I could start learning how to develop under KDE.  The first lesson was to get my environment right (Kubuntu 64-bit 10.04):

525  export KDEDIR=/usr
527  export KDEDIRS=/usr
535  export LD_LIBRARY_PATH=/usr/lib/kde4:/usr/lib/qt4:$LD_LIBRARY_LIB
537  export LD_LIBRARY_PATH=/usr/lib/kde4:/usr/lib/qt4:/usr/include/KDE:$LD_LIBRARY_LIB
539  export KDE4_INCLUDES=/usr/include/KDE

Then came the actual coding which, once the above was done, was quite easy.  I followed the tutorial here and modified it slightly to add a custom “No” button.  Simple small step, but progress nonetheless!


Welcome to Kubuntu 10.04 LTS

Today I finally upgraded my primary system to Kubuntu 10.04 LTS 64-bit.  I have performed two upgrades to 32-bit machines with no problems.  I waited this long to upgrade this system to see how the few weeks following the release panned out.  There have been hiccups sometimes, and I am more tolerant of those on secondary systems.

Flawless.  Smooth.  Painless.

My dual-boot configuration was unaffected, but that is a result of grub still being present as apposed to grub2.  With the rumors I have heard about the nuisance in editing the grub2 menu list, I’ll stick with the tried and true for now.

To use a favorite phrase:  The Way Life Should Be.


Facebook – what are our options?

I hope I look back on this post some day with a bit of a chuckle.  I want to chuckle at the fact that once upon a time privacy issues in social networking were a problem… and service providers recognized that problem, arguably an ethical problem, fixed the problems and let us move on with using such an amazing tool to stay in touch with people literally all over the world.  I want to move onto something that permits me to stay in touch with people without invading my privacy, and selling my information like a commodity.

I hope to look at that last sentence later and say to myself, and I found it.

So what are our options?

We can join a competing service.  We can blog.  We can dent or tweet.  We can email (in the tradition of newsletters).  We can return to live communication.  But each step of that removes features that have become useful and familiar — our network, visibility control such as it is, robust messages with pictures and video, easily finding friends-of-friends, or being able to stay in touch with people no matter where they are.

So what does this have to do with technology?

I firmly hold the opinion that technology, and the use of technology, is not absent of the need for ethical behavior.  Science is not without ethics, and technology is a result of science.  Science for the sake of science is wrong.  Doing something just because you can do it doesn’t mean it is right.  So the increasing seemingly unethical behavior of Facebook makes me look at other options, some of which I already know the trade-offs.  I have done my part to request they behave in a way I believe is more ethical, but with 400 million users, I’m not doing to do the math to figure out how small my voice is.

Micro-blogging by denting, tweeting, or similar is like having a conversation in a huge crowd.  Anything you say can be overheard.  Anything you share can be overheard.  Ultimately, I have no problems with this because these services are forthright in the way their service works.  There is no privacy except for basic account information like your password.  Anything else you share at will.

Blogging is almost the same way, though offering hosted of personal installations.  It is more like controlling the area of the crowd you stand in, but there is still practically no privacy outside of controlling whether or not a story is published; though some services offer “private” blog entries.  Again, not a problem because that is a known factor entering into the usage of such a mechanism.

Competing services have a wide range of options, though not all are like Facebook (e.g., Last.fm is a music site — I wouldn’t personally consider that a social networking site).  I am going to wager that some are responding in an opposite direction to Facebook to present a “more privacy minded alternative”.  Where Google typically seems interested in mining information, they have increased privacy controls in Orkut.  Outstanding.  Then there is Livejournal (which I used to use) which has a very well developed sense of public, friends, private, and certain-friends-only (lists).  But, of course, the issue with a competing service is the loss of your existing network — and can you convince everyone you want to stay in touch with to move over.

That is Facebook’s element of holding the users as a kind of voluntary hostage.  It was so easy to build a network of friends — and everyone seemed to jump on board (400 million users).  Now the question becomes focused on how much sharing of private information people will tolerate before they start abandoning Facebook at the loss of their easily built social network.


Learning Drupal

I am working on entering into the second decade of the 21st century and I am learning Drupal.  I have a local LAMP stack going, and kind of cheated and installed the packages from Ubuntu.  However, that wasn’t completely without challenges.  I even managed to make a contribution to the wiki to help out others.

I know very little about PHP, but it seems like that isn’t a great solution.  But… it worked.  And now I am able to kludge my way through Drupal.

On the surface, it seems relatively easy:  modules, blocks, primary and secondary links, themes, content, and other superficial things.

Then there are the nuances of permissions, how to make blocks visible to logged in users or anonymous users, and perhaps even fiddling with the theme a bit to get the layout to play nicely.

Ultimately, there is the step of diving into PHP and making new modules.  But that I think I’ll save for another week.  My goal at this point is to assemble my website with something, and in a way, that shows I can spell WCM, understand how websites are put together outside of vim/emacs, and can perhaps demonstrate a little of my developer skills simply through good design.

My next hurdle will be to work with my ISP to get Drupal working there.  I tried their canned installer and some special PHP file just for them (literally $_isp_providers_name.php) didn’t appear out of the can.  So, out comes the figurative fork, and in I went after the beans at the bottom… albeit in the form of contacting customer support with a polite “Hey?!  What gives?”

My feet are barely wet.  Drupal is pretty interesting.  My keener interest is how can I tie it into other things.  Can I tie it into DFS and make a folder listing module?  What about an Inbox module?  Would this be a viable light-weight interface?  Potential fun could ensue… be warned.


DFC Lifecycle Promotion Failure at End of Lifecycle

Finding issues like the following is one of the amusing things about navigating APIs.  In DFC 6.5SP1 IDfSysObject.canPromote() will return true for an object that is at the end of it’s lifecycle.

Wait.  That isn’t right!  Yet, that is what happens.

It appears to get DfPolicy.canPromot() to do the real task.  There’s clearly a bug in how that computes the subsequent state and identifies a terminal state.

But there is a workaround:  IDfSysObject.getNextStateName().  The following test proved to work in all of the situations I needed it to, including not attempting to promote a object already at the end of its lifecycle:

if (!sysObj.canPromote() ||
     sysObj.getNextStateName() == null) {
   ... yell about not being able to promote
}

And that’s that.


Synergy Plus

I feel very behind the times.  One of my favorite tools has not been maintained for years.  BUT, there is a fork of it that is maintained:  http://code.google.com/p/synergy-plus/

Even with a KVM, this additional tool is great.  I have a dual-monitor setup where one monitor is on a KVM.  The second monitor on my desktop system and my laptop screen are dedicated to those systems.  With the KVM I can make either desktop bigger, but since I spend most of my time with my laptop (for work), Synergy+ lets me quickly drift over to my desktop and deal with anything displaying on the secondary screen (IRC, music, etc.).


Follow

Get every new post delivered to your Inbox.