ð§ ELI5: A SQL database is like a super organized binder with divider tabs where everything goes in exactly the right slot; a NoSQL database is like a big backpack where you can throw in anything â a book, a lunchbox, a basketball â whatever shape it is.
Space Optimization: We can do this in O(1) extra space (output array doesn't count) by computing prefix in the output array first, then multiplying suffix on-the-fly from right to left.
ð Python Solution / Python è§£æ³
def productExceptSelf(nums: list[int]) -> list[int]:
n = len(nums)
answer = [1] * n
# Pass 1: Fill answer[i] with the PREFIX product (product of everything LEFT of i)# After this pass: answer = [1, 1, 2, 6] for input [1, 2, 3, 4]
prefix = 1for i in range(n):
answer[i] = prefix # store product of everything before i
prefix *= nums[i] # update running prefix# Pass 2: Multiply answer[i] by the SUFFIX product (product of everything RIGHT of i)# We traverse right-to-left, tracking running suffix product
suffix = 1for i in range(n - 1, -1, -1):
answer[i] *= suffix # multiply in the suffix product
suffix *= nums[i] # update running suffixreturn answer
# Test it:
print(productExceptSelf([1, 2, 3, 4])) # â [24, 12, 8, 6]
print(productExceptSelf([-1, 1, 0, -3, 3])) # â [0, 0, 9, 0, 0]
ð§ ELI5: If you have 4 friends and you want to know how many handshakes happen when you're NOT included, you count all the handshakes to your left, then all the handshakes to your right, and multiply them together â that's your answer!
ð£ïž
ð£ïž Soft Skills
ð£ïž 蜯æèœ Day 7 (2 min read) / Soft Skills Day 7
âŒ
ð£ïž 蜯æèœ Day 7 (2 min read) / Soft Skills Day 7
Technical Leadership: "Tell me about a time you simplified a complex system"
This question tests whether you can identify the root of complexity, have the courage to push for change, and understand the tradeoffs of simplification.
STAR Framework Breakdown / STAR æ¡æ¶æè§£
Situation (æ å¢):
æè¿°ç³»ç»ç¶æ + 䞺ä»ä¹å®å倿äº
å ³é®ä¿¡æ¯ïŒç³»ç»è§æš¡ãå¢éèæ¯ã倿æ§çåå²åå
Scenario Template to Adapt / å¯å€çšåºæ¯æš¡æ¿
Context: [ç³»ç»å] had grown from [åå§ç¶æ] to [åœåç¶æ] over [æ¶éŽ],
resulting in [å ·äœé®é¢].
My Role: As [äœ çè§è²], I was responsible for [èåŽ].
The business impact was [圱å] â [éå].
Diagnosis: I [è¯ææ¹åŒ â ç»åŸ/远éŸè·¯/åæææ ], and identified that
the core source of complexity was [æ ¹æ¬åå ].
Solution: I proposed [æ¹æ¡], which addressed [æ žå¿é®é¢] while
preserving [å¿ é¡»ä¿çç倿æ§åå ].
Risk Management: To validate, I [éªè¯æ¹æ³]. For rollout, I [è¿ç§»çç¥].
Result: [å®éç»æ 1], [å®éç»æ 2], [å®éç»æ 3].
ð§ ELI5: Simplifying a complex system is like cleaning your messy backpack â you take everything out, throw away what you don't need, and put the rest back in a way that makes it easy to find your pencil without dumping everything on the floor.
A) 20px from the top of the page, 30px from the left of the page
B) 20px from the top of .container, 30px from the left of .container â â
C) 20px from the top of the viewport, 30px from the left of the viewport
D) It won't move â absolute positioning only works without a parent
Answer: B â because .container has position: relative, it becomes the containing block for .box.
ðºïž Visual Map of All 4 Positioning Modes
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â WEBPAGE â
â â
â âââââââââââââââââââââââââââââââââââââââ â
â â position: relative â â
â â ââ stays in flow â â
â â ââ offset from WHERE IT WOULD BE â â
â âââââââââââââââââââââââââââââââââââââââ â
â â
â âââââââââââââââââââââââââââââââââââââââ â
â â position: absolute â â
â â âââââââââââââââââââââââââââââââ â â
â â â nearest positioned ancestor â â â
â â â â offsets from HERE â â â
â â âââââââââââââââââââââââââââââââ â â
â âââââââââââââââââââââââââââââââââââââââ â
â â
â ââââââââââââââââââââââââââââââââââââââââ â VIEWPORT TOP â
â â position: fixed â â
â â ââ always relative to VIEWPORT â â
â â ââ stays even when you scroll â â
â ââââââââââââââââââââââââââââââââââââââââ â
â â
â âââââââââââââââââââââââââââââââââââââââ â
â â position: sticky â â
â â ââ relative UNTIL you scroll â â
â â past threshold â then FIXED â â
â âââââââââââââââââââââââââââââââââââââââ â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Code Examples / 代ç 瀺äŸ
/* 1. RELATIVE â offset from its normal position, stays in document flow */.badge{
position: relative;
top: -2px; /* nudge up 2px from where it would normally sit */ /* still takes up its original space in the layout! */
}
/* 2. ABSOLUTE â removed from flow, positioned relative to nearest
positioned ancestor (or <html> if none exists) */
.tooltip{
position: absolute;
top: 100%; /* just below the parent */left: 50%;
transform: translateX(-50%); /* center it */ /* KEY: the parent must have position: relative! */
}
/* 3. FIXED â always relative to the viewport, never scrolls away */.navbar{
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000; /* stay above everything */
}
/* 4. STICKY â hybrid: relative until threshold, then fixed */.section-header{
position: sticky;
top: 60px; /* becomes "fixed" 60px from top once scrolled past */background: white;
z-index: 10;
}
/* Common bug: forgot to add position: relative to parent */.card{
/* position: relative; â forgot this! */
}
.card .badge{
position: absolute;
top: 10px;
right: 10px;
/* This badge will now position relative to the page, not .card! */
}
ð§ ELI5: CSS positioning is like choosing where to put your toys â relative means "move a little from where you already are," absolute means "go to a specific spot inside your room," fixed means "stay on the door no matter where I walk," and sticky means "follow me around, but only once I've passed a certain point."
ð€
ð€ AI
ð€ AI Day 7 (2 min read) â AI æ°é»éé / AI News Roundup
âŒ
ð€ AI Day 7 (2 min read) â AI æ°é»éé / AI News Roundup
ð§ ELI5: This week in AI: robots are learning to be internet safety guards, phone chips are getting a huge upgrade to handle smarter AI, someone figured out how to make AI chats private like a secret code, and AI assistants are learning to speak in different accents â even British English!