Amazon iOS Interview Question (2022)

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ย. 2024

ความคิดเห็น • 30

  • @iOSAcademy
    @iOSAcademy  2 ปีที่แล้ว +1

    Enjoy my teaching style? Check out iOS Academy+ iosacademy.io/plus

  • @fermatslasttheorem6298
    @fermatslasttheorem6298 2 ปีที่แล้ว +14

    Funny I see this since I just subscribed yesterday and had an interview with Amazon 3 days ago. But they asked me 2 string questions.
    First Question: Given string A and string B, calculate the minimum amount of swaps required to turn A to B.
    Second Question: Make a class called Dictionary that takes a list of strings as input. Add a function in Dictionary that takes a word and calculates whether it exists in the list of words IFF a word exists that is off by 1 character from the input. So if the input is “hella” and the list of words has “hello” then it would return true.

    • @n1tesh237
      @n1tesh237 2 ปีที่แล้ว +1

      Can u please share in such interview rounds do we get to use code intelligence?

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว +1

      Haha nice

  • @doseofdopamine2031
    @doseofdopamine2031 2 วันที่ผ่านมา

    it'd be great if you could explain the login behind your pointer update code. Why should it work?

  • @chrispy104k
    @chrispy104k 2 ปีที่แล้ว +1

    That's a poorly worded question but fortunately, as you say, the diagram gives you a better idea of what they are on about. Great explanation of how to tackle the solution.
    As an exercise I swapped the 2nd and the last element in the array to see he difference in the pointer adjustment. Works great.

  • @marcos6718
    @marcos6718 2 ปีที่แล้ว +2

    Thank you a bunch for your detailed explanations and clear style, keep it up!

  • @mykytakhlamov
    @mykytakhlamov ปีที่แล้ว

    Thanks for the video!
    Is it more efficient to first check if the current value is bigger than maxArea and then assign it, or is it better to directly assign it using max() even if the maximum value is the same?

  • @paccini1
    @paccini1 2 ปีที่แล้ว +1

    Awesome video, thanks!

  • @bunnyrabits
    @bunnyrabits 2 ปีที่แล้ว +1

    Hello Sir, I have almost 1.5 years of experience in iOS development. Just wanted to know if I try go for an interview now, what are the major topics my interviewer will expect me to know.

    • @elsayedahmed1162
      @elsayedahmed1162 2 ปีที่แล้ว

      hi , what about now? Did you do interview ? Or not

  • @mivico
    @mivico 2 ปีที่แล้ว +1

    Hey, is there a website you’re getting these questions from. I have an interview coming up and I’d like as many practice questions as possible. Thanks!

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว +2

      Leetcode!

    • @mivico
      @mivico 2 ปีที่แล้ว

      @@iOSAcademy Thank you! Big fan of the videos🙌🏾🙌🏾

  • @venkateshs4434
    @venkateshs4434 2 ปีที่แล้ว +2

    First like ❤️ love towards iOS academy

  • @AmitBiswastunebox
    @AmitBiswastunebox 2 ปีที่แล้ว

    Hi @afraz when will you launch the Interview prep at iOS Academy? Can you add me as a Beta User? Please

  • @blaze9590
    @blaze9590 2 ปีที่แล้ว +5

    It should be currentArea and not currentHeight

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว +2

      Yep, better naming needed for sure

  • @takeshi10131013
    @takeshi10131013 2 ปีที่แล้ว

    move the pointer part is tricky to understand can you explain more?

    • @tityseptiani8584
      @tityseptiani8584 2 ปีที่แล้ว

      Pointer is the index of the array. On the code sample, you can just print out the left and right which are the indices of the array from left to right. Then you'll see the pointer changes in each iteration

    • @takeshi10131013
      @takeshi10131013 2 ปีที่แล้ว

      @@tityseptiani8584 i understand move the point can get the area. But the way how it moves in the example doesn’t cover all the cases. How to verify this way cannot miss the biggest area?

  • @mehmetfazlkulakoglu7201
    @mehmetfazlkulakoglu7201 2 ปีที่แล้ว +1

    Hey Afraz,
    Thanks for sharing videos. All of them very helpful.
    import UIKit
    let input = [1, 8, 6, 2, 5, 4, 8, 3, 7]
    func getMaxArea(_ height: [Int]) -> Int {
    var result = [Int]()
    if height.count > 1 {
    for i in 0...(height.count - 2) {
    for j in (i + 1)...(height.count - 1) {
    result.append(min(height[i], height[j]) * (j - i))
    }
    }
    }
    print("Result: \(result.max()!)")
    return result.max()!
    }
    getMaxArea(input)
    This's the answer that i can do. Is it nice for interview?

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว +1

      Youre welcome & looks good

  • @awesamlol1
    @awesamlol1 2 ปีที่แล้ว +5

    Ive seen this question on multiple interviews. Pretty standard. Probably just worded in different context but the general concept remains the same.
    My only recommendation is renaming "currentHeight" to "currentArea" since you're recalculating to get the current area and comparing it for it's maximum agains the maximum area.
    Overall, I really enjoy your videos and excited to watch more .
    Update: I had trouble understanding the logic of the moving pointers but I finally got it. I appreciate this.