Tuesday, September 10, 2019

全球最厉害的14位程序员,第一位是搞.NET/C#的~!

Here is the article.

01 Jon Skeet

个人名望:程序技术问答网站Stack Overflow总排名第一的大神,每月的问答量保持在425个左右。

个人简介/主要荣誉:谷歌软件工程师,代表作有《深入理解C#(C# In Depth)》。

网络上对Jon Skeet的评价:

  • “他根本不需要调试器,只要他盯一下代码,错误之处自会原形毕露。”
  • “如果他的代码没有通过编译的时候,编译器就会道歉。”
  • “他根本不需要什么编程规范,他的代码就是编程规范。”



02 Gennady Korotkevich


个人声望:编程大赛神童

个人简介/主要荣誉:年仅11岁时便参加国际信息学奥林比克竞赛,创造了最年轻选手的记录。在2007-2012年间,总共取得6枚奥赛金牌;2013年美国计算机协会编程比赛冠军队成员;2014年Facebook黑客杯冠军得主。截止目前,稳居俄编程网站Codeforces声望第一的宝座,在TopCoder算法竞赛中暂列榜眼位置。

网络上对Gennady Korotkevich的评价:

  • “一个编程神童。”
  • “他太令人惊讶了,他相当于我在白俄罗斯建立了一支强大的编程队伍。”
  • “彻底的编程天才。”
03 Linus Torvalds

个人名望:Linux之父

个人简介/主要荣誉:

  • Linux和Git之父,一个开源的操作系统;
  • 1998年EFF(电子前沿基金会)先锋奖得主;
  • 2000年英国计算机学会Lovelace奖章得主;
  • 2012年千禧技术奖得主;
  • 2014年IEEE(电气和电子工程师协会)计算机学会先锋奖得主;
  • 2008年入选计算机历史博物馆名人堂;
  • 2012年入选互联网名人堂。

网络上对Linus Torvalds的评价:

  • “他简直优秀得无与伦比。”

04 Jeff Dean

个人名望:谷歌搜索索引技术的幕后大脑。

个人简介/主要荣誉:谷歌大规模分布式计算系统的设计师,例如:站点爬行,索引与搜索,在线广告,MapReduce,BigTable以及Spanner(分布式数据库)。2009年进入美国国家工程院;2012年美国计算机协会SIGOPS Mark Weiser Award以及Infosys Foundation Award奖项得主。

网络上对Jeff Dean的评价:

  • “使数据挖掘取得了突破性发展。”
  • “能够在各项工作都已安排得满满的情况下,仍能构思、创作、发布出MapReduce以及BigTable这些令人赞叹不已的工具。”

05 John Carmack

个人名望:第一人称射击游戏经典师祖《Doom》(毁灭战士)之父

个人简介/主要荣誉:id Software公司联合创始人,制作了很多脍炙人口的游戏,如:《德军司令部》(Wolfenstein 3D,又名《刺杀希特勒》)、《Doom》(毁灭战士)、《Quake》(雷神之锤)。引领了很多计算机显示领域的新技术,包括:adaptive tile refresh(切片适配更新)、binary space partitioning(二元空间分割)、surface caching(平面缓存);2001年进入互动艺术与科学学院名人堂;2010年收获游戏开发者精选奖终身成就奖殊荣。

网络上对John Carmack的评价:

  • “制作了很多革命性的第一人称射击游戏,影响了一代又一代的游戏设计者。”
  • “他能在一周内就完成任何的基础设计工作。”
  • “他是会编程的莫扎特。”

06 Richard Stallman

个人名望:Emacs文本编辑器,多种语言编译器GCC的创造者。

个人简介/主要荣誉:GNU项目发起人,开发出很多核心工具,例如:Emacs,GCC,GDB和GU Make Free Software公司创始人。1990年获得美国计算机协会Grace Murray Hopper奖项;1998年获得EFF(电子前沿基金会)先锋奖。

网络上对Richard Stallman的评价:

  • “曾独自一人与一众Lisp黑客好手进行比赛,那次是Symbolics对阵LMI。”
  • “尽管我们对事物有不同看法,但他一定是最有影响力的程序员,无论现在还是将来。”

07 Petr Mitrechev

个人名望:最有竞争力的程序员之一。

个人简介/主要荣誉:分别在2000年与2012年收获国际奥林匹克信息竞赛金牌;2011年与2013年赢得Facebook黑客杯赛;在2006年赢得谷歌Code Jam程序设计大赛以及TopCoder算法公开赛;截止目前,暂列TopCoderPetr算法竞赛首位,在Codeforces中排行第五。

网络上对Petr Mitrechev的评价:

  • “即使在印度,他都是程序设计竞赛者心中的偶像。”

How to build a daily habit to work on hard level algorithm?

Sept. 9, 2019

Introduction


I like to build a daily habit to work on a hard level algorithm, try various ideas to solve the problem, and also take time to write down my thought process, things I learn.

A daily habit


It is so hard for me to build a daily habit to work on algorithm problem solving. I already solved 420 algorithms on Leetcode.com. But in reality, I was too busy to work on algorithm and data structure problem solving.

How can I push myself to build on this habit?

One thing I like to work on is to prepare for most challenging job in the world. One thing I can do is to train myself and push myself to work hard; I do believe that out-of-my-comfortable zone and that kind of experience will help me grow new skills, and stay positive and enjoy the time I have as a software programmer.

Hard level algorithms

It is so important for me to understand the value of my own time. I can spend time to work on so many things, but it is important for me to learn that I need to challenge my problem solving skills. How good I can work on practice, communication with others in mock interview, and sharing on my practice on Leetcode.com, all those will be reflected on my daily problem solving at work soon or later. 

I need to push myself outside my comfortable zone. I need to learn how to work on easy level algorithms, prepare better for the hard level algorithms. 




Monday, September 9, 2019

Leetcode 126: Word ladder II - series 10 of 10

Leetcode 126: Word ladder II - series 9 of 10

Leetcode 126: Word ladder II - series 8 of 10

Leetcode 126: Word ladder II - series 7 of 10

Leetcode 126: Word ladder II - series 6 of 10

Leetcode 126: Word ladder II - series 5 of 10

Leetcode 126: Word ladder II - series 4 of 10

I like to study this discussion post. Here is the link.

I also looked up the author and his work experience. He is working for a Google company, before that, he worked for Facebook.

It is so interesting to learn that he could solve so many algorithms three years ago.




Leetcode 126: Word ladder II - series 3 of 10

It is fun for me to review discussion post, and then I have chance to write C# solution, and also write a post on Leetcode.com discuss.

I like to review the solution based on the discussion post here.


Leetcode 126: Word ladder II - series 2 of 10

Sept. 9, 2019

Introduction


I like to write a few more ideas for the hard level algorithm.

I will review the solution based on the blog, and write a discussion post as well. Here is the blog.


126. Word Ladder II - series 1 of 10

Sept. 9, 2019

Introduction


It is a hard level algorithm. What I like to do is to learn to write a solution using graph, and then apply BFS algorithm.

Creative idea to construct the graph


Here is my discussion post. I will add more explanation to understand the design.

It is a hard level algorithm. I also like to learn the idea to build a graph using words, and then build a map to contain shortest path to a word.
What I like to practice in 2019 is to push myself to learn a few ideas using graph and also write down some analysis, build strong interest on the algorithm analysis and how to solve a hard level algorithm.
I learn from my own experience to solve this hard level algorithm starting from 2016. I think that it is better to work on a simplified problems similar to word ladder II first. One of problems is to find all paths, not necessary minimimum length. I should learn how to write simple brute force solution, and using backtracking, marking visit efficiently. Here is my practice in Sept., 2019.
This algorithm is a hard level one. What I do is to study one of discussion post in C#, and then I write down my analysis based on my past experience, debugging. I encourage myself to learn a few ideas to solve this hard level algorithm in 2019. This is the first one, without TLE bug.
Case study
I like to write down how to design the graph, and then apply BFS to build a shortest path map, solve the hard level algorithm.
I like to work on the following test cases.
source = "good";
dest = "best";
A list of words { "bood", "beod", "besd", "goot", "gost", "gest", "best" };
two paths
good->bood->beod->besd->best
good->goot->gost->gest->best
The above two paths both have minimum length 5.
More detail
Each word with length 4 has four keys. For example, word "good" can be searched using the following 4 keys:
"*ood"
"g*od"
"go*d"
"goo*".
By going over the start word and all words in dictionary, we can preprocess the graph to build all keys and related words.
For example,
"*ood" can be searched by changing first char to 'a' to 'z', and 'g' and 'b' are in dictionary. So,
Key = "*ood"
values = {"good","bood"}.
BFS search more detail
Give the above example, start word from "good", end word is "best", we like to build shorest path from start word to every word encounted in BFS search, first, key is "good", then key is "bood","goot", and so on.
One highlight is to add more entries for same height. We can argue that breadth first search, the first one found should have less and equal value, so new one should just check if it is equal or not.
The above logic is shown in the code. I put comment "reasoning?".
Time complexity
One of my practices ran into time-limit-exceeded error. So it reminds me to pay attention to time complexity, and I find this study code and it should have better time complexity since no timeout.
All words in dictionary are preprocessed once to build the graph, with special key containing wild char . This makes the algorithm time efficient specially for large amount words in dictionary.
Word dictionary with length = 5 can have maximum words 26^5 = 11,881,376, let us denote using N. So it is important to use algorithm with time complexity O(N), not above O(N).
Here are highlights:
  1. Understand that it is important to apply BFS search starting from start word in order to find minimum length of path, and also meet the requirement of TLE concern.
  2. Preprocess the graph first, go over all words in dictionary to build a hashmap, so it will take O(1) to find all one hop away neighbors in the graph.
  3. Once the end word is visited, terminate the search in the graph. No need to go further to search.
  4. Design shortest path for each word visited, the path is defined from begin word to any word visited. To allow multiple path with same distance, argue that those visited and found first should have less and equal length.
  5. C# code using StringBuilder, operator [], good practice compared to using immutable string.
Some art
I do believe that it is a good idea to come out some very good art to present the process of algorithm design. This hard level algorithm is such an interesting algorithm. I like to start to work on the art to illustrate the problem solving starting from selected test cases, two minimum path from good to best, and then draw a queue, show what is order to get into queue, and then shortestPaths are calculated for each key. The shortest path is from "good" to key word.
I will think about more later to make the art of diagram more memorable and helpful for me to learn the problem solving.
image
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _126_word_ladder_II
{
    class Program
    {
        static void Main(string[] args)
        {
            var source = "good";
            var dest = "best";

            var words = new string[] { "bood", "beod", "besd", "goot", "gost", "gest", "best" };

            var result = FindLadders(source, dest, words);
            // two paths
            // good->bood->beod->besd->best
            // good->goot->gost->gest->best
        }

        /// <summary>
        /// Sept. 9, 2019
        /// study code
        /// https://leetcode.com/problems/word-ladder-ii/discuss/375730/C-BFS-Solution-faster-than-94-and-less-than-100-memory
        /// </summary>
        /// <param name="beginWord"></param>
        /// <param name="endWord"></param>
        /// <param name="wordList"></param>
        /// <returns></returns>
        public static IList<IList<string>> FindLadders(string beginWord, string endWord, IList<string> wordList)
        {
            var graph = new Dictionary<string, HashSet<string>>();

            preprocessGraph(beginWord, graph);

            foreach (var word in wordList)
            {
                preprocessGraph(word, graph);
            }

            //Queue For BFS
            var queue = new Queue<string>();

            //Dictionary to store shortest paths to a word
            var shortestPaths = new Dictionary<string, IList<IList<string>>>();

            queue.Enqueue(beginWord);
            // do not confuse () with {} - fix compiler error
            shortestPaths[beginWord] = new List<IList<string>>() { new List<string>() { beginWord } };                      

            var visited = new HashSet<string>();

            while (queue.Count > 0)
            {
                var visit = queue.Dequeue();

                //we can terminate loop once we reached the endWord as all paths leads here already visited in previous level 
                if (visit.Equals(endWord))
                {
                    return shortestPaths[endWord];
                }
                                
                if (visited.Contains(visit))
                    continue;

                visited.Add(visit);

                //Transform word to intermediate words and find matches
                // case study: var source = "good";  
                // go over all keys related to visit = "good" for example,
                // keys: "*ood","g*od","go*d","goo*"
                for (int i = 0; i < visit.Length; i++)
                {
                    var sb = new StringBuilder(visit);

                    sb[i] = '*';

                    var key = sb.ToString();

                    if (!graph.ContainsKey(key))
                    {
                        continue;
                    }
                    
                    //brute force all adjacent words
                    foreach (var neighbor in graph[key])
                    {
                        if (visited.Contains(neighbor))
                        {
                            continue; 
                        }
                        
                        //fetch all paths leads current word to generate paths to adjacent/child node 
                        foreach (var path in shortestPaths[visit])
                        {
                            var newPath = new List<string>(path);

                            newPath.Add(neighbor); // path increments one, before it is saved in shortestPaths

                            if (!shortestPaths.ContainsKey(neighbor))
                            {
                                shortestPaths[neighbor] = new List<IList<string>>() { newPath };
                            }        // reasoning ? 
                            else if (shortestPaths[neighbor][0].Count >= newPath.Count) // // we are interested in shortest paths only
                            {
                                shortestPaths[neighbor].Add(newPath);
                            }
                        }

                        queue.Enqueue(neighbor);                        
                    }                                        
                }
            }

            return new List<IList<string>>();
        }

        /// <summary>
        /// Time complexity is biggest challenge. It is a good idea to use O(N) time to preprocess a graph for the search. 
        /// How to define the graph? It is kind of creative idea to use wildchar * to replace one char for each word.
        /// 
        /// For example word "hit" can be written as "*it", "h*t", "hi*". 
        /// graph["*it"] = new HashSet<string>{"hit"}
        /// graph["h*t"] = new HashSet<string>{"hit"}
        /// graph["hi*"] = new HashSet<string>{"hit"}
        /// 
        /// git can be written as "*it", "g*t","gi*"
        /// so graph["*it"] = new HashSet<string>{"hit","git"}
        /// ...
        /// 
        /// </summary>
        /// <param name="word"></param>
        /// <param name="graph"></param>
        private static void preprocessGraph(string word, Dictionary<string, HashSet<string>> graph)
        {
            //For example word hit can be written as *it,h*t,hi*. 
            //This method genereates a map from each intermediate word to possible words from our wordlist
            for (int i = 0; i < word.Length; i++)
            {
                var sb = new StringBuilder(word);
                sb[i] = '*';

                var key = sb.ToString();

                if (graph.ContainsKey(key))
                {
                    graph[key].Add(word);
                }
                else
                {
                    var set = new HashSet<string>();
                    set.Add(word);
                    graph[key] = set;
                }
            }
        }
    }
}

Actionable Items

I reviewed my practice in 2016 on this hard level algorithm. What I did in 2016 is to spend over eight hours, but no submission on this hard level algorithm 126 on Leetcode.com. 

It is so surprising for me to learn that back in 2016 I was not so experienced to review and write down my own thought process. I am so glad to see the big difference in 2019 compared to 2016. All blogs are here for me to review my practice in 2016. 


Brian Williams & Trust - ABC News talks with Margie Warrel

Here is the link.

Decision Time

Here is the article I like to read.


How to make hard choices | Ruth Chang

Here is TED talk's link.

Here is the link to read the transcript.


Sunday, September 8, 2019

margiewarrell - youtube channel

Sept. 8, 2019

Introduction


I am so happy to spend time to learn something from Magie Warrell through youtube.com. I just came cross her youtube.com channel.


Learning experience as an interviewer

Sept. 8, 2019

Introduction


It is my short research. I met young engineers from Intel, Warmart lab in Silicon Valley after August 20 through interviewing.io, I was amazed how good they are in terms of problem solving. I like to write a short research report why they can perform better compared to me.

My short research

I think that I should go back to work on those solved algorithms, and learn to write C# code for different ideas.

I like to write different ideas for hard level algorithm 126 word ladder II. I just need to find one or two posts using C# or Java, and then write code, share my experience of study of those ideas.

I do believe that it is most important for me to train myself think hard, think carefully, think for ideas to optimize the solution.



Courageous Leadership: Margie Warrell at Ernst & Young Women's Leadership Breakfast

Here is the video.

You can't lead from your comfort zone: Margie Warrell keynote speech

Here is the video.


Good news from a friend

Sept. 8, 2019

Introduction


I got a message from Chinese wechat to follow up with my update, I could not believe that I got the message, since I did not learn how to organize contacts on wechat, I asked him the name. He told me we met on interviewing.io, by checking date August 7, 2019, I found the mock interview and our conversation with one hour 30 minutes.

Great Amazon leadership 


We had conversations, in less than five minutes, he told me that he will join Amazon Seattle tomorrow.

I just could not believe that I was contacted by him. I was so glad for his success.

Just after 10 minutes, I learned to reach out another Chinese who went to Google onsite recently. We had discussion on one algorithm - hard level, word ladder. He is such a great engineer, and he helped me to learn 126 word ladder hard level algorithm through wechat conversation.

I just could not believe that friends make this world so connected.

Actionable Items


I should learn how to manage so many contacts. I should add some notes when a friend is added to my wechat. I should tell who he is right away.


Learn, Unlearn And Relearn: How To Stay Current And Get Ahead

I like to do some career research. In theory, how should I prepare for my career? I need to live and build wealth and grow rich. I can be very frugal, no extra cost just basic living needs.

Here is the article I like to read.


Case study: 126 word ladder II

Sept. 8, 2019


Introduction


It is so easy for me to be humble and learn from the interviewee. I met a young engineer who went to Google onsite recently, and she showed me the solution how to solve word ladder II (a simple version) on August 16, 2019. She demonstrated such great thinking process, compared to mine, I was so humble to learn that she is much better engineer. She is young, less than five year experience, work for Intel. It is almost one month, I had chance to review her code again.


Case study


I like to write down her code, and then review her performance. I need to think about how to work on my problem solving issues. I should work on my analysis part, make it work first, and then make it optimal next.


Actionable Items


I should learn from the interviewee. She worked hard and also she spent time to test the code, she added a few words in dictionary, and then there are two paths from source to destination word. To exhaust all possible options to replace one char, first for loop is always to start from 0 to last one.

I wrote C# solution using same idea. Here is the folder, here is my C# code.


Folow up 


Sept. 17, 2019

One thing I learn from the interviwee is that those engineers working in Intel are super hard working. They all communicate very often, and they know the standards very well related to Google and Facebook onsite interview. They all are hard working, and they will try to run the code as fast as possible, and then make sure the code passes all those test cases.

At the very beginning, she already talked about all concerns about dictionary, how big the dictionary. The graph algorithm is so popular, and she demonstrated good understanding basics as well.

126. Word Ladder II

Sept. 8, 2019

Introduction


It is time for me to study the hard level algorithm, and I like to push myself to write a  working solution this time.

Here is my practice back in 2016. There is a time-limit-exceeded bug in my C# solution.

in Learning - Being great at your job: GIFT

I like to take one hour course later on. I need to go out to play some tennis, and I need to take a break, and do some exercise. I like to lose some weight if I can.

Here is my link.


Why You Should Stop Searching for Work You Love | Jodi Glickman | TEDxChicago

Here is the link of TEDTalk.

Jodi Glickman is passionate about career success for everyone. She has trained the brightest young minds in this country by creating a curriculum that delivers practical, tactical communication skills and strategies in the workplace. The opposite of what you might have heard before, Jodi advises to stop trying to love your job and find true job fulfillment when you make them love you. Jodi is passionate about closing the skills gap and providing pathways to career success for all. She has trained the brightest young minds in this country by creating a groundbreaking curriculum that delivers practical, tactical communication skills and strategies to influence, advance and lead in the workplace. Through her leadership work and online courses, Jodi is helping to shape the next generation of talent. Jodi is also the author of the critically acclaimed book Great on the Job, What to Say, How to Say It, The Secrets of Getting Ahead and is a writer for the Harvard Business Review. This talk was given at a TEDx event using the TED conference format but independently organized by a local community.


9:10/ 10:24

Generosity
Initiative
Forward momentum
Transparency


sarah green mock interview - Havard law professor Sarah Green

Here is the link.

How to Get the Right Job - Harvard business review

Here is the article.


Billionaire Howard Marks discusses the market cycle and how to master it

Here is the link.


Embracing Risk in Career Decisions - Harvard business review

Here is the article. I like to spend time to read the article.

I have difficulty to understand how I should advance my career this year. I was reminded a few times to apply Amazon and Facebook in 2019. I was busy to work on my practice of algorithm and data structure, and I did not have plans to apply until I got emails.

So it is better for me to learn and research on this topic. The article is well-written.

The attitude factor: Also driving your career is your ability to learn and adapt over time — to deal with new situations, different personalities, and ongoing surprises — and make the most of them. Although people can paint logical pictures of their career paths in retrospect, in reality most careers are unpredictable — influenced by particular people, seminal moments, or unique opportunities. Having the attitude to grasp these surprises and leverage them is critical.

The key point here is that career success is not about reducing risks. Rather it’s about maximizing your happiness in a way that also allows you to find surprises and push yourself into new territory. To do that you may need to maximize your risks rather than manage them.

Michigan Retirement Research Center

Here is the link.


WORK IN RETIREMENT: MYTHS AND MOTIVATIONS

Here is the article I like to read later on.


How to land a great job when you are over 50

Here is the article.


Case study: How do I explore premium version of Linkedin.com?

Sept. 8, 2019

Introduction


It is my personal finance research. I like to go over all possible new product feature of Linkedin premium. I spend time to read and spend time to explore all product feature, and I try to look into Docusign and what are the insights of Docusign.

Case study


I came cross the articles related to premium job search. Here is the linkedin profile, I like to see more articles related to product features. Three articles are good enough for me to understand the basics.




Howard Marks explains how you can predict market cycles

Here is the link.


Markets Have Flipped From Being All Good to All Bad, Says Oaktree's Marks

Here is the link.


The Howard Marks Investor Series at The Wharton School: A Conversation with Howard Marks

Here is the link.

Tennis Legend Andy Roddick: "I Am a Little Bit of a Fanboy of Warren Buffett"

Here is the article.




Howard S. Marks - American investor

Here is the wiki article.


Navigating Market Cycles (w/ Howard Marks) | Real Vision Classics

Here is one hour interview. I plan to spend next hour to watch the video. Now it is 3:44 PM.

THE MOST IMPORTANT THING (BY HOWARD MARKS)

Here is the book quick summary.


Howard Marks: My Six Key Tenets of Successful Investing (Audio)

Here is the video I like to spend time to listen.

Control the risk. Not highest paid job, not making most job.