lin's Avatar

lin

@symsys.bsky.social

currently doing #100Days of Frontend & Design Engineering πŸ’» Sharing the most common FE interview questions + answers, follow along!

22 Followers  |  16 Following  |  79 Posts  |  Joined: 29.05.2025
Posts Following

Posts by lin (@symsys.bsky.social)

Video thumbnail

βš›οΈ Day 38 #100DaysOfCode Infinite Scroll Part 1

One of the hardest parts of solving a problem is not getting overwhelmed by all the subproblems I haven’t solved yet.

So today I focused on an MVP:
set up the state
wire the async fetch
render the items

Scroll detection is next. πŸ’ͺ

12.12.2025 18:38 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 37 #100DaysOfCode Optimistic UI

At a high level:

Optimistic UI = let the frontend lead.
Update the UI immediately, then ask the server for confirmation.
If the server says β€œno”, roll back.

Trust user intent, let the UI move first, and clean up if the server disagrees.

02.12.2025 02:28 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 36 #100DaysOfCode #React Suspense
Suspense is React’s built-in way to pause rendering when something isn’t ready and automatically show a fallback UI.

Why use it?
πŸ‘‰ Cleaner code
πŸ‘‰ Works with lazy components, streaming, and data fetching
πŸ‘‰ Makes async boundaries explicit and reliable

19.11.2025 00:29 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 35 #100DaysOfCode #React Error Boundaries

If you want a shared fallback UI for API failures, you need to surface the error back into the render phase.

Pattern:
1️⃣ catch async error
2️⃣ store it in state
3️⃣ throw it during render β†’ ErrorBoundary can now catch it

16.11.2025 03:18 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

βš›οΈ Day 34 #100DaysOfCode #React has 2 phases

1️⃣ Render Phase = calculate UI
React runs your component + pure hooks
Builds + diffs the virtual DOM
❌ No DOM, no effects

2️⃣ Commit Phase = apply UI
React updates the DOM, then runs:
➑️ useLayoutEffect (before paint)
➑️ useEffect (after paint)

#frontend

13.11.2025 05:58 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 33 #100DaysOfCode #React useLayoutEffect
React’s render cycle πŸ‘‡
useLayoutEffect β†’ paint β†’useEffect

🧠 useEffect:
Non-visual side effects, things the user won't see: data, timers, logging

🎨 useLayoutEffect:
Visual sync, things that affect what’s painted: size, position, layout

12.11.2025 02:31 β€” πŸ‘ 10    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 32 #100DaysOfCode #React useDebounce

Typing triggers onChange instantly ⚑️
But you don’t always want instant reactions, like spamming an API with every keystroke.

πŸ’‘ Debounce = β€œwait until the user stops doing something.”
🐒 useDebounce slows down chaos β†’ creates calm

#frontenddevelopers

08.11.2025 01:33 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

βš›οΈ Day 31 #100DaysOfCode #React useState vs derive data

πŸ’‘ Rule of thumb
βœ… can be recalculated from props or other state β†’ derive it
βš™οΈ depends on user input or async data β†’ store it

🧘 β€œIf you can derive it, don’t store it.”

#frontenddevelopers

07.11.2025 01:03 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Cool, so each slice has its own actions to manage state changes, and the reducer just combines them back into the store?

07.11.2025 00:53 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

how are slices used in your app?

06.11.2025 03:01 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

that's way more fun than a rubber duck :3

06.11.2025 03:00 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Video thumbnail

Day 30 #100DaysOfCode #React.memo
React.memo tells React:
β€œIf the props didn’t change, skip re-rendering this component.”

When the parent re-renders
🧠 React checks: did props change?
βœ… If no β†’ reuse the last rendered output
❌ If yes β†’ re-render normally

watch demo with πŸ”Š

#frontend

06.11.2025 02:49 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 29 #100DaysOfCode #React useMemo?

useMemo stops unnecessary recalculations when inputs haven’t changed

βœ… Caches the last computed value
βœ… Reuses it if deps stay the same
βœ… Prevents re-creating arrays/objects that trigger re-renders

Watch the demo πŸ‘‡ with sound on πŸ”Š

#frontend

05.11.2025 01:47 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 28 #100DaysOfCode #React usePrevious
React re-renders, use 🧠 usePrevious to remember the last render’s value

βœ… Stores the last committed value
βœ… Doesn’t cause extra renders
βœ… Built on useRef + useEffect timing (runs after paint)

πŸ’‘React values are snapshots per render

#frontend #usePrevious

04.11.2025 01:42 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

Which one of the usePrevious hook solutions is the idiomatic solution?

Approach 1: useState
Approach 2: useRef

#React #greatfrontend #usePrevious

04.11.2025 01:21 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

βš›οΈ Day 27 #100DaysOfCode #React useReducer

When your state logic starts branching, use useReducer β†’ keeps updates centralized & predictable:

βœ… Puts all state transitions in one place
βœ… Easier to test & debug centralized
βœ… Pairs great with Context

#FrontendDev

03.11.2025 00:42 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

what are you working on? love to see what you're building

01.11.2025 02:30 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

βš›οΈ Day 26 #100DaysOfCode forms in #React:

1⃣Controlled = value in state β†’ predictable UI, validation, derived rules
2⃣Uncontrolled = DOM owns value (via ref) β†’ minimal rerenders, large forms/3rd-party

πŸ‘Rule of thumb: default to controlled; use uncontrolled when only read on submit or need perf

01.11.2025 02:21 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Entrepreneurs Challenge πŸš€ Cofounder Application Current application demo: https://x.com/linzhangcs/status/1982898774851891608 Once accepted, the Entrepreneurs Challenge program provides how-to workshops, hands-on boot camps, 1:1 coachingβ€”all design...

@buildinginpublic.bsky.social

Looking for a cofounder for $75,000 funding! πŸš€
apply hereπŸ‘‰ forms.gle/hFLpb5mTMtf1...

Building an adaptive productivity app, DM if you want to know more

I’m product + frontend (Next.js/React/AI)
You: biz ops, community building, or backend/AI mind 🌿

31.10.2025 19:17 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

nice layout

30.10.2025 23:52 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

βš›οΈ Day 25 #100DaysOfCode React State Debug

You console.log state right after setState inside your handler to see the change, and it's still the old value? πŸ€”

βœ… ways to confirm the update:
πŸ‘‰ Show it directly in the UI
πŸ‘‰ Log it inside a useEffect that depends on that state

#React #frontend

30.10.2025 21:58 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Just saw this, I guess you like EmberJS? I have not used it. I will check it out.

30.10.2025 21:15 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It's good that you have a clear preference. I don't know if I like React. It has the largest support system, that is all.
What's your favorite frontend library/framework?

30.10.2025 21:06 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Day 24 #100DaysOfCode #React Batching

React doesn’t update state right away
🧩 It batches multiple updatesβ†’ runs one render β†’ one DOM commit

setState feels delayed because React:
πŸ‘‰Defers updates until the current function exits
πŸ‘‰Avoids extra re-renders
πŸ‘‰Updates the DOM after reconciling all changes

29.10.2025 22:08 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

That’s where React really shines. It takes care of the messy DOM updates for you and keeps the UI declaratively tied to your data, so you can focus on what the UI should look like, not how to update it every time something changes.

29.10.2025 21:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

You’re right that JavaScript already gives you solid tools for managing data and behavior.
The tricky part, especially as apps got bigger, wasn’t managing the state itself. It was keeping the UI in sync with that state. DOM API doesn't have a built-in way to automatically reflect those state changes

29.10.2025 21:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Day 23 #100DaysOfCode Why React rerenders 🧠

React rerenders when reactive data changes:
state or props.

Too many re-renders? ⚑
Issue with non-UI data in useState.

πŸ”Ή Use useState for UI: state and props
πŸ”Ή Use useRef for internal tracking: timers, previous values, or DOM refs

#react #frontend

29.10.2025 01:25 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Day 22 #100DaysOfCode React useState vs useRef

In React, the real mental unlock is this:

🧩 Reactive data vs Non-reactive data
useState β†’ triggers re-render when changed
useRef β†’ persists data, but React doesn’t care

codesandbox.io/p/sandbox/4y...
#frontend #react

28.10.2025 01:48 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Wow, that's amazing. Keep us updated!

27.10.2025 19:44 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I’m learning JavaScript because I want to become an engineer and build my own products. It’s not easy! I’ve been learning and using it for the past 7–8 years, and it takes time!

27.10.2025 19:43 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0