From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Saturday, July 4, 2020
COVID-19: Canada layoff tracker
Mock interview: Find smallest substring containing distinct chars in given array
Introduction
It is my 10:00 AM mock interview on the platform on interviewing.io. I have 9 credits to get interviews as an interviewee, I was excited to meet an Apple engineer and a Microsoft employee last night 8:00 PM and 10 PM mock interviews, this morning 10:00 AM I met a Google intern, Morgan Stanley engineer as an interviewer. I like to write a case study on this mock interview.
Case study
I like to get the transcript into a gist, and then share the link first, and also paste the content in my blog as well.
Let me do that.
Here is the gist.
Continue
Actionable Items
Write a solution using bit manipulation to check if substring containing all distinct chars in the given array. Find leetcode algorithm and submit an answer.
I have to learn how to give feedback from the template the interviewer shared. He learned from Google interview bootcamp when he was Google intern in Europe.
Mock interview: Square root using binary search
Introduction
It was my 10:00 PM mock interview on July 3, 2020. The first algorithm is to work on square root, I chose to solve it using binary search. Here is the case study.
Case study
Here is the gist.
Feedbacks
Friday, July 3, 2020
Mock interview: Is graph bipartite?
Leetcode discuss: Leetcode 10: regular expression
Case study - mock interview as an interviewer on July 2, 2017
July 2, 2020
Introduction
It is a good idea to review what I learned as an interviewer and then write a post after three years. Here is the blog about mock interview.
The following is C# code to pass online judge.
public class Solution {
//public bool IsMatch(string s, string p) {
public bool IsMatch(string text, string pattern)
{
if (text == null || pattern == null)
{
return false;
}
if (pattern.Length == 0)
{
return text.Length == 0;
}
var test_pattern = pattern[0]; //#
bool isStar = pattern.Length > 1 && pattern[1] == '*';
bool firstCharMatching = text.Length > 0 &&
(test_pattern == '.' || text[0] == test_pattern);
if (pattern.Length > 1 && isStar)
{
return IsMatch(text, pattern.Substring(2)) ||
(firstCharMatching &&IsMatch(text.Substring(1), pattern));
}
else if (firstCharMatching)
{
return IsMatch(text.Substring(1), pattern.Substring(1));
}
else
{
return false;
}
}
}Leetcode discuss: Leetcode 10: regular expression
Case study: dynamic programming solution on January 26, 2018
My practice was on January 26, 2018. Here is my blog to document my experience.
It is a good idea to work on a simple test case, and then build a table to calculate the value of regular expression matching.

public class Solution {
public bool IsMatch(string text, string pattern)
{
if (text == null || pattern == null) // false
{
return false;
}
var tLength = text.Length; // 0
var pLength = pattern.Length; // 4
var dp = new bool[tLength + 1, pLength + 1]; // 1, 5
dp[0, 0] = true; //
for (int i = 1; i < tLength + 1; i++)
{
dp[i, 0] = false;
}
// "" matches "a*b*" etc.
for (int i = 1; i < pLength + 1; i++)
{
dp[0, i] = i >= 2 && pattern[i - 1] == '*' && dp[0, i - 2];
}
for (int row = 1; row < tLength + 1; row++)
{
for (int col = 1; col < pLength + 1; col++)
{
var visitChar = text[row - 1];
var patternChar = pattern[col - 1];
var isStar = patternChar == '*';
if (!isStar)
{
dp[row, col] = (patternChar == '.' || visitChar == patternChar) && dp[row - 1, col - 1];
}
else
{
dp[row, col] = col >= 2 &&
// zero time
(( dp[row, col - 2]) ||
// one time || more than one time
((pattern[col - 2] == '.' || visitChar == pattern[col - 2]) && (dp[row - 1, col - 2] || dp[row - 1, col])));
}
/*
* code review on May 9, 2019
* "mississippi"
"mis*is*p*."
else
{ // zero time one time more then one time
dp[row, col] = col >= 2 && (dp[row, col - 2] || dp[row, col - 1] || dp[row - 1, col]);
}
*/
}
}
return dp[tLength, pLength];
}
}
Leetcode discuss: Leetcode 10: regular expression
July 2, 2020
It take some time for me to review all my past practice on this hard level algorithm. What I like to do is to write a few discussion posts first, and then I will figure out how to review those practice.
I went through very good learning experience to work with over 10 programmers as an interviewer or interviewee. I documented my p-r-a-m-p mock interview website over 10 times practice here.
Leetcode 10: regular expression
July 2, 2017
Case study - mock interview as an interviewer on July 2, 2017
C# code review memoization practice on July 2 2017
January 26, 2018
Case study: dynamic programming solution on January 26, 2018
April 21, 2018
Case study: mock interview as an interviewee on April 21, 2018
Practice with a bug
March 29, 2018
Case study: dynamic programming solution with a bug on March 29, 2018








