It's a pretty rewarding week, learning various stuff and even applying some concepts to my personal website. I'm off for holidays next week though, looking forward!
But for now, here are the topics again:
- Leetcode
- JS Coding
- System Design / JS Theory
- Behavioural
1. Leetcode
- [Mon] Partition Equal Subset Sum
Dynamic Programming
, seemingly a 0/1 knapsack problem. DP is difficult still :x - [Tue] Easy question, so I did another Medium. Good day!
- [Wed] Done Minimum Operations to Make Array Values Equal to K (E). Attempted Smallest Range II (M)
- [Thu] Attempted Count the Number of Powerful Integers (H)
- [Fri] Easy question
2. JS Coding
- [Mon] Did
useInputControl
(M) anduseClickAnywhere
(E)! Re-attemptedMap Async Limit
successfully! - [Tue] Attempted
Middlewares
,Cycles
, anduseCounter II
! - [Wed] Did
useCycle
,useSet
anduseTimeout
! - [Thu]
Min By (E)
andCount By (M)
! AttemptedgetElementsByClassName (M)
- [Fri] work problems... Using a ref to pass between data
3. System Design / JS Theory
- [Mon] Try quick-fire 10 questions.
- Revised 6:
== vs ===
,event delegation
,Virtual DOM
,cookies, localStorage & sessionStorage
,hoisting
, and-
cookies
are sent on every request, first sent by server
-
- Studied 4:
func.bind
,event capturing
,What's JSX
,error handling for async functions
- Revised 6:
- [Tue] Quick-fire optimisations! UX: Lazy Loading, Skeleton Loading, Silent Loading, Image fixed width and height for CLS, Error Prompts, Virtualised Lists, Caching (Redis / LocalStorage). Accessibility:
Dark Mode
, Aria Labels /Lang for screen reader
, Button navigation and execution. Security: disable CORS,sanitize inputs (React default)
. SEO:meta tag with description
.-
Content-Security-Policy
HTTP Header to define trusted source of scripts and resources, reducing change of XSS attacks. A good resource. Example:Content-Security-Policy: script-src ‘self’
-
- [Wed] Yesterday's security article and a bit on keyloggers, and some CSRF best practices by OWASP, basically a per-request token sent in the HTTPS headers.
- [Thu] -rest-
4. Behavioural
- [Mon] 4 questions with back-and-forth answered today! Feeling confident
- [Tue] 5 questions today! Feels great, and I find I have more stories as the questions come along. But perhaps I should constrain myself to the 7 - 10 stories I have and apply them to different questions. Otherwise I might not be able to follow STAR format
- [Wed] 4 questions!
- [Thu] -rest-
- [Fri] -rest-