Sunday, December 6, 2020

Monotonic increasing - stack

 骨骼面试有一类比较Tricky的题目,即单调队列 Monotonic Queue / 单调栈 Monotonic Stack

通过单调队列,可以把复杂度降到O(n),主要覆盖Stack, Sliding Window, Two Pointers, Linked List/Queue, HashTable/HashMap等算法和数据结构,分类参考主贴

https://www.1point3acres.com/bbs/thread-649468-1-1.html

6个月内
LC42. Trapping Rain Water
LC84. Largest Rectangle in Histogram (单调递增栈)
LC122. Best Time to Buy and Sell Stock II   
LC239. Sliding Window Maximum (有界最大值单调递减栈)
LC496. Next Greater Element I
LC862. Shortest Subarray with Sum at Least K (单调递增栈)
LC1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

LC907. Sum of Subarray Minimums, 
LC1019. Next Greater Node In Linked List, 

Algorithms to review: Dec 6 2020 Last six months

 分类整理

https://www.1point3acres.com/bbs/thread-649468-1-1.htm
分贴(一)分类整理追加单调队列
https://www.1point3acres.com/bbs/thread-651314-1-1.html
分贴(二)分类整理之Stack栈
https://www.1point3acres.com/bbs/thread-683612-1-1.html

6个月内
Easy 1592, 1170, 415, 387, 345, 157, 38,  20,14
Medium 791, 22,647,609,49,249,833,159,1138,767,17,227,93,722,43,809,3,5,165,
Hard 527, 72, 340, 76, 158, 214, 68, 10, 44

6个月前
Easy  800,293,521,1422, 1544,520,758,551, 925,
Medium  544, 890, 1525,1016,1062,1618,1023,1452,583,816,809,1461,1513,385,1616,522,686,271,
Hard 632, 736, 1316, 1585, 1449, 1392, 591

Hard level
214. Shortest Palindrome
KMP algorithm - Explanation in Chinese, here is the link. 
68 Text Justification
632. Smallest Range Covering Elements from K Lists

Study grandyang leetcode blog. 

Algorithm to think about: Math question is hard

 有一个是二维平面无数点,找出其中一条线,然后能够平均分配所有点,以及所有点到这条线的距离和最短

Algorithm practice: FANG onsite

 coding1: 利口意思而散,做完没问followup直接出了一道挺经典的背包dp。常规的问了复杂度,最开始脑抽了说错,面试官提示之后赶紧改正。两道题都bug-free,所以自我感觉还好。


coding2: 不是LC原题,但是是道典型的backtracking题,蛮类似sudoku solver,就不复述具体题目细节了。bug-free

coding3: 依然不是LC原题?(是真的背,我看很多rp好的面经全是高频题怎么回事emm),在一个排好序的数组中找到出现次数超过总数1/4的数字。一开始只想到brute-force的做法,没想到怎么logN。面试官提示了一下,想到基于二分查找就可以。然后写完有个小bug赶在面试官发现之前先改过来了。这一轮的面试官无精打采呵欠连连,搞得我也一头雾水不知道自己答的如何,再加上没问followup,就很虚。但考虑到最后几分钟面试官让我给code加了一些注释,还让我把复杂度啥的都明确注释在了doc里,个人猜测应该至少是个baseline的评价吧,如果是负面的那应该不用花时间让我的doc看起

1423. Maximum Points You Can Obtain from Cards

07 SITUATIONAL Interview QUESTIONS and ANSWERS! (PASS)

 Here is the link. 


Linda Raynier: Interview Tips to Get the Job | 5 Things You Need to Ace the Interview

 Here is the link. 

In this video I'm going to go through 5 things that recruiters, hiring managers, and interviewers look for during the interview. This includes communication ability, energy level, fit, you can do the job and you genuinely want this job. If you've been asking "how to get hired", "interview tips to get the job", "interview strategies to get hired", or "how to ace the interview", then this video is for you!

02:10 - Ability to communicate. 04:44 - Your energy level. 07:09 - They want to know that you’re a FIT for the company and culture. 11:03 - They want to know that you can do the job. 14:08 - They want to know that you genuinely want this job.



Life at Google: Prepare for Your Google Interview: Troubleshooting and Scripting

 Here is the link. 

Googlers share targeted advice for the troubleshooting and scripting aspects of Google's interview process for technical and engineering candidates. This video will cover tips for communication and collaboration, troubleshooting and scripting, and overall best practices! Skip ahead to: 0:17 Communication and Collaboration 1:06 Troubleshooting 2:41 Scripting 3:37 Best Practices


  1. Is it readable?
  2. Clarify
  3. Can you test the code?
  4. Can the code handle the error
  5. Improve
  6. Practice
Be sure to ask questions
Troubleshooting
Trouble shoot ...... logic steps
  • Examine
  • Trouble shoot
  • Gather your thoughts
Diagnosis:
  • Hypothetical
More on problem solving 
Scripting:

Life at Google: Prepare for Your Google Interview: Coding

 Here is the link. 

Googlers share targeted advice for the coding portions of Google's interview process for technical and engineering candidates, covering tips for communication and collaboration advice, algorithms and data structures, and more! Skip ahead to: 0:24 Communications and Collaboration 1:30 Algorithms and Data Structures 3:17 Coding 4:03 Testing and Error Checking 4:37 Best Practices

At least you run through one or two test cases, and make sure that the code works.

Life at Google: How we hire at Google

 Here is the link. 

Brinleigh, a business recruiter at Google, and Okwus a technical recruiter, share details about how we hire at Google, walk you through the process, and bust some myths!

Four attributes:

  • general cognitive ability
  • Role-related knowledge
  • Leadership
  • Bias for action



Framework: Prepare for your Google Interview: Tips and Example General Cognitive Ability Question

 Here is the link. 

Googlers Jodie and Kelsey share details about the general-cognitive-ability aspect of the Google interview process and walk through a sample Google interview question.

Google is made up of great people

  • How a candidate thinks
  • Leadership skills
  • Role-related knowledge
  • Googleyness
Past behavior questions -
Hypothetical - real life google situation

Evaluation of your problem solving skills
Insight into your problem skills

What is Google assessing?
  • Understanding of the question
  • Preparation strategy
  • Ability to identify solutions
  • Justification for a specific solution
  • Communication
How to build a strong response
  • Take a moment before responding
  • Ask clarification questions
  • Share logical assumptions
  • Show your work
  • Consider the pros and cons
  • Think about how you measure success
  • Tie it back to the role

Linda Raynier: How to Stop Being Shy (Communicate with Confidence)

 Here is the link. 

In today’s video, I’m going to teach you my 4 tips on how you can reduce your level of shyness when talking to people, including co-workers, your boss or anyone you meet! Shyness is a completely natural reaction and you shouldn’t beat yourself up because you tend to be shy in front of others, but today, I really want you to understand where shyness REALLY comes from…and teach you my 4 tips on how to overcome it. If you've been asking "how do I get rid of my shyness", "how to be less shy", then this video is for you!

  1. Adopt a curious mindset - ask questions, learn from other person
  2. Elaborate - reason No. 1, 2, 3, a good story to share
  3. ...
  4. Be present. Listen carefully.




Linda Raynier: How to Search for a Good Candidate - How to Recruit a Good Job Candidate (2 of 5)

 Here is the link.

Today’s episode is 2 of a 5 on How to Recruit a Good Job Candidate. In today’s video, I’ll be teaching you my 4 tips on how to find, locate and search for good job candidates if you’re trying to hire the perfect person for your company. If you've been asking "how to find the best job candidate", "how to search for the best candidate", then this video is for you!