Monday, December 6, 2010

Interview Preparation Links

I have compiled a list of interview books to read for preparing for software engineering interviews. This is mostly a list for someone who is interested in learning or revisiting concepts in algorithms and data structure. A few links deal with design the others are just helpful for preliminary phone interviews:

1. http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index Topcoder Tutorials on Algorithms - Some algos are really tough in this list, but this is still a fun list to read and practice a few questions. You can always create a tc account and do some of the questions in competitions.
2. http://www.parashift.com/c++-faq-lite/index.html C++ FAQ - A must read and follow guide for C++ interviews, I suggest to read this and understand why such design practices are followed.
3. http://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions - Must read guide to clear phone screens
4. Programming Interviews Exposed - Read to get a decent idea of general thinking pattern required in an interview.
5. Professional C++ or C++ How to Program (Dietel and Dietel)- or any other C++ book to help clarify some basic concepts in C++.
6. http://people.csail.mit.edu/bdean/6.046/dp/ Dynamic Programming tutorials. DP is a must have for programming interviews. This link only works in firefox.
7. Effective Java - Essentially a Java book but most of this stuff is also applicable for C++.
8. If giving interviews for google, amazon or MS - Bing or another company which works on cloud ccomputing, make sure you read the papers that they have published on cloud computin.
9. How would you move mount Fuji - Not sure how useful is this book is nowadays, was useful for MS SDET interviews sometime back :) . It also has some nice puzzles.
10. Heard on the Street: Quantitative Questions from Wall Street Job Interviews - This book also has a bunch of good puzzles if at all you are interested in.

In the end writing a lot of code and following good design practices helps.

Sunday, May 2, 2010

Meditating Autorevs

While watching Ergo Proxy, a depressing cyberpunk set on a desolate earth, I saw meditating autorevs. An autorev, in ergo proxy universe, is just an android with no true "soul". However they get infected by a certain "cogito virus" and acquire a "soul". A "soul" is just a matter of self awareness, acquiring one makes them question everything from their purpose as an entourage, to their behaviour as a companion. While all of this might seem obvious; what struck me was given a life times experience, knowledge and a processing power of a million circuits, what would a being trying to discover itself do ? As in the anime, Eegi finds itself meditating and brooding over its own life as do a lot more of the androids. Well we have meditating androids essentially. Like meditating humans. What would normally an unexpected behavior for a machine, suddenly becomes acceptable both intuitively and intellectually. So consider this, what if we build a machine not essentially "self aware" per say, but capable of analyzing the history and the knowledge of at least an entire lifetime ? Would this give us the answer to universe, life and everything ? Well probably not !!
But it sure sounds interesting on what would it achieve on years of computation time spent on brooding. However, to answer the question we must formulate the question first. The formulation of the question is essentially expressing the process of meditation in terms of mathematical equations !! We probably know all the hows, but we need to know all the whys. Sure this will make another blog post sometime :)

Friday, April 16, 2010

Simulating Social Behaviour

For a long time I have been thinking of simulating life like creations. A-life seems to be an upcoming topic in Computer Science and elsewhere. I admit I havent read about it much. I have read a little bit about complex systems though. After attending a lot of CS courses and doing projects on AI/ ML and random processes as well as optimization (as part of EE ), I have developed a basic understanding that all AI / ML problems are essentially optimization problems. Each one a unique and a unique way to solve each. Quite Interesting.

What is more interesting is when we see our own life and try to see it in the aspect of an optimization problem. However our own life is not standalone but is influenced by that of others and is (figuratively) a sum total of all the states that are influencing our own state.

Now this is getting a bit vague.

To put it straight forward way I want to design a simulation of artificial life. Where I can spawn a number of individual entities and assign a separate optimization problem to each. Where the goal of each individual entity is to optimize its own problem. Now the deciding factor can be either CPU time, where entities compete for CPU time. But I guess this has already been tried. I think I want to relate them by their optimization functions not just to the environment but by each other also.

Obviously I need to formulate the optimization problem first and than hope that it can actually be solved :).
chow for now !

Saturday, April 18, 2009

A Genius' Dilemna

Suppose you are a genius. You are good at everything you do. You are good at biology, physics, chemistry and math, even arts, essay writing and all that. What do you do ? What is your destiny ? How do you choose ?
Theoretically you are good at everything and given sufficient time and space you can be good at anything. So what do you do that satisfies you the most, given that your satisfaction is directly related to your professional success ?

Now assume you have a constructed a set of AI entities and ask them to gather information by crawling all data on the web. Will they not display similar characteristics as above. They will be equally inclined to dig all sort of information. Is it not for a system to survive ? or is it simply impossible to achieve ?

Going to the first argument if it is equally satisfying to do any particular thing, why not just choose any particular track and stick to it. But the next question is does life has a meaning in such a situation ? Again to the second argument, does an AI entity such as above will infer a meaning to its life if tasked with the above problem ? Can the AI be self aware than ?

What does an AI have to do in order to be self aware ? What logic circuit, what algorithm will give it so much power ? Lets say such an AI as above is crawling the web it comes across this post makes an inference of this one by comparing it with similar systems using a certain classification algorithm. It realizes that such a classification puts the system described here i.e. a self unaware AI that is capable of understanding every subject matter in this world, in its own category. In other words it finds that the system describes itself. Now it goes on and sees that it is self unaware as described above ... so what ? It is just a property of the system, it will add it to its several known properties and simply move on.

The point is knowing that if you are aware that you are unaware of your own purpose does not make your life purposeful. So such an AI cannot become self aware and cause Armageddon. In essence it needs some additional logic.

So what question do I pose to a genius (read AI) that it will help solve the dilemma of his/her/its life ?

Sunday, September 9, 2007

Startup Fever: Which language ?

I have never had my startup ... not at 22 , not many people except a few of my batch mates, have a startup at this age. Kudos to them and many more like them who do not want to be a peg in the corporate machinery but rather wont be different in their own way.

But some experience come in me in the form if co-ordinating for IMG in my college days. As a brief introduction IMG is Information Management Group which is responsible for management of a significant portion of IT resources of the institute. IMG is a student body , consisting roughly of around 40 students mostly taken through an elaborate process of interviews and tests and some others handpicked by giving them small intern projects.

There is in all a lot to reflect from the experiences of managing in a 40 member technical team, most of which can be (i guess) directly applied towards making a startup. I always wanted to cover this stuff here but due to a complete lack of blogging impulses it has always remained in me for almost more than an year now.

Lets not digress further and reach to the point straight away. To any new person starting to write a few bits of code (for oneself) the first question that comes is what language to write. Whenever I write code or asked people to write code for a project. I ask a few questions

Which language am I comfortable with ? Which language is the team comfortable with ? What is the size of code you want to write ? For how many users you want to write it ? What are your coding skills ? (More important) In what language you are most comfortable with debugging ? Most people are not very good code writers, but they need to know debugging pretty well, if you cant debug very well, you are bound to exceed time lines and screw up on big projects.

A good decision is always a mix of gut feeling, logic and a penchant for doing new stuff. If your gut says Java is good, a general survey tells you that people love it and you have a thing for trying out the "new framework" out there.

The problem: "Every language on this goddamn earth sucks to the core if you dont know how to ''exploit it''. " Let us say Java, I coded in java extensively, if you dont know wtf you want to do with it, the thousand s of techniques out there are sure to drive you crazy.

Here is how I decided what to do for a major project. I "knew" java sucks if u cant use it properly, key ?? the key is to understand the problem at hand and come with a design first. My problem had key features:
1. Scalability, the app was to be used by 1000s of users.
2. Familiarity for my team, everyone knew java well.
3. Maintainability for the group, can t use ASP .NET coz nobody is really interested in learning that. Everyone loves java for some strange unknown reason.
4. My penchant for the newly learned Java EE 5 and JDK 5 features !!! My personal choice goverened a few things incidently ;).
5. An elaborate mix of potentially screwing problems that a framework will take loads of code to write and a bad experience with existing frameworks.


Never write code first and than design later !!! unless you want to throw that code write out of the window or are cool with being bankrupt.

We decided to do a high level prototype of all the challenges that we could have faced and than scrapped all that code , just took a month of our time. Than redesigned the application from scratch, included all the features we wanted to and wrote all the code from scratch (no framework BS) and ran it, believe me it rocks !!

Due to our apparent lack of experience we screwed a bit at some places, but hey as far as it runs, it runs fast, is secure and damn easy to maintain ... it suffices all the requirements of a good s/w project ?? (yes it is scalable across layers and compatible across platforms, is standard compliant, has visible design patterns and blah blah blah ).

In conclusion ... the above fundas worked for me, hope they work for you :)

Friday, May 4, 2007

The "No Faith" approach to security

I dont know whether this is a known method or not but I found this approach quite good enough especially for a person like me who has no way to know everything that goes in and out of an (or any) application. The "No Faith" approach assumes that whatever class you are coding will have some malicious code executing it. You can say that you need to check everytime whether the parameters passed to you and the methods called are called by say the correct users, with the correct privileges and they have passed the correct parameters. It is also important to see, if at all you are using an API or your own code, what are the assumptions that are made in the class that you are calling. Sometimes say when you are writing C code the class may be expecting a character array of a particular length and you may be supplying a longer array or it is not null terminated. Or when you write Java (EE app) than you are not explicitly checking whther the user calling the function has the correct rights or not. Or say you are allocating a resource or using a name which already is used by somebody else or is prone to use by any other program.

So the best idea is to not have any assumptions on how things might work. A good example that came to us when coding alumni. There we check for user privileges when someone delets his own message. First it is checked on the page itself so you dont have an option. If you can somehow access that page (God knows how you can do that !!) and again you somewhow execute that call on the JSP (again I wonder how). There will be another check from the session itself that is difficult to surpass (I cant think of any way that anybody can).

The basic idea is dont trust the layers above you, they may have gotten dirty themselves, just keep a check.

I call it "No Faith" approach to security , you may call it whatever you like.

Wednesday, April 11, 2007

Imperfection: The last law of design

I do not intend to start a debate but i believe that imperfection is the key to a great system design. I believe that inherently the universe was left imperfect by creation ( ?? ). I think perfection is too dificult to achieve even by God (no debates on athiesm or creationsim intended ). So instead he decided to make everything imperfect and in that imperfection lies the beauty of making everything work the way it should.

I think the uncertainity principle, godel's theorem and probability are all a symbol of leaving away the details. Because in any system the minutest details cannot be stated to the infinite degree. So God or who knows the universe itself decided on its own that let us give no details below the planck distance. Or maybe it is too computationally tedious to describe the movement of each of a 100 billion gas atoms so just make it chaotic.

So the last rule of design is to make things imperfect because that is where the fun starts. Let us say we want to make a website, fully upgradeable and to the minutest details , we make it perfect. Well we have achieved everything !! Its perfect ! Now what ? Nothing else left to do , nothing to add or remove , because it is perfect. But is it possible ? It is not possible as we all know and should understand its impossible to percieve the future, only speculation is under the power of humans (or who knows even God). Perfection can only be restricted to a small domain. It can never be universal. But imperfection is universal and it works !! Some might say its not imperfection I talk about, it is just ignorance. Since I dont know so I say it is imperfect... I will just say it is impossible to make something perfect and so it is throughout.

What is possible is to make an imperfect system but to make it self improving (remember the matrix with the anomaly !). the anomalies sweep the imperfection, cause the chaos and ultimately benefits the system by making it change.

Well I gues the post is incomplete with me looking for more reasons to write more on this...