Profile (JYHSIA)
Hsia, Jui-Yang (夏睿陽)
2021 Weekly Challenge !!
Seek More Challenge Score “The day we stop learning is the day we die” by Michael Scott, The Warlock
Become a Top SWE (Read it evaryday!)
Evaluation Result
“Understanding what is true is essential for success, and being radically transparent about everything, including mistakes and weaknesses, helps create the understanding that leads to improvements.” by Ray Dalio.
Plan & Note
Week 18 (5/10)
5 / 14
SYSTEM instructions are used to access system functionality that might require privileged access and are encoded using the I-type instruction format. These can be divided into two main classes: those that atomically read-modify-write control and status registers (CSRs), and all other potentially privileged instructions.
5 / 13
- Prep for team match
- Understand Google big goal and direction
- Get list of team and project details
- Prepare question to ask
- Prject fit with Google Goal
- todo
- OS
- For fun and secret goal (wwwwwwwwwwww).
verilog
5/ 12
- verilog info
verilog versionverilog tutorial - clash documentation
- haskel installation
- clash installation
verilog developer: Prabhu Goel, Phil Moorby, Chi-Lai Huang, and Douglas Warmke company: Cadence Design Systems, Inc.
Algo
- Kuhn’s Algorithm for Maximum Bipartite Matching
- base version
- O(node^2) version
- https://codeforces.com/blog/entry/17023
- https://codeforces.com/blog/entry/58048
- Hopcroft–Karp Algorithm
Quates I am pondering
“So just going all the way down. Understanding everything under you. It’s really important to not abstract away things. You need to have a full understanding of the whole stack.” by Andrej Karpathy video
Week 17 (5/3)
Week 16 (4/26)
Funny stuff
- submit attendance record (5/5(三)下午5:00前繳交4月份助教出勤記錄表至R205系辦公室)
- ca homework 4 (Due: May 5 by 2:20pm) (draft finish before Sun. Dived into details in Mon. night & Tue. morning! Otherwise, what’s the point of doing something that can be easily achieved. It’s not intersting and optimal.)
- MS interview
- G interview
- CA mid exam score reveal.
Distraction (tag: mindset)
Material source:
- Indistractable: How to Control Your Attention and Choose Your Life
- fs blog: Nir Eyal: Mastering Indistraction
prob:
- is distracted from “pre-defined task”
- s1: understand the underlying emotion
- s2: finding the root cause of emotion
- s3: resolving the emotion
ex:
- anxiety about the way I practice.
- fear about choosing the wrong problem to practice and fail the interview
- unable to focus on training
- seek dopamin releasing activity (ex: youtube, manga, …, etc) or do sub-optimal task (ex: replying email, do noncritical paper work, …, etc)
sol:
- define meta goal above interview (ex: acheiving international grandmaster in codeforce)
- define why meta goal should be acheived (ex: acquire a solid algo foundation, practice to master a skill)
- remind myself about the meta goal. Anything else is unnecessary.
- build training task based on the meta goal.
exec: Meta training.
- Learn all algo in E-Maxx Algorithms in English.
- Learn all algo in 挑戰程序設計競賽2 : 算法和數據結構.
Quate I am Pondering
Source: Stoic Quotes On Confronting And Discarding Anxiety
When I see an anxious person, I ask myself, what do they want? For if a person wasn’t wanting something outside of their own control, why would they be stricken by anxiety? — Epictetus
“Caretake this moment. Immerse yourself in its particulars. Respond to this person or that person, this challenge, this deed. Quit the evasions. Stop giving yourself needless trouble. It is time to really live; to fully inhabit the situation you happen to be in right now. You are not some disinterested bystander. Participate. Exert yourself.” — Epictetus
Man is not worried by real problems so much as by his imagined anxieties about real problems. — Epictetus
“It’s ruinous for the soul to be anxious about the future and miserable in advance of misery, engulfed by anxiety that the things it desires might remain it’s own until the very end. For such a soul will never be at rest— by longing for things to come it will lose the ability to enjoy present things.” — Seneca
Don’t let your reflection on the whole sweep of life crush you. Don’t fill your mind with all the bad things that might still happen. Stay focused on the present situation and ask yourself why it’s so unbearable and can’t be survived. —…
Week 15 (4/19)
Reflection
- master theorem is not familiar with.
training tag
1. tarjan
2. scc
- kosaraju
4. hamilton
5. mst
- kruskal
- prime
6. euler path
7. Hungarian Algorithm
backtrack *
graph ****
tree *
dfs *
bfs
trie
recursion
3. div & conquer *
4. dp ***
6. stack (calculator)
8. string *
20. rolling hash *
21. Suffix Array *
22. suffix array + lcp *
use scc to convert graph to dag
- scc
- remove self-loop
- remove duplicate edge
dfs graph edge classification:
- tree edge
- back edge
- forward edge
- cross edge
good material source
Reflection
- Problem oriented training is more efficient to master a knowledge.
- Support with high-level knowledge guide map.
interesting stuff
David Eagleman: https://eagleman.com/
Rahul Jundial: http://drjandial.com/
Max Lugavere: https://www.maxlugavere.com/
Moran Cerf: https://www.morancerf.com/
V.S. Ramachandran: http://cbc.ucsd.edu/ramabio.html
Andrew Huberman: https://www.hubermanlab.com/
Week 14 (4/12)
Bellman ford- dp[i][k] + dp[k][j] can overflow if initialize is INT_MAX
- remember to init dp[i][i] = 0
Tree seg- Odd even middle
MST
training tag
backtrack *
tree
dfs
bfs
graph
trie
recursion
3. div & conquer
4. dp
6. stack (calculator)
8. string *
20. rolling hash
21. Suffix Array
opt tag
22. geometry
19. line swap
2. bisearch
11. union find
16. orderedmap
7. bit munipulation
15. minmax
18. random
19. sufix-array linear complexity algo SA-IS
20. RMQ sparse table
21. Ukkonen's algorithm is a linear-time, online algorithm for constructing suffix trees
Week 12 (3/29)
-
Result
-
Plan
Goal: catch blind spot
Task | Reason | Consequence of no doing | Progress |
---|---|---|---|
Codeforce Div1 ABCD | pushing the limits | live in the bubble | 4 / 5 |
equal range templeate | concrete the implementation | unstable implementation | 1 / 1 |
Fenwick tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
Suspended | —– | —– | —– |
seg tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
rolling hash template | concrete the implementation | unstable implementation | 0 / 1 |
suffix array | concrete the implementation | unstable implementation | 0 / 1 |
doubly linked list template | concrete the implementation | unstable implementation | 0 / 1 |
scc template | concrete the implementation | unstable implementation | 0 / 1 |
dfs template | concrete the implementation | unstable implementation | 0 / 1 |
- Not familiar tags
- string
- dp
- divide and conquer
- bi search implementation
Week 12 (3/22)
-
Result
-
Plan
Goal: catch blind spot
Task | Reason | Consequence of no doing | Progress |
---|---|---|---|
Codeforce Div1 ABCD | pushing the limits | live in the bubble | 4 / 5 |
equal range templeate | concrete the implementation | unstable implementation | 0 / 1 |
Fenwick tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
seg tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
rolling hash template | concrete the implementation | unstable implementation | 0 / 1 |
suffix array | concrete the implementation | unstable implementation | 0 / 1 |
doubly linked list template | concrete the implementation | unstable implementation | 0 / 1 |
scc template | concrete the implementation | unstable implementation | 0 / 1 |
dfs template | concrete the implementation | unstable implementation | 0 / 1 |
Suspended | —– | —– | —– |
- Not familiar tags
- string
- dp
- divide and conquer
- Reflection
- OS & Network knowledge
Week 11 (3/15)
-
Result
-
Plan
Goal: catch blind spot
Task | Reason | Consequence of no doing | Progress |
---|---|---|---|
Codeforce constext ABCD | pushing the limits | live in the bubble | 4 / 5 |
dp 4 | confront the weakness | slow learning curve | 3 / 4 |
divide and conquer 4 | confront the weakness | slow learning curve | 1 / 4 |
string 4 | confront the weakness | slow learning curve | 0 / 4 |
gcd, floor, ceil function | confront the weakness | slow learning curve | 1 / 1 |
equal range templeate | concrete the implementation | unstable implementation | 0 / 1 |
Fenwick tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
seg tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
rolling hash template | concrete the implementation | unstable implementation | 0 / 1 |
suffix array | concrete the implementation | unstable implementation | 0 / 1 |
doubly linked list template | concrete the implementation | unstable implementation | 0 / 1 |
scc template | concrete the implementation | unstable implementation | 0 / 1 |
dfs template | concrete the implementation | unstable implementation | 0 / 1 |
Suspended | —– | —– | —– |
- Not familiar tags
- string
- dp
- divide and conquer
- Reflection
- OS & Network knowledge
- rethink edu16D solution
Week 10 (3/8)
-
Result
-
Plan
Goal: catch blind spot
Task | Reason | Consequence of no doing | Progress |
---|---|---|---|
Codeforce constext ABCD | pushing the limits | live in the bubble | 4 / 4 |
Practice problems from not ready tags | confront the weakness | slow learning curve | 6 / 16 |
equal range templeate | concrete the implementation | unstable implementation | 0 / 1 |
Fenwick tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
seg tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
rolling hash template | concrete the implementation | unstable implementation | 0 / 1 |
suffix array | concrete the implementation | unstable implementation | 0 / 1 |
doubly linked list template | concrete the implementation | unstable implementation | 0 / 1 |
scc template | concrete the implementation | unstable implementation | 0 / 1 |
dfs template | concrete the implementation | unstable implementation | 0 / 1 |
Suspended | —– | —– | —– |
- Not familiar tags
- string
- dp
- divide and conquer
- rethink edu16D solution
- Reflection
- OS & Network knowledge
Week 9 (3/1)
-
Result 80
-
Plan
Goal: catch blind spot
Task | Reason | Consequence of no doing | Progress |
---|---|---|---|
Codeforce edu 8 virtual | pushing the limits | live in the bubble | 7 / 8 |
Binary search template | concrete the implemenatation | unstable implementation | 1 / 1 |
equal range templeate | concrete the implementation | unstable implementation | 0 / 1 |
Fenwick tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
seg tree templeate | concrete the implementation | unstable implementation | 0 / 1 |
rolling hash template | concrete the implementation | unstable implementation | 0 / 1 |
suffix array | concrete the implementation | unstable implementation | 0 / 1 |
evaluate USACO | explore more materials | live in the bubble | 0 / 1 |
Suspended | —– | —– | —– |
- Reflection
- power(x) function
- in prime ring a^(p-1) = 1 => a^(-1) = a^(p-2)
- OS & Network knowledge
- dp scare the crap out of me
- uneasy about backtrack
- doubly link list template
- backpack problem
- dfs template
- circle detection template
- scc template
Week 8 (2/22)
- Plan
Goal: catch blind spot
Task | Reason | Consequence of no doing | Progress |
---|---|---|---|
Mock 5 round | Don’t hide from reality | Not improving | 4/ 5 |
codeforce edu 4 | Practice more harder problem set | Life in lie | 3 / 4 |
Suspended | —– | —– | —– |
List all basic data structure & practice it if I am not familiar with it | High-level review my week spot | growing blind spot | 0 / all |
Redo problem over 100 readiness score. Target number is 45. | Review past failure and overcome it. | Not improving. | 3 / 45 |
- Reflection
- review binary search template
- create code template for equalrange
- Fenwick tree / seg tree
- USACO
- Rolling hash
typedef long long int lli;
lli m = 10e9+9;
lli p = 31;
lli hash( const string &s ){
lli res = 0;
for(int i = 0; i < s; i++){
res = (res * p + (s[i] - 'a' + 1) ) % m;
}
return res;
}
Week 7 (2/15)
- Plan
task | reason | consequence of no doing |
---|---|---|
Break the bubble (Do 2 sim-interview) | The fear of being wrong should be overcome | Growing Blindspot |
Find seg tree & KMP problem | I need to practice for interview | 1. don’t get a job |
I already commited to CJ that I will take TA position. | 1. piss of CJ leave lab |
|
Compiel Gauss Newton PDF | I feel like I have to complete a thing if it has stared feel guilty about taking money without doing research |
1. piss of CJ leave lab |
Suspended | —– | —– |
Google Problem (40) | I need to practice for interview | 1. don’t get a job |
- Reflection
- Each time think of recursive problem, think of dynamic programming.
- The burn out principle work! Keep that rule.
- Code book.
Week 6 (Spring festival)
- I feel like that I stuck in between ‘I should work’ & ‘I don’t feel like to’.
- Result: read books / youtube / netflix
- Kind of feel guilty about not working. (Expetation / Reality mismatched )
- Overestimated my ability to overcome the enviroment factor (Comformity)
Conformity is the act of matching attitudes, beliefs, and behaviors to group norms, politics or being like-minded. Norms are implicit, specific rules, shared by a group of individuals, that guide their interactions with others.
-
I do not have a strong why to take spring festival. This may leads to that I don’t feel that I ‘live’ my life.
- Binary Search
int left = 0, right = nums.size() - 1; while(left <= right){ // Prevent (left + right) overflow int mid = left + (right - left) / 2; if(nums[mid] == target){ return mid; } else if(nums[mid] < target) { left = mid + 1; } else { right = mid - 1; } } /* sub len break? mid lsub llen rsub rlen [0,-1] -1 y [0,0] 1 n 0 [0,-1] -1 [1,0] -1 [0,1] 2 n 0 [0,-1] -1 [1,1] 1 [0,2] 3 n 1 [0,0] 1 [2,2] 1 [0,3] 4 n 1 [0,0] 1 [2,3] 2 [0,4] 5 n 2 [0,1] 2 [3,4] 2 */
int left = 0, right = nums.size();
while(left < right){
// Prevent (left + right) overflow
int mid = left + (right - left) / 2;
if(nums[mid] == target){ return mid; }
else if(nums[mid] < target) { left = mid + 1; }
else { right = mid; }
}
/*
sub len break? mid lsub llen rsub rlen
[0,-1) -1 y
[0,0) 0 y
[0,1) 1 n 0 [0, 0) 0 [1, 1) 0
[0,2) 2 n 1 [0, 1) 1 [2, 2) 0
[0,3) 3 n 1 [0, 1) 1 [2, 3) 1
[0,4) 4 n 2 [0, 2) 2 [3, 4) 1
*/
int left = 0, right = nums.size() - 1;
while (left + 1 < right){
// Prevent (left + right) overflow
int mid = left + (right - left) / 2;
if (nums[mid] == target) {
return mid;
} else if (nums[mid] < target) {
left = mid;
} else {
right = mid;
}
}
/*
sub len break mid lsub lLen rsub rLen
[0,-1] 0 y
[0,0] 1 y
[0,1] 2 y
[0,2] 3 n 1 [0,1] 2 [1,2] 2
[0,3] 4 n 2 [0,2] 3 [2,3] 2
[0,4] 5 n 2 [0,2] 3 [2,4] 4
*/
Week 5 (2/15)
- Algorithm
- read problem and test cases!! Don’t rush to write code.
- KMP algo.
- segmentation tree structure
- reduced segmentation tree structure
- binary search termitation condition
Week 4 (Burnout)
- Unsuccessful defense against bunrout:
Consequences:
- Unproductive at Fri, Sat and Sun.
- Feel bad about myself.
- Disrupted life style (poor sleep quality / bing-watch Netflix & Youtube / Insufficient excercise )
Possible sourece:
- Gauss-Newton EXP
- Interview meeting with Google HR.
- Interview bomb from Shoppee.
- Lab funding plan and reimbursement.
- Unintended commitment toward software development.
- Uncatched self-challenged progress.
- Extensive working on CV, which is deeply related to my self-worth and validation.
Possible solution:
- Seek out companion to reduce anxiety.
- Prioritize and Execute. Remake a workable schedule.
- Meditation and Exercise.
Week 3
- The relation between level and node of tree:
level 0: 2^(0+1) - 1 = 1
level 1: 2^(1+1) - 1 = 2
…
level k: 2^(k+1) - 1
- Not familiar with recursion struction:
The function may contain (state) and in the function needs a terminatoin criteria.
“Backtracking is a rather typical recursive algorithm, and any recursive algorithm can be rewritten as a stack algorithm.” from (https://www.cis.upenn.edu/~matuszek/cit594-2012/Pages/backtracking.html)
-
Common prefix of a set of strings : Trie.
-
LinkList-hashmap structure:
O(1) query from key
O(1) swap any two element order
O(1) remove head or tail element
-
C++ random generator (TODO)
-
encode integer to string (TODO) 297 Serialize and Deserialize Binary Tree