Wednesday, July 15, 2015

Today we start the review of a book called Triggers by Marshall Goldsmith. This is about how we react to stimuli that is against the nature of what we want to be to our spouse, friends and colleagues. We all get irritated or flustered at times. For example our temper may accelerate from zero to sixty when someone cuts us off on the road. Though the situation may seem out of control, how we respond is in our hands. This book teaches the following:
the most common belief triggers that keep us from changing
to identify our triggers and to use active questions to counter them
the power of the environment to influence behavior and the importance of the structure to change behavior
why a good enough attitude can harm interpersonal relationships

The book starts off with some facts of behavioral change:
1. Meaningful behavior change is very hard to do. Its hard to initiate behavioral change, even harder to stay the course, hardest of all to make the change stick.
There are usually three difficulties:
1. We can't admit that we need to change
2. we do not appreciate inertia's power over us. we prefer to do nothing.
3. we don't know how to execute the change.

2. No one can make us change unless we truly want to change. Change has to come from within.
If we want to be a better partner at home or a better manager at work, we not only have to change our ways but we have to get some buy-in from our partner or co-workers. Everyone around us has to recognize that we are changing.

There are belief triggers that stop behavioral change. We use these beliefs as articles of faith to justify our inaction and then wish away the result. These are called belief triggers and they are:
If i understand, I will do.
I have willpower and won't give in to temptation
Today is a special day and
At least I'm better than ...
I shouldn't need help and structure.
I won't get tired and my enthusiasm will not fade.
I have all the time in the world.
I won't get distracted and nothing unexpected will occur.
An epiphany will suddenly change my life
My change will be permanent and I will never have to worry again.
My elimination of old problems will not bring on new problems.
My efforts will be fairly rewarded.
No one is paying attention to me
If I change I'm not authentic ...
I have the wisdom to assess my own behavior...
#codingexercise
#interviewquestion
Given a continuous stream of alphabets determine if we have a palindrome or not. The stream is sending one character at a time.
The key to solving this is to keep track of the count of each character seen.
If the length of the string is even, then each character should appear a multiple of two times.
Else there can be at most one character with an odd count of 1

Bool isPalindrome ( stream s)
{
    var h = new Hashtable ();
    Char c = s.Read ();
    While ( c != EOF)
    {
       If (h.keys.contains (c)) {
            h [c] += 1;
       }
       Else {
             h.Add (c);
       }
       If (h.Values.Sum () %2 == 0)
        {
            Foreach  (int val in Values) {
               If (val % 2 != 0) {
                     Return false;
               }
            }
}
else
{
Int count = 0;
Foreach  (int val in Values) {

               If (val % 2 != 0) {

                     count += 1;

               }
               if (count > 1)
                     return false;
}
    }
return true;
}


No comments:

Post a Comment