[Front End System Design] - Facebook News Feed

Sdílet
Vložit
  • čas přidán 28. 06. 2024
  • Episode 1 - Facebook News Feed
    Facebook News Feed is a widespread problem for System Design for Front-End interviews. Let's try to design it. This is just my thoughts and it's not a guide on how to do that.
    If you have any suggestions, please leave comments below. Let's make the content better together.
    Follow me:
    Telegram: t.me/frontend_engineer_blog
    Medium: / evgeniiray
    Linkedin: / evgenii-ray

Komentáře • 136

  • @bpkb23
    @bpkb23 Před 3 lety +190

    Happy to report that I passed my front end systems design interview thanks to these videos (in particular, my interviewer loved the 9-step plan and the overview of polling/WebSockets/SSE). Very big thanks! Subbed

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety +4

      Hey Brian. Thank you for your report. I'm really happy that this worked out for you 🚀
      Good luck with a new job 👍

    • @venkatkarasani
      @venkatkarasani Před 3 lety

      @@FrontEndEngineer Thanks for the great videos!. Can you share the link to schemas for all the videos?. That would be really helpful.

    • @halusky
      @halusky Před 2 lety +7

      @@venkatkarasani You'll actually get even more out of these videos if you build the diagrams from scratch as you watch, especially since that's what you might be doing during a FE interview. I used Excalidraw.

    • @AhmedElDamasy93
      @AhmedElDamasy93 Před 2 lety

      What is the best way to study these lectures ?
      can you give me your experience ?

    • @jeffb587
      @jeffb587 Před 2 lety

      this is probably best endorsement a youtube video could get

  • @robdodson8823
    @robdodson8823 Před 2 lety +42

    A quick point on accessibility - you definitely do not want all inputs and textareas to have aria-live. That will create an extremely bad experience for a blind user. aria-live should only really be used for alerts, and even then it should be used sparingly. Screen readers can already easily read the text in inputs and textareas. In general, the first rule of aria is "Don't use ARIA" because it is so often misused.

  • @kalpanagupta6166
    @kalpanagupta6166 Před 2 lety +25

    I believe, Accessibility, Performance, Internationalization, language, SEO, Security and Scalability are key points to consider in system design.

  • @aubame-bloodclut-zette6745
    @aubame-bloodclut-zette6745 Před 2 lety +15

    Brother I watched all of your videos and it helped me pass my system design interview and get an offer from my dream company.. Thanks so much!!

  • @kalpanagupta6166
    @kalpanagupta6166 Před 2 lety +37

    Accessibility:
    Use right color contrast ratio more than 4:5:1
    Dynamic font sizes
    Use semantic elements
    Provide proper aria-roles, attributes for custom components. Like, use alt for images, aria-haspopup to announce, this element can load another layer.
    Maintain Keyboard navigation
    Create guardrails to avoid human errors.
    Support escape link to move to a certain part of the page.

  • @yaroslavsemenchenko6091
    @yaroslavsemenchenko6091 Před 10 měsíci +1

    I'm watching this video after 2 years. It's amazing. Please don't stop and retern with new videos!

  • @markosimundza3312
    @markosimundza3312 Před 2 lety +12

    I think you are mixing infinite scrolling (adds new data/DOM elements) vs virtual scrolling (replaces data, keeps dom elements constant). Aside from that a very good and informative video

  • @thmoeboa
    @thmoeboa Před 3 lety +1

    This was awesome! Thank you for taking the initiative to start this.

  • @kalpanagupta6166
    @kalpanagupta6166 Před 2 lety +24

    Other ideas to optimize rendering performance are
    1. Preload resources
    2. Prefetch resources for next navigation
    3. Lazy loading Images
    4.

  • @uttampankaj
    @uttampankaj Před 2 lety +5

    For more info about network connections
    Long Polling: javascript.info/long-polling
    WebSocket: javascript.info/websocket
    Server Sent Events: javascript.info/server-sent-events

  • @avinashrock3538
    @avinashrock3538 Před 2 lety

    best frontend design channel i ever found on internet

  • @catsoft_games
    @catsoft_games Před měsícem

    the most full video about that kind of interview, the best

  • @hardikganatra2453
    @hardikganatra2453 Před rokem

    Wow , such great efforts for the community , This is GOLD level content , God bless you man !!!

  • @erassylzh5658
    @erassylzh5658 Před 3 lety +1

    Great! Waiting for more videos!

  • @GameboyZoneRocks
    @GameboyZoneRocks Před 6 měsíci

    Thanks for this video on System Design for Facebook NewsFeed. It's very thorough and detail oriented.

  • @DavidProrok
    @DavidProrok Před 2 lety +3

    Wow this was intense. It made me feel like I didn’t know anything lol. Great explanations

  • @Mr26pritam
    @Mr26pritam Před 3 lety

    This is a very good and knowledgeable video to watch. Great work ,Please try to do more stuffs like this :)

  • @harshbharvada4099
    @harshbharvada4099 Před 2 lety

    Awesome content and structure. Learned a lot of new stuff from this video and more magical stuff from the comments. Now I will be looking at all your video's comments as well 😬

  • @joshuasineta5756
    @joshuasineta5756 Před rokem

    Awesome content brother, you are a legend in the making. very helpful content and practical

  • @rohitreddy3879
    @rohitreddy3879 Před 3 lety

    Amazing content! Thanks a lot for sharing your knowledge

  • @AmanVarshneyProfile
    @AmanVarshneyProfile Před 3 lety +7

    Great jobs buddy. Love the way you characterized things. Definitely, this will help in preparing the interviews. We can also talk about the performance of the feed and maybe talk about the web vitals stuff specially CLS.

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety

      Yea, web vitals is definitely a good thing. Thanks for comment

  • @adarshpandey3123
    @adarshpandey3123 Před rokem

    Good Work Man!
    Please keep it up! 👍

  • @aabhasjain139
    @aabhasjain139 Před rokem

    Hey I love your videos. Please keep that coming :)

  • @anupbid
    @anupbid Před 3 lety +4

    I think this channel deseves a lot more subscribers.. great job and keep it up.

  • @duyenkhanh5218
    @duyenkhanh5218 Před 2 měsíci

    Thanks, i learnt alot of things just by watching this video

  • @user-op5xd7bd5n
    @user-op5xd7bd5n Před rokem

    Nice work man! Thanks a lot!

  • @bafxyz
    @bafxyz Před 3 lety +5

    Best one from what i see for the moment. Thank you

  • @FragRobe
    @FragRobe Před 3 lety +7

    Thanks for your video, lots of really interesting points: I passed my interview also thanks to this.

  • @razibazargan5649
    @razibazargan5649 Před 3 lety +1

    This is great, helped me to have a start point for Frontend Design interviews. Thanks

  • @ragulmurugesan7182
    @ragulmurugesan7182 Před 2 lety

    Superb video. Good job. Very useful. ✌

  • @JulioDx3480
    @JulioDx3480 Před rokem

    Thanks for this, very helpful!

  • @Xush11kkkk
    @Xush11kkkk Před 3 lety +13

    Loved it! Would like to add that we can also talk about the lower level architecture like folder structure, component APIs (if something like React is used), & are they well defined. how would you compose the components (patterns) , design patterns used & why, choice of libraries & why (Ex: what would library would you use to have a store), when would you choose persistent storage vs in-memory storage, etc? Overall, I still love the methodical approach - if the question you get is to design a core library like a logger system, UI becomes less of a focus and we need to delve deeper into just the logic & perf

    • @harshbharvada4099
      @harshbharvada4099 Před 2 lety +5

      I guess one doesn't expect to get to design a logger system in a Front End Design round so those questions of choosing storage take back seat!
      This is one of the best front end design videos I have seen covering so many imp topics

  • @AkashSharma-oe9no
    @AkashSharma-oe9no Před 3 lety

    Amazing, thanks for sharing :) :man-bowing:

  • @jyotiverma8715
    @jyotiverma8715 Před 2 lety

    Great content!!!..👏👏👏👏👏👏👏

  • @leduyminh48
    @leduyminh48 Před 3 lety +4

    Can you please attach the xml in the description, thank you! Very detailed explanation that covers most of the aspect of Front End design!

  • @gvbasov
    @gvbasov Před 2 měsíci

    Спасибо!) Отличный урок!

  • @balajikamalesh3338
    @balajikamalesh3338 Před rokem

    WOW!!! awesome!!

  • @user-oy4kf5wr8l
    @user-oy4kf5wr8l Před 21 dnem

    amazing content!!!!!!!!

  • @naruto5437
    @naruto5437 Před rokem

    keep up the good work

  • @ankitkumaryadav562
    @ankitkumaryadav562 Před 4 měsíci

    Love the content

  • @sheifmomin2812
    @sheifmomin2812 Před 3 lety

    Thank you so much!

  • @OyedeleSegunfunmi
    @OyedeleSegunfunmi Před 2 lety +1

    Awesome video. Definitely giving me a headstart ahead of my interview. Can you please share a link to this schema. It will be very helpful for reference

  • @hungngovinh7756
    @hungngovinh7756 Před 2 lety

    great video!

  • @akinhwan
    @akinhwan Před 3 měsíci +1

    had this question today, should have known it was coming. totally forgot about Comments entity. Got a bit stuck trying to mock up the design. They didn't really want to see the data model diagram, more interested in front end state management

  • @ayaramzy6815
    @ayaramzy6815 Před 2 lety

    Thank you for your effort .. in the optimization section it is Brotli not Brottle u can add a note beside on the video .. again many thanks for your efforts

  • @VijayKumar-vv6yw
    @VijayKumar-vv6yw Před 3 lety +5

    Such Wow. Much Love

  • @williamz8330
    @williamz8330 Před 3 lety +2

    This was very very helpful and gave me everything I needed to pass the front end design portion of the interview at Uber. Another company though asked me to "design a tooltip". I was fully unprepared and totally lost. Have you heard of this type of design interview before?

    • @VeenaBalasubramanya
      @VeenaBalasubramanya Před 2 lety +2

      yes there are bunch of standard widgets like tooltip, star rating, infinite scroll etc

  • @paulina7497
    @paulina7497 Před měsícem

    Thank you so much!!!!

  • @jeffgoes4116
    @jeffgoes4116 Před 2 lety +2

    Hey!! Really good content. Do you think you could share your diagrams on a public drive? Or maybe leave a download link so we can see it and try to add improvements ourselves? That would be awesome

  • @alexmakarov1468
    @alexmakarov1468 Před 2 lety

    OMG ! Thanks men!

  • @everyonecanbefascist
    @everyonecanbefascist Před 2 lety

    This video was underrated.

  • @user-lc2tt9sc4z
    @user-lc2tt9sc4z Před 7 měsíci

    Thank you!

  • @pratikgala
    @pratikgala Před 2 lety

    good content.

  • @lelandrb
    @lelandrb Před 2 lety +1

    Not everyone has a camera (or the desire to broadcast) but including a video of yourself talking would help this out a lot. Non-verbal communications add a lot to complex lessons :)

  • @nabanitadasgupta1061
    @nabanitadasgupta1061 Před 3 lety +1

    Awesome!! Thank you very much for sharing it. Could you please post a video of the front end design on shopping cart functionality?

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety +2

      Hi, new videos are coming in May / the beginning of June. I have that question in the list

  • @thekingraghuraman
    @thekingraghuraman Před 2 lety +1

    Great video, lots of things that are new for me especially in the optimization area.
    Which tool are you using for this ? Is it visio ?

  • @VickyGupta538
    @VickyGupta538 Před 2 lety +2

    Hey, Great content for the frontend design. I have one doubt.
    When you are fetching getFeed(I mean getPost), you have all the feed in the NewsFeed Component.
    We can run the for loop and destructure the feed object within the loop as
    const { comments, ...rest } = feed
    and pass the comments to commentList component and rest to StoryCard component.
    What's the point of storing it in store? I believe we store the state of app in the store. Like selected feed or current active page, user meta data etc.
    Please let me know if I understood it incorrectly.
    Thanks for creating this video. It helps a lot!
    PS: Better if we can add request and response payload with API's.

  • @NISHANTH1223
    @NISHANTH1223 Před 3 lety

    Hello there. Great job on this video. Great to see videos on front end system design. Can you provide a link for the diagram so that we can download it ?

  • @yashin4537
    @yashin4537 Před 2 lety +4

    Great video ! Regarding scrolling technique, I assume you are talking about virtual scrolling not infinite scrolling ? Correct?

  • @ssiripu
    @ssiripu Před 3 lety +5

    Great video. Could you post a video of front end design on Amazon search and filter functionality?

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety +3

      Hi, Srujana, thank you for your comment. I'll add this question later, meanwhile, you can check out my video about Typeahead Widget

  • @alexkakhnovskyi4113
    @alexkakhnovskyi4113 Před 3 lety

    I used to call such scrolling a virtual scroll :)

  • @denischudinov2379
    @denischudinov2379 Před 3 lety +8

    Thanks for a great video!
    One tiny misspelling in the network optimization section. You talked about gzip and *brotli* (en.wikipedia.org/wiki/Brotli)

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety +3

      Yep, thank you. I made this typo across all videos ;)

    • @thmoeboa
      @thmoeboa Před 3 lety +1

      I was going crazy trying to find out about this "brottle" optimization lol Thank you for this comment, you saved me, now with your comment addition this video became amazing!

    • @Nikhilsharma-dp9tw
      @Nikhilsharma-dp9tw Před 2 lety

      Have found there exists web framework named bottle 😛

  • @kashyapit
    @kashyapit Před 3 lety

    Thanks this is extremely useful. Could you share the charts with process for offline consumption.

  • @kamleshkumar-vm8cj
    @kamleshkumar-vm8cj Před 2 lety +1

    Great tutorial .... by the way, Can I know which tool you are using it for designing all these

  • @harrybanda
    @harrybanda Před 2 lety

    thanks

  • @zakhardolozhevskyi9198
    @zakhardolozhevskyi9198 Před 3 lety +2

    Thanks for the episode, was interesting to follow!
    What do you think is it worst to highlight more infra and back-end part of such a problem on the interview? ( how to deploy, what's db to use, some cloud staff and so on )

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety +6

      The backend part is irrelevant for the FE position. This is not what the interviewer expects from you. I went through my on-site with FB recently :)

    • @girlcoder4780
      @girlcoder4780 Před 3 lety +1

      @@FrontEndEngineer This is amazing. I have been struggling to find design videos for full stack engineers. Since you mentioned you went ahead with FB on-site recently, is this something you expect for the "Product Design" (not System Design)?

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety

      ​@@girlcoder4780 Product design as I know is a bit different, it's more about API Design than the application itself. Full-stack engineers also go through a different track, I'm not fully sure, that you should expect front-endish design.

  • @vijaykosuri123
    @vijaykosuri123 Před 3 lety

    Hey buddy great job, could you please provide the architecture doc?

  • @user-yb5cn3np5q
    @user-yb5cn3np5q Před rokem

    Hello from "we actually used HTTP2 in production" part of the world!
    HTTP2 performance is a myth. With all that multiplexing going through single TCP connection, with packet loss on mobile networks _every single resource_ waits until TCP retransmission is over. That's something like 300ms of page not loading a single thing, and it happens several time during a single page load.

  • @mosagomhaa-ru8tu
    @mosagomhaa-ru8tu Před rokem

    thank you for this video i need those charts please

  • @ivankraev4264
    @ivankraev4264 Před rokem +1

    Hello, congrats on the great content! I've got one question
    On minute 32 I believe you are referring to virtualization. I was wondering, since the virtualization technique requires us to provide with the story height in order to perform its computations and how many items to show on the screen - how exactly they calculate the height ? because every facebook story could consist of a different content and therefore it could have a different height. Do they somehow store metadata for each story with the media height, media type, highlight comments count, etc. and based on this metadata they do their computations for the story height ? What do you think ?

    • @theindieprogrammer
      @theindieprogrammer Před rokem

      The virtualization is a front-end only solution and it can be done dynamically. You can render the story on the DOM and then store the computed height. The virtualization lib will keep track of all the elements and heights and do the proper calculations.
      There is no way to know the story height in advance because there are many factors involved like screen width, user-defined font-size, browser zoom, etc.

  • @yinghuivicky2096
    @yinghuivicky2096 Před 3 lety

    Thanks for the video,it is really helpful. I am going to prepare my interview base on this:) Just wondering where can I find the schema attachment for this video? Thanks a lot

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety

      Hi, I'm glad that you like it :)
      Unfortunately, I've removed my G account with google drive files there, so basically you can copy them from the video :(

  • @hieudodev_
    @hieudodev_ Před 2 měsíci

    The disadvantage you mentioned for Websockets is quite confusing to me. AFAIK, websockets and https2 are two parallel or "competing" protocols, I dont know how can Websockets support http2

  • @ragulmurugesan7182
    @ragulmurugesan7182 Před 16 dny

    Quick question. In 20:33 I see you are passing the id to the store. So if I have 20 posts, then 20 stories would be fetching the data with those respective ids. Right? What if we make an API call to get the 20 story data from the parent (i.e News Feed) component?

  • @chanm2147
    @chanm2147 Před rokem

    This is a great guide, but I do have a question - how would you prepare or preload the components like you do for an actual interview? A lot of times you don't know what they will ask until the actual interview starts

    • @FrontEndEngineer
      @FrontEndEngineer  Před rokem

      I've mentioned it on my newer videos that you need to focus on the most important parts and don't spend too much time on drawing. This will be a waste of time for sure!

  • @ghanashrim2839
    @ghanashrim2839 Před 11 měsíci

    Please kindly attach the final snapshot, in all your system design videos.

  • @DavidProrok
    @DavidProrok Před 2 lety +2

    What is the tool you’re using to create this?

  • @DanteDTSparda89
    @DanteDTSparda89 Před 2 lety

    By feed_id in the store, do you mean post_id?? feed_id was not defined in the apis, makes more sense if we are talking about individual posts.

  • @aqua123670
    @aqua123670 Před 3 lety +2

    thanks man, btw how do you load more data using SSE when the user scrolls to the bottom ? as far as i know in SSE the data is pushed from the server, the client is passive.

    • @FrontEndEngineer
      @FrontEndEngineer  Před 3 lety +6

      You should use a hybrid approach -
      1. SSE loads data on the background
      2. If user scrolls down, and there is no data, make an API call

  • @kkjoe2677
    @kkjoe2677 Před 2 lety +3

    Hey man thanks for the video. I am trying to understand at 32:20 where explains why we need add Top and Bottom Paddings. I am still not very sure why we need it. Could you explain more? I am also reading the Intersection Observer API doc but I havent see the padding part.
    Thanks very much!

    • @maksymbolotnyi6603
      @maksymbolotnyi6603 Před 2 lety +3

      Hi! Not sure if you still need the answer, but I believe he used the padding approach to preserve the right scrolling behaviour (the proportions of the scroll), so that once you have some portion of data you can navigate it through the scrollbar directly and have the right feel of the list size, as under the hood you only render for example 10 stories at a moment, but the list should look like you have 150 stories already

    • @Ashish-_-
      @Ashish-_- Před 6 měsíci

      Hi! Not sure if you still need it but here's my thoughts. Basically we are expanding the viewport vertically by giving a rootMargin to the IntersectionOberver. This means we can fetch the next set of data from the BE before the user even reaches the bottom of the screen and keep them ready.

  • @yangsong4839
    @yangsong4839 Před 2 lety

    Is the data store in the video storing in memory or local storage?

  • @bohdanzamchenco4421
    @bohdanzamchenco4421 Před 2 lety

    Where's the attachment, Lebowski? :)

  • @Nekby2
    @Nekby2 Před 3 lety

    ✔ Facebook News Feed
    ...
    🕑 I'm waiting for the next parts of your Front-End Doc.

  • @codercodercoder5977
    @codercodercoder5977 Před 3 lety +1

    is this just a guess or what they actually did?

  • @TheSaurabhp9
    @TheSaurabhp9 Před 2 lety

    which tool is being used here to draw?

  • @amankhan-ku3zd
    @amankhan-ku3zd Před 7 dny

    What tool are you using for creating the design flow ?

  • @deed_it
    @deed_it Před 11 měsíci +1

    what software did you use on this?

  • @xinchen2642
    @xinchen2642 Před 2 lety

    Thanks for your video! What software you use to generate those charts?

  • @sergeykahnwald6640
    @sergeykahnwald6640 Před 2 lety

    Man, thank you for the stuff, but don't you think that all these points are extremely obvious? it looks like we're discussing how to do snowball fights with big whiteboards and block schemas?

  • @parikshitsharma3393
    @parikshitsharma3393 Před 13 dny

    just a question to anybody reading this. this is low level system design or high level

  • @nomaninnovates
    @nomaninnovates Před 11 měsíci

    Which software are u using to make these diagrams?

  • @srikanthtumpudi536
    @srikanthtumpudi536 Před 2 lety

    A very good content using draw.io I too feel that they are less content on Frontend Engineer. Thanks for putting effort and sharing with us :)

  • @parikshitsharma3393
    @parikshitsharma3393 Před 13 dny

    can anybody share good resources for low level for frontend

  • @mosagomhaa-ru8tu
    @mosagomhaa-ru8tu Před rokem

    how i can get that slide

  • @saurabhdhamnaskar1737
    @saurabhdhamnaskar1737 Před 2 lety

    Can you please share this schema?

  • @JeremiahJoseph97
    @JeremiahJoseph97 Před rokem

    Hey, does anyone have the xml for this?

  • @rndm8614
    @rndm8614 Před 2 lety +2

    Can you share draw.io diagram files?

  • @rotinaindependente
    @rotinaindependente Před 2 lety +1

    Mannnn, Who are you? Do you have a linkedin profile?

  • @reviewsfitness
    @reviewsfitness Před 2 lety

    Subbing - I’m a Ui developer this is not talked about.

  • @tenzl
    @tenzl Před rokem

    what level of position did you apply for? is this a junior level interview question?

  • @surabhinigam1231
    @surabhinigam1231 Před 3 lety

    Hello, Can I get the diagram of this design an image that fully captures the drawing? Since there is a lot of scrolling its easy to miss and confuse if I dont have complete view. It will help me. and may be others thank you.