Emergent Software Interview Question

Compare two versions with parts X.Y.Z.A.B - write an algorithm to do so.