strager
strager
  • 19
  • 1 443 734
Facebook veteran vs React interview
React interview coding problem (allegedly given to Meta candidates) solved by yours truly.
React Pro's solution video: czcams.com/video/w0Kvt65Z2Uk/video.html
My solution: codesandbox.io/s/transfer-list-test-forked-rypqr2?file=/src/App.js
0:00 interview
0:15 the question
2:54 checkboxes
13:57 moving items
22:39 styling
31:43 polish
35:29 review
39:33 interview question thoughts
React logo Copyright (c) Meta Platforms, Inc. and affiliates., MIT license github.com/facebook/react/blob/main/LICENSE
Meta logo © 2023 Meta
Thumbnail by jennipuff
zhlédnutí: 14 505

Video

DO NOT USE BUN (bun install is good dough)
zhlédnutí 139KPřed 8 měsíci
00:00 Bun is here 00:31 porting to Bun 01:05 log import perf 02:40 MariaDB perf 03:21 reporting perf 03:50 bun install on dev 06:14 macOS disk usage 06:37 bun install on CI 07:19 porting the website 09:30 bun test 12:08 bun watch 12:54 page load speed 14:32 CI builds 15:55 more testing 16:27 pros and cons of Bun 17:26 me and Bun Benchmark code: github.com/quick-lint/bun-vs-node (Analytics bench...
Big O myths busted! (Time complexity is complicated)
zhlédnutí 132KPřed rokem
Is O(log n) better than O(n)? In this video we talk about algorithms, time complexity, and why it's sometimes confusing. Buy 🦀 Rust stickers: strager.net/booty 00:00 what is the best algorithm? 00:16 locating errors 01:28 benchmarking the naïve algorithm 02:08 analyzing the naïve algorithm 04:33 the line tables algorithm 05:44 benchmarking the line tables 08:06 a fair comparison 09:48 binary se...
Faster than Rust and C++: the PERFECT hash table
zhlédnutí 516KPřed rokem
I had a week of fun designing and optimizing a perfect hash table. In this video, I take you through the journey of making a hash table 10 times faster and share performance tips along the way. 00:00 why are hash tables important? 00:31 how hash tables work 02:40 a naïve hash table 04:35 custom hash function 08:52 perfect hash tables 12:03 my perfect hash table 14:20 beating gperf 17:24 beating...
My right-handed programming language
zhlédnutí 15KPřed rokem
I made a new programming language: yuiop.ink/ langjam is a 48-hour coding competition: github.com/langjam/jam0004 00:00 langjam 00:17 installing yuiop 01:50 example programs 03:16 language syntax 05:00 Brain interpreter 07:44 pros of yuiop 08:12 cons of yuiop
How to contribute to open source
zhlédnutí 103KPřed rokem
If you've never contributed to an open source project before, it may seem daunting. In this video I break down the process and show you how improving software isn't all that scary. 00:00 gdb bug 00:30 building gdb 02:32 reproducing the bug 02:54 finding the bug 04:55 adding a new setting 08:09 testing the setting 09:16 testing the fix 09:55 how to contribute 11:11 writing documentation 12:42 se...
How I use C++: a line-by-line code review
zhlédnutí 230KPřed rokem
Let's walk through quick-lint-js, a 100k-line C project, and talk about the code style and design decisions. Links: Stewart Lynch's Sane C series: czcams.com/video/noA4moTihU4/video.html C Core Guidelines: isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines decode_utf_8_result design help from u/LegionMammal978: old.reddit.com/r/rust/comments/104md0s/is_coding_in_rust_as_bad_as_in_c_a_practica...
Weirdest keyboard I've used: CharaChorder One review
zhlédnutí 103KPřed rokem
I used the CharaChorder One full time for five weeks. Here are my honest thoughts. (They aren't pretty!) 0:00 Introduction 1:00 Learning journey 5:42 Pros 8:53 Cons: software 10:44 Cons: customer support 12:31 Cons: device 14:14 How chording works 15:49 Deal breakers Co-editor: member926 Music and sound effects: Silfra - West & Zander Overpass - Major Tweaks Stand - Jones Meadow catching flight...
3 real-world visitor design pattern examples in Rust, JS, & C++
zhlédnutí 15KPřed 2 lety
Why would we ever want to use the visitor design pattern? Aren't design patterns a waste of time? Let's look at how programmers in the industry use the visitor design pattern to solve real problems. 0:00 why design patterns? 0:11 Chromium's visitors 1:36 why visitor for Chromium? 2:27 quick-lint-js.com's visitors 3:25 why visitor for quick-lint-js.com? 4:02 fd's visitors 4:50 why visitor for fd...
Tips for C++ newbies (compiler code review)
zhlédnutí 10KPřed 2 lety
Write better C with these quick tips and tricks. Let's improve the lexer in a compiler to make it shorter and less ugly. Chat with me live for free code reviews, lessons, and career advice: twitch.tv/strager 0:00 shorter tests with const 1:13 don't cast enums 1:54 what is lexing? 2:53 string_to_double 3:44 last_char vs *iterator 4:11 copying identifiers 4:26 parsing comments 5:01 switch stethos...
13 easy Rust tips (code review)
zhlédnutí 19KPřed 2 lety
13 easy Rust tips (code review)
4 VS Code plugins for JavaScript beginners: install tutorial & comparison
zhlédnutí 4,5KPřed 2 lety
4 VS Code plugins for JavaScript beginners: install tutorial & comparison
Does your app have this bug? SQL bug you won't see during development
zhlédnutí 7KPřed 2 lety
Does your app have this bug? SQL bug you won't see during development
DRY makes your code 500% better · intermediate Java code review
zhlédnutí 29KPřed 2 lety
DRY makes your code 500% better · intermediate Java code review

Komentáře

  • @mathbrah
    @mathbrah Před 2 dny

    what is they keyboard you used at 0:19?

  • @tyhjyydesta
    @tyhjyydesta Před 4 dny

    This is what Fast and furious movies should have been about

  • @Ginto_O
    @Ginto_O Před 4 dny

    You look like 🤡

  • @eck1997rock
    @eck1997rock Před 6 dny

    llm’s to dynamically generate optimized hashtable implementations at runtime? Vc investors pls

  • @MotionFriend
    @MotionFriend Před 7 dny

    This was a thorough and helpful insight. Thank you

  • @jonathonreed2417
    @jonathonreed2417 Před 8 dny

    One thing I didn't see mentioned that might have lead to further optimization would have been compiler flags. By going through your different approaches with differing optimization flags like O3 or Ofast maybe you would have discovered more interesting performance variations to explore or found something like ptest you didn't know about.

  • @user-ym2rn3su6m
    @user-ym2rn3su6m Před 8 dny

    DOS attacks against hash tables exist. You threw away the built in protection for that and made your code significantly worse for general use cases as opposed to specific data sets.

  • @volchonokilliR
    @volchonokilliR Před 8 dny

    When you open a video with "my C++ is insane" in the thumbnail and first thing you see is something that you thought was your code... 😄 I made a very similar UTF-8 helper

  • @zappist751
    @zappist751 Před 9 dny

    Nah... for example, Python is without doubt the best language for ML.

  • @BenjaminHare
    @BenjaminHare Před 9 dny

    What an incredibly useful video. I've been hesitant to go down this road. You video is exactly what I needed to make up my mind. Thanks so much for taking the time to make it.

  • @tahitinguyen4822
    @tahitinguyen4822 Před 9 dny

    I don't trust this guy. He works for Hooli!

  • @arthurd4012
    @arthurd4012 Před 11 dny

    Wow, brilliant vid!

  • @renstillmann
    @renstillmann Před 11 dny

    As a Vim user, thank you for this review.

  • @micknamens8659
    @micknamens8659 Před 12 dny

    Tip #11 Run your performance comparison tests on different data sets of different sizes. 😉

  • @Sluggernaut
    @Sluggernaut Před 13 dny

    13:20 omg lol wtf. 24:00 uh? Wait are you editing the microcode directly ?

  • @mynameisroman
    @mynameisroman Před 13 dny

    14:38 if "size" is an unsigned number you could do: if ((size - 2) > 9)

  • @ayannadivineempathpsychict9838

    Have any updates helped with your initial complaints?

  • @saeidex
    @saeidex Před 16 dny

    0:04 les go..🎉

  • @furyzenblade3558
    @furyzenblade3558 Před 18 dny

    21:30 By instructions you mean clock cycles?

  • @i-am-the-slime
    @i-am-the-slime Před 19 dny

    How is react meant to fix the original problem (the DOM)?

  • @i-am-the-slime
    @i-am-the-slime Před 19 dny

    Nah. React is really nice.

  • @rursus8354
    @rursus8354 Před 19 dny

    0:10: You *_GET IT WRONG_* already in the first 10 seconds! Hash table is an implementation method, dictionary is any data structure where you can look up items based on something else than an integer index. A dictionary or as it is often called: an associative array, is not a hash table. It could be implemented by a hash table, but it could as well be implemented by a balanced tree, a heap (in sorting meaning) or a B-tree.

  • @PanMaciek
    @PanMaciek Před 20 dny

    Great video I come back to from time to time, love the deep dive into hash tables, very inspiring

  • @psymar
    @psymar Před 20 dny

    why do the cube and crab have such defined asses (edit just fixing typo)

  • @LettersAndNumbers300
    @LettersAndNumbers300 Před 21 dnem

    Why not enums?

  • @user-hf9to4xj6c
    @user-hf9to4xj6c Před 22 dny

    why was binary search slower than linear?

  • @social.elenakrittik
    @social.elenakrittik Před 23 dny

    GitHub frontend is written in Ruby, not JavaScript

  • @mauricioprado6395
    @mauricioprado6395 Před 23 dny

    omg that ending. Thanks for saving me +100 usd and 3 months of stress. It's kind of ridiculous, I am a programmer too, and I have the feeling that such kind of keyboards attrakt mostly programmers. Why would they not think about symbols!!! needing to use 3 fingers for a single symbol character is insane.

  • @aleaallee
    @aleaallee Před 24 dny

    Objects and associative arrays make more sense than just "hash table", hash table tells me nothing.

  • @mihaleben6051
    @mihaleben6051 Před 25 dny

    BRO DID NOT DRAW THE THUMB NAIL

  • @armandomorales4423
    @armandomorales4423 Před 26 dny

    In your hash function you have: t+hash&0x1ff0 Try avoid using the plus sign, trim the “t” and use another & or | instead of + … the reason for this is that + has to deal with carry (doing & and | ) if you deal with the carry you are saving computing

  • @ivannasha5556
    @ivannasha5556 Před 26 dny

    Meanwhile I'm over here crying about billion dollar companies. Not being able to make a snappy GUI on today's hardware. When 1MHz computers with 64k ram. Were faster than me in the 80s XD

  • @natescode
    @natescode Před 27 dny

    Wow this is such a gem of a video.

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

    instructions != cycles

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

    I really appreciate error bars on your tests results. It is really uncommon sadly.

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

    I would have assumed that perfect hash would have been something like load the input string as one or two 64 bit numbers, xor each input with random-like static value, rotate one of the numbers another random amount and then xor the numbers together and use that as the hash value. And to find those random values, you just create a program that tries different combinations until you get a good hash. The important part is that you only randomize the static values to xor against each input and the shift amount before xor'ing the results which should result in micro-ops that can execute really fast. And check the generated assembly to verify that the compiler inlines your hash function instead of calling a real function. And try to make the compiler to unroll the loop if at all possible. If you have multiple words to check for being a keyword, CPU might be able to execute those tests in parallel if the loop is unrolled 2x or 4x times. Also consider the byte alignment. If you can have the words starting at 4 or 16 byte alignment, the CPU may be able to load the data faster. The important thing is to keep trying different methods and profile which one is the fastest and always assume most of the code will be CPU cache limited, not instruction limited. The hard part is that modern CPUs do not have great options to check if your limit is branch mispredict or RAM access.

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

    The burp at LCG moment was amazing

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

    I had this video in my feed for like 3 weeks, I didn't want to watch it because hashing seems kinda boring but surprisingly it was the best video I have seen in a while

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

    Legal Typescript source code files are expected to use UTF-8 for their character encoding format. Not ASCII. Be careful when making precise assumptions about your data (like that it includes only 8-bit ASCII characters).

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

    In conclusion, Node.Js isn't still bad bad afterall, it's just the hype for Bun that was a little too much to get us exited all this while.

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

    Gilfoyle from Silicon Valley, is that you?

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

    Uh... Why not use an enumerated type?

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

      Uh. Nevermind. I figured out why that's a dumb idea.

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

    I would probably name decode_UTF_8_result the same as you (I may remove the _ between the F and 8) But if it doesn't have any acronyms in it, I would just use camel case If it's truly a helper function, having it defined as a lambda inside of the function that it's helping seems better to me ... You're supposed to use std: unique 11:16 And on top of that I'm not always looking at my source control, which is why putting some sort of identifier there is a good idea

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

    Where is the code?

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

    I think the performance could be even better if you weren't using the Comic Sans font.

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

    I dont mean to sound like youre not doing it right. But I think most of your problems originate from resting your hands on the table. I noticed that the modifiers go way easier when you rest your ellbows on the armrests of your chair and approach the chorder from the top, rather than the way you would do on a keyboard.

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

    I need that rusty gyatt

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

    why Why did you feel the need to cake up Ferrous and C++

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

    I have an application that is doing high frequency trading using several LMDB in-memory DBs and many loops. Running it on bun vs node is a no brainer. Bun wins many times over. Nobody cares if the tests took a bit longer to run, that is not affecting production use of your application. The real meat is in the production code performance. I would suggest the slow test running is probably indicative of an issue somewhere in bun, and once fixed it is likely to be faster. Possibly something in how you test is not being translated into optimal code.

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

    so why was the binary search slower?