Loops and Hash Maps Job Preparation Interview Question

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 67

  • @alcprado
    @alcprado 5 лет назад +12

    Thumbs up before watching the video because I know something awesome is about to come

  • @MuhammadAli-zv5vz
    @MuhammadAli-zv5vz 5 лет назад +5

    Thanks Sir.I got my first IOS developer job .Thanks for these kind of videos.you are great teacher Thanks again for these videos 😊😊😊

  • @ayon3527
    @ayon3527 5 лет назад +2

    I really appreciate your willingness and effort to share these kinds of lessons, helps a lot as a non CS graduate.

    • @adrienrudy8004
      @adrienrudy8004 3 года назад

      I guess Im asking the wrong place but does anyone know of a way to get back into an Instagram account..?
      I was dumb lost my login password. I appreciate any assistance you can give me!

  • @sbassett11
    @sbassett11 5 лет назад +1

    Thanks for the videos as always. this is how my nerdy self enjoys his Saturdays...
    Although I didn't like leaving the algorithm as is with it failing when entroducing letters.
    So I added an extra step before the for loop where im creating a new variable catching what comes back from let newNumericArray: [Int] = sampleString.compactMap { valueMap[$0] }... thus stripping out letters

  • @nathan43082
    @nathan43082 5 лет назад +2

    I like your videos. Your presentation is straightforward and friendly.
    I am finally learning Swift, but with 35 years of programming experience under my belt, I tinkered a little. It looks like the code below would work as well instead of a hash map:
    let ch:Character = "7"
    let num = "0123456789".firstIndex(of: ch)?.encodedOffset
    “num” should be an optional Int and be 7. There may be an even simpler way to do this, but, again, just learning Swift here.

  • @mrmillmill
    @mrmillmill 2 года назад

    Incredible video!

  • @_DeProgrammer
    @_DeProgrammer 5 лет назад +4

    the "^" symbol is exclusive OR. if you have a binary value 01 and 10 you would get 11.

  • @c9bd415
    @c9bd415 5 лет назад +1

    Love these prep videos. Also your mic quality is amazing.

  • @amitjoshi5798
    @amitjoshi5798 5 лет назад

    Thanks buddy. You are the torchbearer of all iOS developers across the globe. Thanks a ton for sharing this priceless informations & knowledge.

  • @user-go5tu5nm6r
    @user-go5tu5nm6r 5 лет назад +2

    I think there is much simpler implementation of your solution.
    for c in s {
    total*=10
    total+=c-‘0’
    }
    And that’s it

    • @ObtecularPk
      @ObtecularPk 5 лет назад +1

      Or total = total*10 + c - '0'
      The nice one line

  • @zb1123
    @zb1123 5 лет назад

    Looking forward to more videos like this

  • @dongshuowu3454
    @dongshuowu3454 5 лет назад

    Nice to see another video. Thanks again for your wonderful content.

  • @ubaidillahahmad25
    @ubaidillahahmad25 3 года назад

    thank you

  • @NPCTE23
    @NPCTE23 5 лет назад

    Exactly what I needed, thank you so much Brian!

  • @toastrecon
    @toastrecon 5 лет назад

    Awesome, thanks Brian.

  • @MrJoeYellow
    @MrJoeYellow 5 лет назад

    As always great video! Thanks Brian, your video and your course are awesome!!

  • @_arun_k
    @_arun_k 3 года назад

    Cqn you please create a video on how diffable data source works?

  • @piotrhapanowicz1159
    @piotrhapanowicz1159 5 лет назад +2

    Hi Brian,
    How about use reversed() before enumerated() the you can skip one line of code:
    for (i, c) in string.reversed().enumerated() { ...
    so "i" can starts from 0 for last element in array

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад +1

      This is something I should've thought of :)

    • @nickng8069
      @nickng8069 5 лет назад

      which line of code would be skipped? please explain

    • @piotrhapanowicz1159
      @piotrhapanowicz1159 5 лет назад +2

      @@nickng8069 You don't need to calculate exponent value, instead you can take index of reversed array as exponent:
      for (exponent, c) in string.reversed().enumerated() {
      if let value = valueMap[c] {
      total += NSDecimalNumber(decimal: Decimal(value) * pow(10, exponent)).intValue
      }
      }

    • @nickng8069
      @nickng8069 5 лет назад

      @@piotrhapanowicz1159 thanks a lot, I understand now

    • @dominiquealexi
      @dominiquealexi 5 лет назад

      I was searching in the comments for this! This is what I did :)

  • @ManishKumar-xw3gs
    @ManishKumar-xw3gs 5 лет назад

    please make video on "How to build Audio Chat / Video Chat in iOS using WebRTC" using swift .because this thing kin new for some people.thank you . you have helped me alot already .

  • @1303sasa
    @1303sasa 5 лет назад

    Nice video as always, btw forEach can be used like this:
    string.enumerated().forEach { (i: Int, c: Character) in
    print(i, c)
    }
    cheers!

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад

      Oh hmm....not sure if this is better or not. Seems like some extra typing :)

  • @jeffa.2378
    @jeffa.2378 5 лет назад

    Great video. Many thanks!

  • @magic0x0
    @magic0x0 5 лет назад

    Perfect 👌🏻 Thanks dude you’re awesome 😍

  • @djalfirevic
    @djalfirevic 5 лет назад

    I would love to see, if possible, how would you approach on building the Twitter app profile page - that scrolling feature i.e. dynamic header. Could you make a tutorial on that?

  • @nizz4m
    @nizz4m 5 лет назад

    Great content as always 👍

  • @akramyounes2271
    @akramyounes2271 5 лет назад

    hi Brain, i really waiting for your "Async Display Kit" iOS tutorial specially for loading list of images. thanks man.

  • @cachorrogarcia10
    @cachorrogarcia10 3 года назад

    How do you do to develop with a non-UI (no simulator attached) for testing codes?

  • @kevinvu2093
    @kevinvu2093 5 лет назад +2

    Hey hey!

  • @smackaroony
    @smackaroony 5 лет назад

    Spicy editing

  • @aliasadi2550
    @aliasadi2550 5 лет назад

    i left a comment here yesterday but i can't find it now.anyway.... thumbs up for your great video as always. and one question for you Brian.as a swift developer who wants to learn android developing.what language do you prefer? Kotlin or ReactNative ?

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад

      I don’t have preferences, whatever gets the job done wins for me.

  • @mrmillmill
    @mrmillmill 2 года назад

    Is hash map and hash table the same thing?

  • @FunkyHotDog
    @FunkyHotDog 5 лет назад

    Great stuff! You might want to turn the bass down on your mic tho. Sounds kind of muffeled.

  • @JimmyCheng
    @JimmyCheng 5 лет назад

    no explanation for why the first solution is wrong? can you do value*(10^^exponent)?

    • @bdaralan
      @bdaralan 5 лет назад

      Ziqiang Cheng Cannot remember exactly, but I believe the `^` is used for other operation instead of power. We have to use `pow(_:,_:)` for exponent.
      Edit: as mentioned by @Phillip Carlino, the `^` is XOR (exclusive or) in Swift.

  • @dixiao8373
    @dixiao8373 5 лет назад

    谢谢大佬 因为看你视频爱上 ios

  • @android-iOS-tutorial
    @android-iOS-tutorial 5 лет назад

    how you motivate yourself towards coding

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад +1

      I don’t really need motivation. This is really just a hobby of mine.

  • @Hamza-xc9kb
    @Hamza-xc9kb 5 лет назад

    Please make a video about "Imposter syndrome" for developers 🙏🏻🙂

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад +1

      I think everyone gets imposter syndrome regardless of what position or title they’re in. What specifically bothers you about it?

    • @Hamza-xc9kb
      @Hamza-xc9kb 5 лет назад +1

      Lets Build That App When I'm developing an app and something new comes in and I dont know anything about it eg. an Api or library. I feel like I'm the worst programmer after all these years I've been programming I dont even know this. People pay me for this and I have no idea what this new library is. And so on.
      This kind of "Imposter syndrom"..
      I've been into depression for weeks. I really want you to talk about this. You are experienced and you can guide better.
      I tried to cope it with "Beginner mindset". I just sat and said to myself that im a complete beginner and i should learn it from ground. This helps a bit. But not permanently.

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад +1

      Sure thing, we all feel this with new libraries. I simply let folks know that there will be a much needed week of ramp up and experimentation time before we get a useful prototype. No expectations will be too high this way.

  • @ots1166
    @ots1166 5 лет назад +1

    First

  • @Dj_Realest
    @Dj_Realest 5 лет назад +1

    func convert(string: String) -> Int {
    var Dictionary: [String : Int] = ["1337":1337]
    return (Dictionary[string] ?? 0)
    }

  • @ciantim2996
    @ciantim2996 5 лет назад

    Who can share that course for me?

    • @dilsmatchanov
      @dilsmatchanov 5 лет назад

      All courses are in the description

  • @adamm3122
    @adamm3122 5 лет назад

    I’ve searched everywhere for a good swift and Chromecast tutorial. Nothing. Hint hint ;)

  • @tomross4599
    @tomross4599 5 лет назад

    Are you sure it’s called a Hash Map in Swift? Apple‘s website is calling it Dictionary as well.

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад

      Like was mentioned in the video, every other language calls it hash maps. You’ll sound rather strange in the world if you say dictionaries.

    • @tomross4599
      @tomross4599 5 лет назад

      Lets Build That App I kind of agree, but this structure is called Dictionary in ObjC and Python as well. I think in PHP it’s an associative array. So if people think I sound strange they probably lack the experience and level of abstraction there. Always good to know that in CS the same concepts keep showing up under different names.

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад +1

      The generic term for this concept is usually Hash Maps since there almost always involves some hashing of the keys using an appropriate hashing function. Additional discussion goes into collision detection and resizing of your hash map collection when necessary. Finally there's also the study of optimizing your hash function such that you minimize collisions, improving efficiency of fetch/storing elements in the map.
      It's a very interesting study that takes into account a lot of things I rarely think about.

  • @rahmanatiqur2332
    @rahmanatiqur2332 5 лет назад

    Android content please

  • @BBorn223
    @BBorn223 5 лет назад

    For someone who doesn't get 1337, I think it means elite (1337 -> l33T -> LEET -> elite)

  • @mateo5677
    @mateo5677 5 лет назад

    You lost me at import UIKit

  • @lingbuqing
    @lingbuqing 5 лет назад

    这个人是诈骗别人的,不要相信他

  • @ObtecularPk
    @ObtecularPk 5 лет назад

    This is a joke, right? That's an interview question?

    • @LetsBuildThatApp
      @LetsBuildThatApp  5 лет назад

      This is a very common interview question among other filter questions. You can find this easily by googling around.