iOS Interview Question - Image Loader

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 มิ.ย. 2024
  • In this video, join me as I tackle an interesting coding challenge faced during an interview for the position of iOS Engineer. I'll be sharing the solution to this problem step-by-step, where I was asked to fix a poorly implemented image loader in a simple app. Watch as I demonstrate how to implement the image loader with error handling logic and write unit tests for this class.
    Chapters:
    0:00 Intro
    01:05 Image Loader
    5:22 Unit tests
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @fuxlud
    @fuxlud 24 วันที่ผ่านมา +1

    You can omit the Error suffix from the Error cases as the fact that it is error will be stated by the enum name

  • @guitaripod
    @guitaripod 10 หลายเดือนก่อน +4

    Cool stuff; please do more like this.
    I'm surprised this was a task for a staff engineer position, but it tests some level of aptitude.

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน +3

      Thanks. Yeah, I agree that the task is simple. I think that company just has the same task for every SWE level.

    • @901mejohn5
      @901mejohn5 2 หลายเดือนก่อน

      Think more so the decision making. You could solve this with Boolean instead of enum but that wouldn’t show staff experience.
      Unit test wise. Similar. Inexperienced but capable dev might forget the expectation fill for a sync functions.

    • @guitaripod
      @guitaripod 2 หลายเดือนก่อน

      @@901mejohn5 Yep, that would be a bad interview. Can't require memory of API

  • @kasper3845
    @kasper3845 10 หลายเดือนก่อน

    Thanks for your work! Looking forward to more videos coming out from you!

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน

      Sure, more to come =) Honestly, I was not expecting this video about image loader to be so appreciated.

  • @mr__khan5251
    @mr__khan5251 8 หลายเดือนก่อน

    I really loved this video - looking forward to more like it! 🎉

    • @andrey_tech
      @andrey_tech  8 หลายเดือนก่อน

      Happy to hear that!

  • @lex-qq9bu
    @lex-qq9bu 10 หลายเดือนก่อน

    Nice video series! Thanks Andrey.
    I would also add cancelation and caching here, which sounds quite critical for image loaders.
    Also would call dataTask on background, as we are not sure wether the "loadUserImage" was called from main thread or not

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน

      Hi, thanks for the comment. Sure, caching is a great idea. But there's no need to call dataTask on backround, because dataTask interface is already asynchronous.

    • @lex-qq9bu
      @lex-qq9bu 10 หลายเดือนก่อน +1

      @@andrey_tech oh, you are absolutely right, it would be redundant then. But not the cancelation :)

  • @RohitPatil_Tech
    @RohitPatil_Tech 10 หลายเดือนก่อน

    Thanks Andrey for the video. Such videos where interview questions are being solved is useful for folks preparing for interviews. ✌🏻
    Were there any follow up questions regarding this question after you completed writing code for this?

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน +3

      Yeah, thanks. There was another section with technical questions before the coding part. Nothing special on this interview.
      But I've recently interviewed with Uber and I would be realeasing 2 videos about their interview process soon. This would be much more interesting!

    • @RohitPatil_Tech
      @RohitPatil_Tech 10 หลายเดือนก่อน

      @@andrey_techGreat, will be waiting for the videos 😄

  • @TheAlienMann
    @TheAlienMann 10 หลายเดือนก่อน +1

    Thanks, Andrey 😊
    Question, please :)
    Right of the bat, you offload everything to main queue, why is that? Error checking or statusCode checking could be done right on the background queue, right?

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน

      As a general approach I do only significantly slow operations in the background queue. For instance, parsing big jsons/files. And for small things like an error check or status code check it doesn't matter. Also, I wouldn't call my code perfect in this video. It's just an example = )

  • @alexvaiman4966
    @alexvaiman4966 2 หลายเดือนก่อน

    no no )))) just return is bad... ))) return the error to the closer ) (2,24), also u should check the response code aka 200, when you use network call which throws(it is a must), yet, it good practice to check even in this case, you never know... maybe you cloud side friend decides it is a good idea return error, with error code 299 ))) you explain very nicely how to answer this type of quotations, I do have the knowledge, but luck skills of presentation, so thanks )

  • @TheShivamLko
    @TheShivamLko 10 หลายเดือนก่อน

    Hi I have 7 yrs exp in Android / Flutter.
    1. Please make a video for Career Path and Things to learn as per your experience. I mostly worked in small startups with Team of 2
    2. Where Can I learn System design for Mobile
    3. For Senior Roles System design for Web Backend is necessary ?
    4. How to become Solution Architect for Mobile

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน

      Hi, thanks, I'll try to talk about these in future videos. // 3. For senior roles it is required to know how to design an API and client-server communication, but you don't need to have a deep understanding of how the backend is structured. Although, I would suggest to have a high level understanding of system design in general.

  • @victorriurean
    @victorriurean 10 หลายเดือนก่อน

  • @Sam-ji2ue
    @Sam-ji2ue 10 หลายเดือนก่อน

    Cool, could you share the code with us? It will be very helpful.

    • @andrey_tech
      @andrey_tech  10 หลายเดือนก่อน +2

      There're a few sensitive things in this project, so I'm not ready to share it right away. Let me think about how to do this. Looks like I need a github for this youtube channel

  • @subhanc8214
    @subhanc8214 20 วันที่ผ่านมา

    This looks wrong. You should implement image caching...

    • @andrey_tech
      @andrey_tech  10 วันที่ผ่านมา

      It's true that images should be cached and this solution could be improved.