TechnicalArchitectureWorx

The (Unofficial) ITWorx Technical Architecture Blog

Archive for February, 2007

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++ ?

Advertisements

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 »

ITWorx Prayer Times Gadget wins first place in the Microsoft MDC 2007 Gadget Cup!

Posted by archworx on February 11, 2007

Wednesday 7th February 2007, Cairo. The ITWorx Prayer Times Gadget which took part in the Windows Vista Gadget Cup organized as part of the proceedings of the Microsoft Middle East Developers Conference 2007 won first place amongst all participating gadgets.

The Gadget was competing alongside several industry heavyweights. ITWorx won first place with resounding cheers from the crowd!

The Gadget was built upon years of effort and dedication that several individuals in ITWorx had contributed to in order to build the original Prayer Times calculation engine and Outlook plug-in. The Vista Gadget itself was developed by the Technical Architecture Team.

The Gadget’s compelling elegance was due to its modern design devised by Karim Saady & the ingeniously clever features crammed into very compact screen real-estate by Ahmed Fathalla & Youssef Shahin. It featured a second-by-second count down timer to the next prayer; constantly keeping the user alert in an incredibly exciting, visually stunning and time conscious way.

Mahmoud El-Zayet speaking on behalf of Youssef Shahin and other members of the TA Team, addressed the crowd, amidst raucous cheering, saying that ITWorx chose this gadget idea to help Vista users be mindful of prayer times in an increasingly busy schedule and lifestyle that is getting more relentlessly demanding every day. As soon as he finished, the audience went wild with emphatic applause!

The Gadget itself will be made available for public download right here on this blog very soon – so please stay tuned!

Update: If you missed the URL in the comment below – here it is again: http://gallery.live.com/liveItemDetail.aspx?li=83712aef-5008-4bfc-b6f7-aa495828bb44&l=1

Posted in General, mkaram, News | 10 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 »

ASP.NET Black Belt Tips and tricks

Posted by archworx on February 7, 2007

I was fortunate enough to attend this great session in the MDC by the great Patrick Hynds.

Here are some great tips I got:

1. The Page.SetFocus method that is used to set focus on a control. (A cool feature and somehow unknown by many including me 🙂 ).

2. If you want to maintain the scroll position in a page there is the “MaintainScrollPositionOnPostback” property which is here to replace the dreaded “smart navigation” feature in ASP.NET 1.1.

And then there was a really cool part on membership providers, Here are my notes on that:

Membership Providers

 

Why Custom providers?

  • If you need a different schema for the db other than the default schema,
  • If data is in another database MS doesn’t support.(Oracle- Informix).
  • If you need a new feature not implemented in the default provider.

 

Here are a few more ideas:

  • Minimum implementation of Custom provider is Validate User.
  • Location tag in web.config to set zones for anonymous access, others for authenticated users.
  • When inplementing a custom membership provider you will need to implement a custim roles provider as well.

 

Posted in .NET 2.0, MSamy, VS 2005 | 2 Comments »

WCF Episode 2

Posted by archworx on February 7, 2007

I delivered a session on WCF (Windows Communication Foundation) in the Cutting Edge Club quite a while ago, and have been meaning to post about it as part of a series of posts on .NET 3.0 but as we all know, life is not always as we plan it.

So to finally releive my conscience, I decided to attach the presentation here WCF presentation.

I also attached the sample here WCF_Sample. Just download this file and change the extension to .zip and you should be ready to go.

If you have any comments please let me know.

Posted in .NET 3.0, MSamy | Leave a Comment »

Visual Studio Team System first impressions

Posted by archworx on February 7, 2007

I have been studying Visual Studio Team System for a while now and considering how to approach using such a wonderful but very complex product in a company like ITWorx, or any other development company for that matter.

My first impressions of VSTS were through a session given by Ahmed Bahaa in the Cutting Edge club a couple of months ago. Ahmed gave a very compelling overview on VSTS and why it is such an important product.

The main features and ideas in his presentation that have stuck to my head until now are as follows:

1. VSTS’ main goal is to facilitate collaboration between team members in a project team.

2. The ability to customize processes and extend the current workflows in VSTS that are based on Windows Workflow Foundation.

3. The amount of time project teams spend on communication as a significant overhead and how VSTS helps reduce this overhead while still facilitating communication.

4. The idea of the workitem as the building block of all projects in VSTS, and how we should use a work item as a way of tying project documentation and code.

5. The complexity involved in installing VSTS components  and getting them to work together. (This is important because we have to plan the timing we need to start piloting VSTS).

6. The overall architecture of TFS and how to scale the system.

These are just my first impressions. Tune in for more on VSTS when I start the VSTS  Implementation series.

Posted in MSamy, Visual Studio Team System | Leave a Comment »

LINQ: The Technology of the Future

Posted by archworx on February 7, 2007

Yesterday I attended a session on Language Integrated Query (LINQ) at MDC. Simply said it is a new technology introduced with C# 3.0 and VB 9.0 which will be shipped in the next version (Orcas) of Visual Studio. Basically, LINQ allows you to perform queries on objects, databases and XML files from within .NET languages allowing you, for example, to query your database without writing a single line of SQL code. LINQ helps you create an object mapping of your database; converting your database tables into classes which you can query from within the language. This way you can reap the advantages of Intellisense and Type Checking which were never present when you wrote SQL strings from inside the code. Below are screenshots containing the code I wrote to perform a query on the Northwind database that retrieves the customerID of customers who live in London and the results obtained from the query. It is important to mention that prior to performing this query , I used a visual designer (included with LINQ) to drag the database tables on screen, allowing LINQ to convert them into the corresponding objects.

N.B. I am using the May CTP of LINQ.LINQ Code

LINQ ScreenShot

Posted in AFathalla, LINQ | 2 Comments »

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 »