- ElectraMeccanica Vehicles (NASDAQ:SOLO)
- Silvercorp Metals (NYSEMKT:SVM)
- Zovio (NASDAQ:ZVO)
- Revive Therapeutics (OTCMKTS:RVVTF)
- Coty (NYSE:COTY)
- Husky Energy (OTCMKTS:HUSKF)
- Harte Hanks (NYSE:HHS)
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.
Tuesday, June 30, 2020
7 of the Best Penny Stocks to Buy Now
MGM stock: Trading MGM stock
Here's what the most sophisticated investors are doing with their cash during the market rally
“One is that if you don’t get into this market, you will never see these prices again because the Fed keeps pumping money into the market and inflation is going to catch up with us very soon and stocks are a safe-haven. And the other thing is that it doesn’t matter how much money is in the market, companies will have difficulty earning a profit. So that’s where we are.”
Monday, June 29, 2020
Sabr stock: Google Is Providing Search Data to Air France, Lufthansa, Other Airlines Looking to Decide Which Routes to Restart
ITA Software Legacy
Marostica is the former chief commercial officer of ITA Software, which Google acquired for $700 million in 2011. One legacy of that transaction is that Google still powers flight-shopping on about a dozen airline websites, including Air Canada, Delta, American, United, Iberia, Latam, Turkish, China Southern, and China Eastern. Other Google flight-shopping partners include companies such as Northrop Grumman, Sabre’s GetThere corporate booking tool, and StudentUniverse.
Airlines selling tickets have tons of booking data, which figure into route decisions. In contrast, Google’s new tool provides data that are “super upper-funnel” concerning travelers inclinations when they are in the initial stages of planning a trip, Marostica said.
Google is not the merchant of record for flight bookings, but still there is quite a bit of data about travel intent that partners can use, he added.
Online travel agencies, meanwhile, are using the new tool for marketing purposes, Marostica said.
Google had intended to introduce the new tool later this year, but Covid-19 accelerated that timetable.
While Demand Explorer pertains to consumer intent about flights, Google could possibly expand or develop another tool based on hotel queries in Google search, Marostica said.
美股赚钱:低价位不超50元的潜力股票5只股
Five stocks:
IPG - dividend 5%
XRAY -
PFE - Pfizer - 4%
PPL - 7% dividend
WBA - Walgreen
Trading: June 29, 2020
290 gains, 2 business days, 290/6040 = 4.80%
I sold MGM too early, now 9:42 AM, MGM price is $16.90
2 days, 164/4755.75 = 3.4%
MGM volume 16,171,725 shares before 9:44 AM PST on June 29, 2020
Actionable Item
I should catch up opportunity this morning, since HSE.TO is 10 cents less than the price I purchase last Friday. I should take some risk to purchase another 1000 share to 10,000 share to bet against the market go up.
Sunday, June 28, 2020
Leetcode discuss: 84. Largest Rectangle in Histogram
C# review my second practice in August 2018
April 10, 2018, here is the blog.
August 5, 2018, here is the blog.
For example, [2, 1, 5, 6, 2, 3]
largest histogram is 5 + 5 = 10
First of all, play with as many simple test cases first, and then try to find ideas to solve the problem.
[3, 2], the answer is 4.
Let us talk about this example, there are three cases to consider, [3], [2, 2], and [2] is skipped since 2 < 3. Make sure that area width 1 and 2 both are considered in comparison.
[5, 3], the answer is 6.
[5, 2], the answer is 5.
[1, 5], the answer is 5.
There are [3], [2, 2], [1, 1, 1], so the maximum one will be 4. First, 3 < 4, so [2, 2]'s area is larger than [3].
ascending, how to calculate area and get maximum one is 4.
[2, 3, 4], the answer is to find Math.Max{4, 3 * 2, 2 * 3} = 6. If I enumerate all possible rectangles, three are three areas with one number, two areas with two numbers, one area with three numbers.
We can argue that three areas with one number can be simplified, only check last number since it is largest one.
We also can argue that two areas with two numbers can be simplified, only check last two numbers in ascending order numbers, since rightmost one is largest one.
Based on the test case [2, 3] and [2, 3, 4], we can argue that putting all ascending numbers into stack first, once it goes down, then pop up each number in the stack, and then calculate the maximum one.
How to get the area is 12?
Let me reason one step a time.
First put [3] into stack;
Next 4, 4 > 3, so put 4 into stack; stack: [3, 4];
Next 3, so 3 < peek of top of stack 4, pop 4, calculate area with one number, [4], value should be 4; update max = 4; (why not consider 3? Since 3 < 4, no need to calculate area width 1 with a smaller value, starting from 4.)
continue to compare top of stack, 3 == 3, pop 3, calculate the area with three numbers [3, 4], so the total is 3 * 2 = 6;
Next 4, so put 4 into stack; stack [3, 4];
Now all numbers are visited in the array, pop 4, area is 4 < max = 6;
Pop 3, the stack is empty, in other words, 3 is the minimum number of all numbers in the array, termination case, 3 * length of the array = 3 * 4 = 12, which is bigger than max = 9, so max = 12.
Go over test case [3, 4, 3, 4] and explain to myself how to find maximum area 12.
First keep a stack in ascending order, and then first two numbers into stack [3, 4], and the third number is 3, then remove numbers in the stack bigger than 3, and also calculate the area with one number, two numbers, three numbers, ...
Make sure that last number in the stack should be minimum number in the array, all numbers span will be counted to the area with minimum number, which is 12.
I do not understand the power of case study. I need to write down a challenge test case, and then step by step explain to myself how to solve the problem? How to improve using stack data structure? What is most challenging part in the design.
public class Solution {
public int LargestRectangleArea(int[] height) {
var stack = new Stack<int>();
var index = 0;
var largestArea = 0;
int length = height.Length; // 6
while (index < length) // true; index = 1; index = 2;
{
// stack empty going upward
if (stack.Count == 0 || height[stack.Peek()] < height[index]) // index = 1, false;
{
stack.Push(index++); // 0, index = 1;
}
else
{
// going downward and then pop stack, calculate rectangle.
popStackAndCalculate(ref largestArea, stack, height, index);
}
}
while (stack.Count > 0)
{
popStackAndCalculate(ref largestArea, stack, height, length);
}
return largestArea;
}
/// <summary>
/// downward and then pop stack to calculate the rectangle
/// </summary>
/// <param name="largestArea"></param>
/// <param name="stack"></param>
/// <param name="height"></param>
private static void popStackAndCalculate(ref int largestArea, Stack<int> stack, int[] height, int rightIndex)
{
int length = height.Length; // 6
int lastHeight = height[stack.Pop()]; // 2
int width = stack.Count == 0 ? rightIndex : rightIndex - stack.Peek() - 1; // 1
largestArea = Math.Max(largestArea, lastHeight * width); // 2 * 1
}
}
美股分析:长短期走势怎么分析?交易规则与指标谁重要?
0:00 - 5:00
Investment rules:
How to time the market?
Get in/ Get out
How to control emotions and avoid mistakes?
频繁交易
重仓交易
不止损
Emotional transaction
How to stop loss? 套的很深, 最后做鸵鸟
高位做成重仓
Saturday, June 27, 2020
Lori Goler - lean in sharing
It was 2008: I had been working in tech for nearly 10 years, or in Facebook terms, since Mark Zuckerberg was 13 years old. I was an early Facebook user, an avid fan and excited about Facebook’s bold mission. When Sheryl Sandberg joined Facebook as Chief Operating Officer, I noticed. I knew that helping to build Facebook would be a once-in-a-lifetime experience. At the very least, I had to raise my hand at the chance.
I picked up the phone and called Sheryl. I had met Sheryl socially, but did not know her well. I was oddly surprised when I was able to reach her. I had no idea what Facebook needed. I only knew I wanted to do something that mattered. I figured I didn’t have much time, so I launched right in: “Sheryl, what is your biggest problem and can I help solve it?” We later laughed that I hadn’t even taken time to exchange pleasantries.
Facebook HR leader: Watch Facebook’s Head of People At Fortune’s MPW NextGen Summit | Fortune
Starting from 500 people, people are afraid to get laidoff next day. No feedback. Fairness of the process.
11:00 - 13:00
To be a learner - how to learn?
Want to Work at Facebook? See This First.
Meet Lori Goler, the woman who runs “People Operations” at the world’s most admired employer.
500 people -> 8 years later -> 15,000 engineers -> how to grow?
John Battelle interviewed HR person
Pay attention how she answered all questions, and how she demonstrated good communication skills, and showed confidence and talent.
How to end up joining Facebook? 2007 <- quick to response
Human resource management? challenging problems.
Building for scale - marketing, how to get word out?
What to mean to work for Facebook? Understand their needs? Large audience, what they want?
Builder - Look for people loving to build things, and people working on ...
Try to do that, learn. Open to learn. Rather staying on the study
You are quite clear on average people - young, workforce, rational for that age people?
Good for all age group - show up at work
Look at data - similar to all ages - Internally ...
Values - summer interns
More focus - social capitalism -
Company?
Facebook mission - get connected, people connect to that
Facebook stories, instagram stories - really do want people to get connected
Really put people in roles - outer align - people interest
Managers - future managers - best managers - individual contributors
Continue to learn
Best place to work - what else? Secret sauce
People are very good at what they do, and people ... open company, and everything - no secret, roadmap, and other things
Move fast, impact - make good impact on the world
How to best present yourself as a candidate?
Not score, GPA, and other things - people love to build, build, and they have side projects, summer internship, and build apps and done in past roles.
Builder mentality - something broken up internal - hashtag - feed family
internal - every day and all days
Share authentically - what her illness - her plan for treatment - rally around, hundreds comment
One thousand people - people tagged the video - caught on fire
Good culture - how close we are, feel like a family
10,000 or 15,000 employees - maturity - large people - how to grow
Everyone owns Facebook culture -
What is roadmap?
Culture team - 10,000 contributes to it.
Policy?
Parental leave - some of those approaches - spread around US - inspire other organaization
primary goal
Conscious bias -
7 Common Mistakes in the Coding Interview (for Software Engineers)
Strong hire signal - bias on not hiring-wrong-one
Humanity to accept the help
Ask around to get help
Show friendly professionalism
Get to know better
Subconscious help you out
Team work spirit
Not preparing - Two technical things
Team work, behavior
Through 4 hours, 4 stories to refer to
Any story - two hours - prepare stories before hand.
How did you define API?
How to use the ...
First 10 minutes -
Spending all the time on one problem - that is not the question for you, follow up question and second
Plow through the question
Make sure that you work fast, and you can pack in as much time as you can
Remember to write the code
Mix some really code with pseudo code
Take picture - credit you can get as you should be ...
Resume - write a feedback, interviewer will take resume as help to write feedback
Interviewer ...
Not focus on analysis enough - college does not teach you enough - time and space analysis
What you are even writing - even it is working
Didn't we talk about the analysis
Bonus tip:
Enjoy the lunch
Prepare technical before the interview
Notes taken by one viewer:
1. Not get a referral 2. Discouraged by refusal and stop applying. Should keep applying 3. Focus only on the tech. Should also show your friendly professionalism and that you're nice to work with 4. Not preparing. Should prepare 2 technical things + 2 personal stories to show your teamwork/leadership/communication capabilities, behavior, personalities 5. Spend time on one problem. Plow through all the question 6. Should write the code down to explain, not just hand waving. Use your resume as a reference when talking. 7. Not focus on analysis enough
Interviewing.io: Coding Interview | Software Engineer @ Facebook
Two algorithms:
First one is tree algorithm - first 16 minutes
Binary tree - find average for each level
The idea is to use BFS, using queue, get count of level nodes, and sum of level node's values.
Second one is to find minimum distance to gates.
Given a 2d matrix nxm size
unfilled calls: 0
walls: -1
gates: -2
Run BFS algorithm, put all -2 on the queue, and then run BFS algorithm to mark nodes with 0 using minimum distance.
The interviewee took DFS approach which is not optimal. Last 5 minutes interviewer gave him the hint to put all -2 on the queue, and then visit all neighbors, put all those neighbors in the queue, level by level order traversal.
Interview structure: CRACKING the CODING INTERVIEW
What is expected : Cracking the Facebook Coding Interview The Approach
52:46/ 1:49
What is expected
Be excited about hard problems
Drive!
Keep trying when stuck
More than just "correct"
Pay attention to me!
Write real code
Show me how you think
Drive me great solution - Keep trying when you are stuck
Red flag - Get stuck! Do not know how to solve it.
Keep trying - get stuck - it is normal to get stuck
Pay attention to me - pay attention to interviewer
Are you sure it works? Are you sure you need two arrays?
Leetcode discuss: 34. Find First and Last Position of Element in Sorted Array
C# binary search algorithm practice on June 26, 2020
It is my most favorite algorithm. I failed so many times and I like to emphasize the testing, simple thing like reading my own code after the completion of the code.
I spent near one hour to code and fix the bugs. I even ran visual studio debugger for a few minutes.
public class Solution {
public int[] SearchRange(int[] nums, int target) {
if(nums == null || nums.Length == 0)
return new int[]{-1,-1};
var start = applyBinarySearchLeftmost(nums, target);
var end = applyBinarySearchRightmost(nums, target);
return new int[]{start, end};
}
/// leftmost
/// rightmost
// [2, 2]
private int applyBinarySearchLeftmost(int[] nums, int target)
{
// apply binary search
var length = nums.Length;
var start = 0; // 1
var end = length - 1; //1
while(start <= end)
{
var middle = start + (end - start)/ 2; // 0
var middleValue = nums[middle]; // 2
var findTarget = middleValue == target;// 2
if(findTarget)
{
if(middle == start || (middle == 0 || nums[middle - 1] != middleValue))
{
return middle; // 0
}
else
{
end = middle - 1;
}
}
else if(target < middleValue)
{
end = middle - 1;
}
else
{
start = middle + 1;
}
}
return -1;
}
// [2, 2]
// [1, 2, 3]
private int applyBinarySearchRightmost(int[] nums, int target)
{
// apply binary search
var length = nums.Length;
var start = 0;
var end = length - 1;
while(start <= end) // 0, 0
{
var middle = start + (end - start)/ 2; // 0
var middleValue = nums[middle]; //0 - [1, 2, 3], 1 return [0, 1], should be [0,0], not start
var findTarget = middleValue == target; // true
if(findTarget)
{
if(middle == end || nums[middle + 1] != middleValue) // change middle == length - 1 to middle == end
{
return middle; // 0
}
else
{
start = middle + 1; // caught by [2,2], 2 - time limit exceeded, start = middle + 1, not start = middle - 1;
}
}
else if(target < middleValue)
{
end = middle - 1; // 0
}
else
{
start = middle + 1;
}
}
return -1;
}
}
Leetcode discuss: 1110. Delete Nodes And Return Forest
C# mock interview practice on June 26, 2020
Introduction
Given a binary tree with distinct value in each node, given an integer array, delete those nodes in the tree, and return all trees with root node.
- Find those nodes to be deleted;
- Set those nodes's left and right child to null;
- Also, if the node has a parent node, then the parent node should also be updated with left or right child node and set to null if need.
public class Solution {
public IList<TreeNode> DelNodes(TreeNode root, int[] to_delete) {
if(root == null)
return new List<TreeNode>();
var list = new List<TreeNode>();
var set = new HashSet<int>(to_delete);
TreeNode parent = null;
applyPreorderTraversal(root, list, parent, set);
return list;
}
private void applyPreorderTraversal(TreeNode root,IList<TreeNode> list, TreeNode parent, HashSet<int> set )
{
if(root == null)
return;
var current = root.val;
if(parent == null || set.Contains(parent.val))
{
if(!set.Contains(current))
{
list.Add(root);
}
}
applyPreorderTraversal( root.left, list, root , set );
applyPreorderTraversal( root.right, list, root, set );
// set null pointer
if(set.Contains(current))
{
root.left = null;
root.right = null;
}
if(root.left != null && set.Contains(root.left.val))
{
root.left = null;
}
if(root.right != null && set.Contains(root.right.val))
{
root.right = null;
}
}
}