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 - วิทยาศาสตร์และเทคโนโลยี
You can omit the Error suffix from the Error cases as the fact that it is error will be stated by the enum name
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.
Thanks. Yeah, I agree that the task is simple. I think that company just has the same task for every SWE level.
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.
@@901mejohn5 Yep, that would be a bad interview. Can't require memory of API
Thanks for your work! Looking forward to more videos coming out from you!
Sure, more to come =) Honestly, I was not expecting this video about image loader to be so appreciated.
I really loved this video - looking forward to more like it! 🎉
Happy to hear that!
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
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.
@@andrey_tech oh, you are absolutely right, it would be redundant then. But not the cancelation :)
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?
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!
@@andrey_techGreat, will be waiting for the videos 😄
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?
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 = )
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 )
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
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.
Cool, could you share the code with us? It will be very helpful.
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
This looks wrong. You should implement image caching...
It's true that images should be cached and this solution could be improved.