Thursday, August 13, 2015

#codingexercise
Write a function condense_meeting_times() that takes an array of meeting time ranges and returns an array of condensed ranges.
For example, given [(0, 1), (3, 5), (4, 8), (10, 12), (9, 10)]
return [(0, 1), (3, 8), (9, 12)]
void condense_meeting_time(List<Tuple<int, int>> meetings)
{

Sort(ref meetings, compararer); //comparer sorts meetings by start time, end time

var merged = new Stack<Tuple<int. int>>();

merged.add(meetings[0]);

for (int i = 1; i < meetings.length; i++)
{
   var top = merged.Peek();
   if (top.Item2 == meetings[i].Item1)
   {
top.Item2 = meetings[i].Item2;
        merged.Pop();
        merged.push(top);
   }
   else if (top.Item2 < meetings[i].Item1)
   {
       merged.Push(meetings[i]);
   }
   else if (top.Item2 < meetings[i].Item2)
   {
top.Item2 = meetings[i].Item2;
        merged.Pop();
        merged.push(top);
    }

}

while (merged.empty() == False)
{
var top = merged.Peek();
Console.WriteLine("[{0},{1}]", top.Item1, top.Item2);
merged.pop();
}

}
Today we start the  review of a book titled the four disciplines of execution 4DX for short. This is not a strategy or theory book claims the authors - McChesney, Covey and Huling who are themselves Leaders in FranklinCovey - a company that consults on this practice in over 130 countries.
To begin with 4DX talks about the challenges in execution - major initiatives crash with a thud, important initiatives are quietly scuttled, and the overall distraction of the whirlwind - a term used to describe the chores that take a disproportionate amount of time from your goal or cause a randomization of your tasks. This book says the author is not about managing the whirlwind but to effectively meet your wildly important goals (WIG)  even in the face of a whirlwind and can help you reclaim as much as 20 percent of your time for your WIG. A WIG is one that can make all the difference. By such a definition, a WIG has to be narrow and focused.   A WIG not only gives you direct benefits but also gives you new levels of performance.  You can choose it from within the whirlwind or outside. But the following practice will help:
1) no team focuses on more than one or two WIGs
2) the battles you choose must win the war
3) senior leaders can veto but not dictate the goal.
4) All WIGs must have a finish line and a duration.

The above rules help you narrow and find your WIG. 
The next set of rules is to act on the lead measures. 
A lag measure tells you if you have achieved the goals, a lead measure tells you how likely you are to achieve it. 
To define and track a lead measure, the authors cited an example of how the managers of a baseball team determined that the number of runs was the criteria to find the most productive player. Defining such a lead measure makes everyone feel empowered to achieve it.

Then the third discipline is to keep a compelling scorecard. Everyone should know the scorecard at all times. This will let them know whether they are winning or losing. When the scorecard is easy to visualize and updated regularly, the whirlwind will not take it away from you. Great teams must know whether they are winning or losing otherwise they will not know what works and doesn't to win. Everyone gets to see the scorecard and everyone knows what to do to win.
A scorecard should be
1) simple just like a scoreboard in a game
2) it should be prominent just like the scoreboard
3) It should show lead and lag measures
4) and it should tell at  a glance whether you are winning or losing

Finally the fourth discipline is creating a cadence of accountability - a frequently recurring cycle of accounting for past performance and planning to move the score forward. Discipline 4 is where execution happens because the team meets at least weekly in a WIG session. The meeting lasts no longer than 20 to 30 minutes, has a set agenda and goes quickly In this meeting, you should hear account reports from everyone, you should review the scorecard to learn from successes and failures, and to clear the path and make new commitments. Blockers for any person must be discovered and removed. Each fresh commitment must meet two standards - it must represent a specific deliverable and it must influence the lead measure.

The authors say that the accountability here is different from the usual organizational one. It's more personal. Instead of saying it is to an outcome, it is something to yourself When this resonates with the peers, it improves the performance of the team dramatically. The WIG session encourages experimentation with fresh ideas. It engages everyone in problem solving and promotes shared learning.

Having discussed what the 4DX is, the authors outline the different stages of behavior change.
Stage 1) Getting clear  - this is when the team knows what WIG and 4DX are , 2) Launch stage - this is when the leader and the team get together to focus, 3) adoption This is probably the stage that takes most time  When the WIG sessions begin to go smoothly, you know that this stage is being met. 4) Stage 4 - optimization - this is to brainstorm and follow through on efficiencies and Stage 5) Habit stage. This is when you have to make the habits of what has been working for you

Now each of the items in a bit more actionable mention so that you can install them:
Step 1 : Consider the possibilities:
Brainstorm with peer leaders
Brainstorm with your team members
Brainstorm alone
Step 2: Rank by impact
When you are satisfied with your list of candidate Team WIGs, start prioritizing
Step 3: test top ideas -
Is the team aligned to the overall WIG
Is it measurable
who owns the results
who owns the game
Step 4 : Define the WIG
Once you have selected and tested the ideas for high impact team WIGs, define it as follows:
1) begin with a verb
2) define the lag measure
3) keep it simple
4) focus on what, not how

Installing discipline 2) act on the lead measures and this is usually the most difficult
There are three reasons :
Lead measures can be counterintuitive
Lead measures are hard to keep track of
Lead measures often look too simple

To  follow through on this discipline, here are the steps again :
1) Consider the possibilities
2) Rank by impact
3) Test top ideas
  - Is it predictive
  - Is it influencable
  - Is it ongoing process
  - Is it a leaders game or a team game
  - Can it be measured
  - Is it worth measuring
4) Define the lead measures
  - Are we tracking them  or individual performance
  - Are we tracking the lead measure daily or weekly
  - what is the quantitative standard
  - what is the qualitative standard
  - does it start with a verb
  - is it simple ?

 Installing discipline 3
1) Choose a theme
2) design the scoreboard
3) Build the scoreboard
4) Keep it updated

Installing discipline 4
1) demonstrate respect in your language and in your actions
2) reinforce accountability by making it transparent how important the task may be
3) encourage performance by empowering and reinforcement

The final section of the book is about installing 4DX across the organization and not just your team.
1) clarify the overall WIG
2) design the team WIGs and lead measures
3) leader certification by training the leaders separately
4) Team launch - when leaders conduct a launch
5) execution with coaching - leaders typically need experienced coaching
6) Quarterly summits

As we practice this more and more, we will realize that execution is ubiquitous and therefore so is 4DX and you can draw to it to your closer circles and personal life as well.

#codingexercise
Int height ( node root )
{
If (root == null) return 0;
Return max ( height(root.left) , height(root.right)) +1;
}

While Queen Elizabeth has a limited number of types of cake, she has an unlimited supply of each type.
Each type of cake has a weight and a value, stored in tuples with two positions:
1 An integer representing the weight of the cake in kilograms
2 An integer representing the monetary value of the cake in British pounds For example: # weighs 7 kilograms and has a value of 160 pounds (7, 160) # weighs 3 kilograms and has a value of 90 pounds (3, 90) You brought a duffel bag that can hold limited weight, and you want to make off with the most valuable haul possible. Write a function max_duffel_bag_value() that takes an array of cake tuples and a weight capacity, and returns the maximum monetary value the duffel bag can hold.
int fill_knapsack(int Capacity, int [] weights, int[] value, int number)
{
if (number == 0 || Capacity == 0) return 0;
if (weight[n-1] > Capacity) return fill_knapsack(Capacity, weight, value, n-1);
return max(val[n-1] + fill_knapsack(Capacity-weights[n-1], weights, value, n-1), fill_knapsack(Capacity, weights, value, n-1);
}


  

No comments:

Post a Comment