TechnicalArchitectureWorx

The (Unofficial) ITWorx Technical Architecture Blog

Archive for the ‘Interview Question’ Category

Interview Completeness

Posted by archworx on August 18, 2008

I often find myself in a situation where I am interviewing someone, and I am starting to be impressed, when all of a sudden, I decide to ask one more question, jut for the heck of it – and suddenly I realize that I have uncovered a major gap in this person’s profile. Which brings me to the question – what do you think makes the complete interview? Both in terms of categories and what those categories may include in terms of questions. Off the top of my head I can think of the following main categories:

* Technical Competence

* Depth of Experience

* Gauging Passion

* Compatibility Company Values

Let us know your thoughts, too.

Advertisements

Posted in Interview Question, mkaram, Rant | 4 Comments »

Interview Question: Is a String of Parenthesis Balanced?

Posted by archworx on May 17, 2007

Here’s an easy one:

Given a string that contains only parenthesis like “(” “[” “)” “]”

We call a string balanced if every opening parenthesis has its corresponding closing parenthesis (and vice versa) , but they have to be in closed in correct order i.e. if you open a nested parenthesis inside another the nested one should be closed before the outer one is closed.

So an example of a balanced string would be “([[(())]])”

Examples of unbalanced strings would be “]([()])[” and “[[[((]))]]”

Can you write a function that takes a string (or characher array) as a parameter and returns true if it is balanced and false if it is not.

Waiting for your answers

Posted in AFathalla, Interview Question | 5 Comments »

Considerations for Securing Log-in?

Posted by archworx on April 18, 2007

Someone was asking us about what factors to consider in order to develop a “secure” log-in component. Off the top of my head, I could think of the following rules of thumb that you should honour, assuming 1-factor security:

1. You really should communicate over SSL

2. You should also never transfer any credentials in the query string (neither username, nor password, nor any token of any sort)

3. Also, make sure that the password is never stored in plain text in your data repositories – you must always store its hash generated using a one-way hashing function. Being one way means that you can never go back the other way and retrieve the plain text password from the hash.

This means that you can never retrieve the password from the hash, so in order to verify it, you must take the newly provided password and hash that too, then compare both hashes to verify if they are identical. You can never do the comparison based on the plain-text of the password itself.

This is important because it illimates the risk that the admin will be able to find out what the plain-text password is by reversing the encryption function. From an algorithmic perspective, it is not acceptable to just “rely on the trustworthiness of the administrator” 🙂

4. At the same time, it is recommended that you use a “salt” to encrypt the password, or some other strong form of encryption.

I’m sure there may be others, but I can’t think of any more now – What else should we look for? 

Posted in Interview Question, mkaram, Programming, Security | 3 Comments »

Interviewing Question: Inserting into a Sorted Linked List

Posted by archworx on February 25, 2007

Due to the popularity of our Interviewing Question posts, we’ve decided to add yet another question. This time its easy and straight forward. You have a singly linked list of integers that are ordered ascendingly (for example -2,1,4,6,7). Can you devise an algorithm by which you insert a node into the linked list while maintaining its order. For example if you want to add a node containing the integer ‘5’ the linked list in the previous example will become (-2,1,4,5,6,7). Can you write the algorithm in C++ ?

Posted in AFathalla, Interview Question | 14 Comments »

Interviewing Question: The Eggs and the Tower

Posted by archworx on February 19, 2007

Think of this, you have a building which is 100 floors high and you have 3 eggs. You can throw an egg from any floor and it might or might not break, but there is a certain floor (a threshold floor) afterwhich eggs are guranteed to break for all floors above this certain floor.  If We want to know exactly which floor is the threshold floor, what is the minimum number of egg throws do we have do make?

Remember: You have only 3 eggs,  so if you break all the 3 eggs without finding the threshold floor then you have failed. Also remember that we want the minimum number of throws.

Posted in AFathalla, Interview Question | 28 Comments »

Personal Capability Maturity

Posted by archworx on February 11, 2007

So I’ve been thinking about classifying candidates for interviews, or even team mates and colleagues at work according to their capability, for some time.

Disclaimer: Before you go on – please note this isn’t to establish workplace supremacy, but instead to enhance communication between team members!

Sometimes you’re sitting there talking to someone who seems to be spewing out jargon without really understanding what the underlying implications are. Other times you can discuss a topic with someone and find out that they’re trying to convince you of a solution that is so advanced you can’t readily grasp it!

So I’ve come up with the following theoretical model to classify people according to their vocational performance. I think this kind of classification is very important for each and every one of us. This isn’t so we can gain fake karma points or establish supremacy of any sort; but instead to know where one stands and what challenges you need to overcome in order to advance your career. This goes back to the post about reverse-engineering success, if you still remember that.

It is also important that you consider this model in terms of how to deal with co-workers. The most important aspect of industrial development is team work. A team can never work with dysfunctional communication, so you need to use this measure all the time in order to use the right tools to communicate with different calibres within your team. If you don’t immediately identify your team-mates specific capability at the start of a conversation you risk wasting the time the rest of it is about to take.

Back to the theoretical model I was talking about earlier, let me take you through its different levels, and we’ll be getting back to this every now and then as we work with answers to interview questions, and find out where the proper balance between pragmatism and ingenuity is achieved.

Here is the model – keep this in the back of your head the next time you work on a technical puzzle; I will call this the “Mkaram Intellectual Capability Model”, blatantly stealing prevalent industrial nomenclature (thank you CMU/SEI/DoD):

  • Level 0 – This is when you are totally stumped, you have no clue, and you can’t even start to address the question
  • Level 1 – Someone asks you a question and you start babbling for a few seconds, being mostly incoherent for some time until finally starting to mildly approach the problem with a mediocre solution that may be buggy or stands a marginal chance of working
  • Level 2 – You are asked a question, which may or may not take you a minute to think of, but you end up giving a perfectly functional framework for a solution that will work, and will do so elegantly
  • Level 3 – You give the question a moment of thought, and either leverage powerful solution patterns that you know inside out by virtue of how well you’ve worked with and thought of them previously, or challenge yourself to come up with clever shortcuts (because you know innately that they almost always exist for every problem). In either case your end solution is not only perfectly functional, but also covers new ground in terms of efficiency, elegance or otherwise.

If you combine this theoretical model with the 80/20 rule, that only 20% of your work is where 80% of the most critical application time is executed, then you should work as hard as possible to make sure your baseline never goes below Level 2 (or change your industry), and in fact, continuously push yourself towards Level 3.

As an extension to the disclaimer above, note that these levels are dynamic and relative, instead of absolute. Your own personal level can vary greatly according to how well you know your turf!

Posted in Interview Question, mkaram, Programming, Rant | Leave a Comment »

Interviewing Question: How can I randomize without recurrence?

Posted by archworx on February 6, 2007

Suppose I have an application that plays the audio files on my play list, and supports playing them in a random order. More often than not, this kind of application will employ a Psuedo-Random Number Generator. Which is great, except that these kinds of generation algorithms tend to be not exactly random sometimes. This becomes a problem when the algorithms are so bad that starvation occurs. With starvation you get some tracks that are played over and over again, and others which are almost never played. One way to fix this is by further warping the “randomness” of the Psuedo-Random sequence to try to make sure that every track is played once and only once before it is ever replayed.

How would you implement this in code, as a first hack?

How would you implement this efficiently?

Posted in Interview Question, mkaram, Programming | 6 Comments »