Sunday, May 17, 2015

Getting an IT job in Sri Lanka : An anecdote!

A lot of us who are involved in a field of study in IT, do at some point want to get a job in a renowned IT company in Sri Lanka. I am also one who went through the process of finding a company, applying for it, going through the selection process and finally setting foot as an employee. And there is a lot of things that I did right, and probably equally as many that I did wrong, and learned from. So I'll just post this humble accounts for anyone who may be interested. So this 'meta-post' will be, hopefully, helpful for someone in the same situation at some point.

There are few staples in getting a job in the IT sector. I will try to generalize to anyone who will be looking for employment in IT, regardless of the course they follow, whether it is in Software Engineering, Computer Science, or something of both, and whether they're from a state or private institute, looking for permanent employment or internship etc.

Rule #1 : Know what you want!

A lot of people, I have known, including myself at one point, are looking 'for a place to work'. At the end of the day, this is of course what it boils down to. But it is important to know what you want to do, at least to some extent. For instance, if you say 'I want to be a software engineer, I'll settle for anything in that area', it is the same as saying 'I want to be a sportsman, I'll take any sport that will take me into a team'.

IT has a very broad spectrum, all of which are more or less equally important. There is software development and process management aspects involved, pure and theoretical computer science thingies involved, management, academics, research and development and a whole lot of other things... So it helps to narrow down where you want to go in this.

The next thing is, to narrow down to a specific area. There is networking, there is the web, there is data analytics and there is project management, quality assurance, human computer interaction, mechatronics, hardware stuff etc. At least, have an idea what all of these are to some extent, and obtain the ability to know which is which.

So before you apply to an organization, you must be able to understand which of these interests you, and drives you, and makes you 'want' to work there.

Rule #2 : Research research research!!!

A very popular, and often confusing question, as I have experienced and heard from others, in selection interviews is "so, why do you want to work with us?". To answer this, you must know at least something that the company is doing. Basic things to look for are ;

  1. The products / services delivered by the company 
  2. The technologies they use 
  3. Clients of that company and why they prefer this company's products/services 
  4. Bonus points for : the corporate culture of the organization... 
You don't need a full understanding, and I don't think it's fair if the selectors expect you to fully understand all of the company before hiring you, but you must have the good sense to know what you're getting into. 

Rule #3 : Practice for interviews ! 

This is a very straightforward thing that we all seem to miss. We try to walk into an interview and hope for the best. But you must know that there is a million of sample interview questions and collections of them out there, and the chances are, the questions are coming out of a pretty limited lot of them. There is a collection of about 100-200 questions out of which about 20 will be asked from you in an interview (the longest ones, that I have faced...). 

One word for those trying to find these questions. GOOGLE! 

Rule #4 : Communicate, properly! 

The conception in Sri Lanka is that to be able to face an interview well, you must know English well. What I know, to be true, is that having a good command of English does not ensure your answers are good, and broken English doesn't mean the answers are bad! The only thing you may need to work on, is the phrasing. There may be questions out there, that are quite simple, but you cannot put to words. Which causes you to panic in an interview. To avoid this, following Rule #3 is a pretty good approach! 

Practice with a friend. I did this with multiple friends and helped out multiple friends by asking sample questions from them. Work on your answers later. For the sake of your employment, practice! 

Rule #5 : Get your shit straight! 

This is one point that I messed up, big time! And hence I know the importance of this. Please have a good understanding of what you're saying, or don't say it at all. 

For instance, always have an in-depth understanding of any project that you are referring to in your applications. And if you think that the question they ask is not something you encountered in that project, don't give an half-assed answer for the sake of completeness. 

Rule #6 : Don't panic! 

Interviews, are not trying to measure all of your capabilities in that limited time. One of the interviewers, I faced told me that "You've been an intern here, and you've gone through four years of college, so I'm going to assume you know how to write a simple piece of code...". Likewise, the interviews are not the only thing that go into your selection. In some companies that I applied for, they took some serious referrals from referees in the CV and some looked into previous project and work. So the chances are, if you do not completely mess up the interview, you will get what's coming to you. 

Rule #7 : " Sometimes you eat the bar, and sometimes the bar eats you... "

Rejection is natural, and dealing with it is one of the biggest ego-busters I've faced, and I am thankful for that. What is important is you give your maximum in the selection process, and not back down mid way. What will happen, will happen. 

Monday, March 23, 2015

An intro into bioinformatics - Cells and Molecules and other stuff...

So... Keeping up with the inconsistent, incoherent articles that I have posted in this blog for years, I have decided to venture into bioinformatics. So expect a series which will span for quite a long time (hopefully).

Bioinformatics is the discipline, as far as I can see, where we study the information related phenomena in the biological world. Main area of concern for us is how information is propagated through chemical sequencing to create functional life forms. This series of articles will give an introductory provisioning of domain knowledge in bioinformatics and computational biology, from what little knowledge I myself have. However, I have hopes to impart new knowledge as I find it.

Now then, in this article, let me give a basic understanding of the domain,  by giving you a rough idea about molecular biology. Please, feel free to point out any inconsistencies.

Everything we call 'life', from the trees to the bees, from the lemurs to the baiji, is the product of millions of years of evolution. Though there has been numerous doubts about the validity of the theory of evolution, it is no doubt a fact which has stood the burden of proof, and the test of time and scrutiny. Though it may not be as crystal clear as the phenomenon of evolution itself, the means and methods of evolution, is the point in case, the greatest puzzle of all time.

To understand this, one needs to look into the basic building blocks of life. At a whim, the uninitiated will undoubtedly point to the animals (or species for the more enlightened ones). The species, while being close to a valid solution to the problem of the unit of evolution, may have been the source of inspiration for the naturalists, even up until a couple of centuries ago. It stands with reason to assume that a species, a living, breathing, moving, reproducing agent of life, whether it be a plant or an animal, whether it be an insect or a mammal, would serve as a useful isolated entity from the surroundings and environment. Not until the discovery of the first microscope, did this idea change.

With the advent of the microscope, new organisms were discovered. These were autonomous organisms which displayed characteristics of life on their own; they had their own metabolism, movement and reproduction. These, 'cells' of life were then considered the unit of living beings, hence we call them the building blocks of life.

Cells are found in nature in a large variety. They differ from each other based on species and their function. However, it is reasonable to think of a complex organism such as a human being, as a colony or a civilization of single-celled organisms which coexist to achieve a single objective; survival. Though there are variations, cells typically have the same basic components.

A typical cell will contain various parts. A cell will get its shape by the cytoskeleton, a fibrous structure which envelops the cell. Inside the cytoskeleton is the cytoplasm, a gell-like substance which contains vital molecules for the existence of the cell. In the middle of a cell, (bar the exception of prokaryotes) lies the neucleus, which controls the existence of the cell and all other aspects of it.

A species is made up of millions and billions of cells. Consider yourself, sitting and reading this essay, and scrolling your mouse-wheel with your right index finger. The digital muscles (muscles in the fingers) that help you move your fingers, are separate cells. They have their own autonomy, they can reproduce accordingly, they can take in food, they can dispose waste, they have their own mitochondria to produce energy from the food. And how do you know your finger is on the wheel? The nerve endings in the fingertips are a set of extensions of neural cells located in your brachialis region. They also have the said autonomy, bar the veracious capacity to replicate. The prokaryotes in your blood gives it its red, and your lungs make up tissue from cells that can effectively filter oxygen from the air you breathe. Your head houses some of the most effective cells ever to have existed, which are capable of doing computations orders of magnitude faster than a computer (alas all the self-awareness and narcissism that comes along with the package). But a question remains, how does a species, a colony of species, propagate its form and function and characteristics to a new generation through reproduction?

To look at this, we will address first the issue of cellular reproduction. There are two forms of reproduction in cells. They are mitosis, in which, a single cell will divide into two identical cells and meiosis, where two cells will contribute their gene... (let this wait...) characteristics to the offspring. An example would be, suppose you scathe your arm on a sharp edge. The damaged muscles, sub-cutaneous tissue, epidermis and the skin tissue will eventually grow back. But if they contributed to each others' division, you'll have a very weird looking new layer of skin, that would make you actually love the acne scars on your face. This doesn't naturally happen (although in the case of a wound with a lot of blood, scar-tissue will form and it's a separate phenomenon) as the cells do not contribute to the reproduction of each other. Therefore the dermis, epidermis and hypodermis simply grow back independently, and it serves as a visible example of mitosis. But, as I am sure you are already aware (I hope I won't have to go towards the awkward details of how babies are made), a child cannot be born in the same manner, but you need two cells from the mother and the father (the egg and the sperm) to contribute to the new organism, which is an example of meiosis.

Now, comes an even more intriguing question; just how exactly is the new cell aware of what it is supposed to do, and what goes where? For this, we come to the even smaller units of life, the gene! The gene, as the unit of selection in evolution was originally proposed by many biologists, but was popularized mainly by Prof. Richard Dawkins by his book “The Selfish Gene”. In this, he gives a good explanation, which I will roughly paraphrase for better insight into the matter.

Imagine a fluid, in which, some molecules, which can combine and recombine to achieve some basic tasks (though not necessarily with purpose) are floating freely around. We will call these amino acids. The combined components, we will call proteins. Needless to say, with a limited number of amino acids, we can create a myriad of different proteins. Now imagine, a molecule, which has some molecules, that can influence the formation of proteins from the original amino acids. This second molecule could encode some structural information on what the proteins should look like (or the converse of it actually). Imagine if this molecule was a large one, which could encode a significant amount of these structural and functional information. All it needs to do is to encode what kind of a protein needs to be created. Such a molecule was created, beyond the shadow of doubt naturally, given the right conditions, and may have undergone a lot of trials and errors of natural selection on itself, and we have the DNA. The Deoxyribo Nucleic Acid owes its success to the structure of itself. It is built of four nucleotides (Adenine, Guanine, Cytosine and Thymine) and these can come together to form very large strands of the molecule, hence enormous amounts of information on the formation of proteins can be stored in them. However, if you think of it as a blueprint of the organism, the 'walls' and 'rooms' and 'hallways' of the blueprint must also be clearly identifiable (not necessarily for an observer, but for the protein builders or ribosomes). These 'sections' are what we call 'genes'. One cannot take a strand of DNA and go about saying where one gene ends and another begins. But sections of the strand will have definite pieces of information encoded in them.

Now, let's see how the whole thing is done in practice. In a cell, or more specifically in the nucleus, the DNA strands are packaged into units called Chromosomes. A chromosome is nothing more than a tightly wound strand of DNA and a special protein called histone which keeps it in shape. Inside the nucleus, there maybe several chromosomes. You typically have 46 of them and a potato has 48. The number of it doesn't really mean anything, however, for a healthy specimen of a species, the count is typically fixed. However, a person with Down's Syndrome will have an additional copy of the 21st chromosome which causes the anomaly. Inside the nucleus, smaller single stranded copies of the DNA is made, which we call RNA. They are made in sections, and these sections can pour through the membrane of the nucleus. The RNAs are like small prints of particular sections of a blueprint, which you will give your gaffer for landscaping, or your painter to finish the paint-job in the first-floor bedroom. The RNA then goes through a special unit called the ribosomes which will create the proteins as encoded by the RNA. These proteins will then go to the required places (through the golgi apparatus) and fulfill their destiny. And some of these new proteins will create new cells. It is pretty straightforward to imagine how mitosis will occur with this model. But meiosis becomes more interesting.

In meiosis, two cells come together, and they share, (now we can use this term) their genetic material. The chromosomes are combined, and split (typically at random places) and these random new DNA will be different to both the parents which will provide a new blueprint for a whole new specimen (Imagine getting a ninth of the blueprint of your house, and eight ninths of your sister's house, which are pretty similar to begin with, and creating a whole new blueprint for a new house). This is how the sexual reproduction operates in a significant number of animals and plants. However, at the creation of this new blueprint (or the crossover) there may be some random mutations which will cause the new specimen to have some characteristics which are not seen in the parents. This is called a mutation (legend has it it could give you laser eyes, and Wolverine's claws, but all I got was a slightly heightened sense of smell and voluntary movement of my ears!). However, if this mutation puts the specimen in an awkward position, that will not prevail. Imagine a pack of Gazelle in a savanna, and they are slightly around the height of the dried grass, which will make them less conspicuous to predators. But suppose there is one offspring, gifted with height. It will most probably be the first ambushed by a perched lioness, and will not propagate its 'tall' gene any further. Similar phenomena has caused the polar bears to be white while the grizzly bears remain brown, the tropical humans to have more sun-resistant dark skins, and the giraffes to have long necks and the deer to have short ones. This, is the beauty of natural selection.


 Life on earth, as we know it, is mysterious and quite wonderful. However, it is likely that our understanding of its origin and path is no great mystery any more. There are minutia to be worked out granted, but I shall leave with a small allegory by late Professor Douglas Adams. “Imagine two hundred years ago you tell a private detective living in New York 'a man who was spotted in Manhattan at 2 pm last Wednesday, was spotted 4 hours later in Charring Cross, London'. He will be simply stupefied how the man crossed the Atlantic in just 4 hours. Now imagine if you told a modern detective the same story. He will still be baffled by the details, which flight did he board? Why did he take the train? And so on... But no great mystery is there for him, about how the man crossed the Atlantic. Our perception on how life works is in the same situation”.  

Friday, February 27, 2015

On group digital signatures....

So there is this thing that I've been trying to figure out; what is the difference between a group signature and a normal signature. To give you a bit of context, let me give a brief intro into digital signatures. I promise, no equations till they're absolutely needed.

Encryption : 

Encryption is a technique we use to ensure many aspects of information security. Mainly, they're used to ensure the 'confidentiality' of a message. This basically means that the message can only be read by the intended party and the intended party alone. However, there are many snoopy malicious 'Eve's around, they'll always gawk at a chance to have a sneak peek at somebody else's affairs.

Integrity and Authenticity : 

Apart from confidentiality, these two are of vital importance in a message. Suppose, there is some person, who, whilst not being able to see what is in the card you're sending to your mother, is secretly attaching a confession of chronic drug abuse into it. How does your mother know whether it is from you, or somebody else altered the message?

Signing It : 

Of course, your mother would know your signature, so it's a simple matter of signing at the end of your letter to ensure that it's from you, and no one has altered it. And I'll add these two slight modifications and assumptions, that : your sign is unforgeable (your mother will immediately notice any tampering) and you have the number of words in your message with the date in your sign, so that she can make sure that you actually signed the said message and nothing else.

Digital Signatures : 

The principle of digital signatures is not much unlike this scenario. Assuming that the confidentiality is already taken care of, to ensure the authenticity and integrity of a message, we do the same thing as your letter to your mother.


  1. Integrity : In order to ensure that your message has not been altered or tampered with, you use a cryptographically secure hash function (the input of which, is your message, and the output is another value, shorter, and quite improbable that two messages will have the same value). You take the hash of your message to ensure that your message is not tampered with. This means that when  somebody gets the message, they can check if the hash is the same as the value they received by giving your message as the hash input. A match, will make sure that the message is intact. Much like the number of words in the bottom of the letter (which, I must admit, is a horrible hash function). 
  2. Authenticity : Now, you must have your own signature under the document. How you sign this document, is you sign the hash function itself. This way, assuming that the message is already confidential, the receiver will know, given that they can identify your signature, that : a ) YOU signed that message and b) you signed THAT message
Public Key Signatures :

A pretty straightforward way to implement this is by using your 'private key' to encrypt the hash function. When the receiver gets your message, they can decrypt it using your 'public key', quite the reverse for which we typically use it, and carry on the verification process.  

Why Group Signatures :

As the saying goes, necessity is the muse of invention. Group signatures are introduced to overcome a very basic need of protecting the signers privacy against potential verifiers. It's like you're signing a petition against the chief of police, a corrupt prick, of your area, and the local legislative officials are capable of verifying that that sign actually belongs to a real person. And the chief of police is convinced if the legislative officer says so, however, the chief cannot know 'who' actually signed it (because you know... white vans and stuff...). 

So this local legislative officer, acts as a group manager, and is the group manager of the group we may call the jurisdictional area of the police station. All residents in this area can sign the petition, and the legislative person can verify if it is true. However, in some special cases, such as attempted forgery or tampering with message content, the legislative officer is capable of revoking this 'anonymity'. However, the basic idea is that " The identity of the signer, doesn't leak to the potential verifiers through the publicly available verification scheme ".. 

I'll sum up WHY this is called a 'group signature scheme' in one sentence : because that way, it's easier to manage the signature verification of a specifically defined group for a group manager, than manage a set of global signatures. After all, your village or town officials may not be able verify the signatures of all the people in the whole wide world. 

Feel free to leave any comments, or request clarifications. This is a quick note, so hope it's clear enough...