Wednesday, October 15, 2014

Morris Magic

While preparing for tech companies, I have had a lot much insights into the computer science and boy, aint I get bamboozled!! Already I find trees and graphs one of the challenging area, given that I need to think about these problems both from iterative and recursive ways to solve problems just in case interviewer asks me....

Recently I came across a question that asked for NO recursion, NO stack usage to visit the tree INLINE! I was stumped. It was the I tried drawing 2 pages and gave up on algo. It was pretty cool solution at the end as I figured from the solution. Mr Morris came up with the idea of changing the whole tree pointers while traversing one node after the other. Then visit and then change the pointers back as though nothing had happened.

Implementation in Java:

public void inLineMorrisIterative(BTreeNode node) {
if (node == null)
return;

while (node != null) {
// Go to the far left of this node
if (node.left == null) {
// Visit this node
visit(node);
// Go right
node = node.right;
} else {
// There is a left subtree
BTreeNode tmp = node.left;
// Get hold of the right most until it reaches extreme right or
// pick up its child which is also its parent
while (tmp.right != null && tmp.right != node) {
tmp = tmp.right;
}
if (tmp.right == null) {// If rightmost
tmp.right = node; // link it to the node.
node = node.left; // Get the node to the root of the left
// subtree
} else { // We get to the parent of tmp
// Visit the node then
visit(node);
// Break the temporary link
tmp.right = null;
// Move right
node = node.right;
}
}
}
}

Saturday, August 16, 2014

"SOA Developer" - Really?

I have been looking at some of the developer related job ads and many a time I come across a job with title "SOA Developer". I cannot understand this really. Within the description it specifies a particular tool/technologies such as Oracle SOA Suite.

As I understand, SOA is an architecture not a language or framework or anything much technical. If the employer mean "SOA architect" by the title "SOA developer", I do not have problem with that because architecture in SOA should be "developed" by an architect.

So whats the real position should sound like. May be "Service developer" but that will be too abstract. So, it boils down to "orthodox" - BPEL developer or Java developer. I guess, because of so much hype about SOA, it has turned into business of selling product in the name of "architecture" and nothing is achieved by organization except for pain in terms of money and effort to look for tool specialists, pay hefty licence and build (Mostly un-scalable) infrastructure in order to run the tool.

If there is any title begins with SOA, in my view, the next word should be either "Administrator" or "Architect" just to be clear. Once the architecture is done, then a tool should be selected to implement the services or to wrap the legacy application with service layers. Then and only then there will be a need for a developer/coder to build the service. But most of the time, organization has already invested in one technology, say dot net or Java, so it does not harm to have "Java developer" or ".NET developer" from the inception of a SOA project but the job title should state exactly that and not "SOA developer".

Monday, July 7, 2014

Application Development Trend

Recently I have been trying to venture into some of the popular tools and technologies which I did not have much idea about. After working through the cloud, one thing I figured out is that developers have got independence from any infrastructure and its administrative need. They not only can concentrate on their app development but also learn bits and pieces (Specially basics) on networking and OS. On top of this, given that some offer free tier access, no drama in experimenting on a new piece of software service or even put something in production.

Recently, I started getting my hands dirty on document based NoSQL and it suddenly occurred to me that application developers are now almost free of database development dependencies as well, well ofcourse only if the problem can be solved by non-relational database. So, no headache on schema design then ripple effect from the changes, dependencies on the DB development, etc. There is, nonetheless, administrative work involved.

Here is my conclusion - Application developers really really need to design and develop their application very carefully with -
1. ALL business requirements fulfilled.
2. Non-functional requirements such as improved performance with proper use of algorithm.
3. Scalable applications development with appropriate usage of data structure.

This is a good opportunity for app developer to learn to develop some really good programming habit as these (and many other) tools are providing them with pretty much complete independence.

I am looking forward to getting opinions on this trend for I guess being application developer myself, I may be a little biased.

Welcome to my blogs

The contents here are my independent point of view. They reflect my thoughts, experience in my professional and social life.

Search This Blog