Opaque types @7:20 In Swift, "opaque types" are types where the concrete underlying type is hidden. They are declared using the some keyword. Opaque types are useful when you want to hide implementation details and provide abstraction. Here's a simple example in Swift: swift Copy code protocol Animal { func makeSound() } struct Dog: Animal { func makeSound() { print("Woof!") } } struct Cat: Animal { func makeSound() { print("Meow!") } } func randomAnimal() -> some Animal { return Bool.random() ? Dog() : Cat() } let animal = randomAnimal() animal.makeSound() // Output: Either "Woof!" or "Meow!" In this example, the function randomAnimal returns an opaque type some Animal. The concrete type returned by randomAnimal is hidden from the caller. The compiler ensures that the returned value conforms to the Animal protocol, but it does not expose the specific type of the returned value. This allows you to work with values of unknown concrete types while still benefiting from type safety and abstraction.
@@iCode_Happy_Coding Sir I am fresher does training of 3 months in ios and going for interview for ios developer pls tell me questions so that i can crack.
This is interesting, thank you. I have been studying for months, but for some reason, your depth of knowledge seems beyond me. My question is, it seems like they want you to have everything memorized? What about knowing how to do everything without being great at explaining?
Thanks for the kind words 🙂 And it’s not like they want you to memorise the things, instead they want to know the things with which we are dealing day in day out. When it comes to memorising stuff, they will ask questions like “in which iOS version XYZ was introduced” etc.. that’s about remembering it. But what good interviewers do is that they try to understand the your approach, the concept you know. For example, the protocol question in the video, ui updation on main thread concept. I hope that I answered your question up to some extent. Thanks 🙂
The way you keep answering, That's so awesome, one can't stop watching in between. Can you please make such mock interview with DS and Algo topic? That would be so helpful or if you can share the link if you already have one of it. Thanks!
Thanks Nihanth, I'm happy that you liked the video 🙂 and I completely agree with your point that there are absolutely no resources for preparing for system design rounds (for mobile devs). Will cover it very soon.
I'm glad that it was helpful for you. Will be releasing more such content (covering system design rounds/architectures) soon. All the best for your interviews 🙂
All tips were great and informative, expecting other parts too. Interview questions like design patterns used in Cocoa touch, Architecture patterns and many more.
I get this is a senior-level interview but as a person who is just starting to apply for an entry position, this is a lot of information and I barely know any answers to those questions. What would you recommend for the people like me to start preparing for these questions?
Well most interview questions I've seen from actually being in the field are a good grasp on concurrency in swift, GCD, sync vs async, optionals, difference between reference and value types, closures, class vs structs, know what it means for swift to be a protocol oriented programming, ARC memory management , know what value types add to swift, understand all the major architectures, MVC , MVVM, VIPER, and what the coordinator does when added, Know different design patterns like bridges & adapters etc, know the static method definition, and potentially DSA depending on the employer. There are many other nuance things but these are really good common concepts you'll see asked for sure.
Super-duper! Thanks a lot! keep up the good work. MVVM vs MVC, struct vs class, concurrency and multithreading n more via mock are curiously expecting…
Sure. I'm working on the content and will be releasing the videos for mock interviews soon(both initial rounds and system design rounds). Glad that you liked the video 🙂
Stored properties require memory to save values, and adding them through extensions will require addition in memory allotted for that type. That is how the existing behaviour of the types is being changed, which extensions are not allowed to do. That's why they can have computed properties, not stored ones. I hope that clears. Thanks for watching the video 🙂
That relates to the memory allocation patterns of Swift, and in case of functions (local variables) it is done on stacks (instead of heaps). I’ll try to discuss this in detail in one of the upcoming videos. Meanwhile, this can answer some of your queries heartbeat.fritz.ai/memory-management-in-swift-heaps-stacks-baa755abe16a
@pallav I would like to give you some donation, so that you can carry your work and focus on more Design Question on iOS Side. I also worked as iOS Application developer since last 10 years but never seen so contentfull videos. You are doing great work.
Thanks for this video. Content was on point. I was wondering what will be the degree of relevance of leetcode style questions in interviews? At SDE2 or SDE1?
Thanks for the kind words Rachit. About the leetcode thing, did you mean about DSA questions. That depends on the company that you are appearing for. Some of them focus more on System Design for SDE 2, while some of them still put DSA as a major filter for both SDE 1 and 2. I'll try to cover DSA questions for mobile developers soon. If I didn't get you right, let me know.
Hi. Thanks for sharing this interview session. To clear the interview there are different rounds that will be there for any company. could you please post a set of interview rounds like that? Thanks.
Hi Pallav, Is it possible to prepare for coding problems, DSA and DP in Swift? Or we have to do this in C++ or java? If it is possible then can you please share a good book or content of it where I can prepare it? Thanks in advance.
Hi, I'm not Pallav but maybe this can help you. First, yes, you can prepare yourself to practice with swift, give it a try in leetcode and hacker rank. For resources, google it and look for Swift data structure and algorithms from pack publishing, DSA in swift of raywenderlich and last but not least udacity swift DSA this one is a free course. Cheers.
Awesome video.. one question though, in case of computed properties in protocols, don’t we need to declare it in protocol as getter before writing into extension directly?
Thanks Arjun. We’ll be releasing interviews videos for System Design round and other tech rounds very soon. Stay tuned. Glad that you found it useful 🙂
I recently gone through an interview and they gave a feedback stating you also need to do some certifications. What do you think what kind of certifications can a Mac/iOS developer can complete. Let me know if there are any
you not only answred the question but explained it really really well, very informative and very helpful
Opaque types @7:20
In Swift, "opaque types" are types where the concrete underlying type is hidden. They are declared using the some keyword. Opaque types are useful when you want to hide implementation details and provide abstraction.
Here's a simple example in Swift:
swift
Copy code
protocol Animal {
func makeSound()
}
struct Dog: Animal {
func makeSound() {
print("Woof!")
}
}
struct Cat: Animal {
func makeSound() {
print("Meow!")
}
}
func randomAnimal() -> some Animal {
return Bool.random() ? Dog() : Cat()
}
let animal = randomAnimal()
animal.makeSound() // Output: Either "Woof!" or "Meow!"
In this example, the function randomAnimal returns an opaque type some Animal. The concrete type returned by randomAnimal is hidden from the caller. The compiler ensures that the returned value conforms to the Animal protocol, but it does not expose the specific type of the returned value.
This allows you to work with values of unknown concrete types while still benefiting from type safety and abstraction.
very informative, i will watch it many times so i can understand all the answers clearly.
Glad it was helpful! 🙂
@@iCode_Happy_Coding Sir I am fresher does training of 3 months in ios and going for interview for ios developer pls tell me questions so that i can crack.
@@Piyushkumar314did you clear that interview bro ??
Wonderful content. Please Sir bring more interview preparation series in iOS. Thanks a lot. 🙏🙏
Thanks Polo 🙂
Bhaisaab ...till best video I ever been through.
Thanks Abhishek 🙂
Thanks for this video. Content is very good.
Just small correction in video 3:58 i.e protocol can have either getter or getter and setter. :)
This is interesting, thank you.
I have been studying for months, but for some reason, your depth of knowledge seems beyond me.
My question is, it seems like they want you to have everything memorized? What about knowing how to do everything without being great at explaining?
Thanks for the kind words 🙂
And it’s not like they want you to memorise the things, instead they want to know the things with which we are dealing day in day out.
When it comes to memorising stuff, they will ask questions like “in which iOS version XYZ was introduced” etc.. that’s about remembering it.
But what good interviewers do is that they try to understand the your approach, the concept you know. For example, the protocol question in the video, ui updation on main thread concept.
I hope that I answered your question up to some extent.
Thanks 🙂
The way you keep answering, That's so awesome, one can't stop watching in between.
Can you please make such mock interview with DS and Algo topic? That would be so helpful or if you can share the link if you already have one of it. Thanks!
Thanks for the kind words and suggestion. We'll try covering that soon. 🙂
02:40 it's not that swift "extended" optional to value types. there are no value typed in ObjectiveC to begin with, right?
Most of the content was Informative. I’d appreciate if you could do system design mocks in iOS. I think that’s something that has lil to no resources.
Thanks Nihanth, I'm happy that you liked the video 🙂 and I completely agree with your point that there are absolutely no resources for preparing for system design rounds (for mobile devs). Will cover it very soon.
This was awesome. I am trying for interviews right now, so this series is going to be super helpful
I'm glad that it was helpful for you. Will be releasing more such content (covering system design rounds/architectures) soon. All the best for your interviews 🙂
Awesome Thank for sharing this video. I really enjoy this video.
Thanks, these discussions are very helpful, Waiting for more videos from your channel.
Thanks Pradip 🙂
All tips were great and informative, expecting other parts too. Interview questions like design patterns used in Cocoa touch, Architecture patterns and many more.
Thanks Manish. I'll try to cover these topics (along with system design mock) very soon.
Thanks for watching the video 🙂
some interviewess asked me about algorithms , please make a video on that as well , how to pass logic test and algo test as an iOS developer.
Thanks for the suggestion. I’ll try to cover DSA in one of the videos.
I get this is a senior-level interview but as a person who is just starting to apply for an entry position, this is a lot of information and I barely know any answers to those questions. What would you recommend for the people like me to start preparing for these questions?
Well most interview questions I've seen from actually being in the field are a good grasp on concurrency in swift, GCD, sync vs async, optionals, difference between reference and value types, closures, class vs structs, know what it means for swift to be a protocol oriented programming, ARC memory management , know what value types add to swift, understand all the major architectures, MVC , MVVM, VIPER, and what the coordinator does when added, Know different design patterns like bridges & adapters etc, know the static method definition, and potentially DSA depending on the employer. There are many other nuance things but these are really good common concepts you'll see asked for sure.
very informative videos. Please make detail video related to interview topics. Thanks
Thanks for the suggestion Shashwat. I’ll try to cover interview related content.
can you please add subtitles !!? Thank you!
Great and informative, Nicely explained. Can you please make video on In App purchase
Thanks for the suggestion Amol, I’ll definitely try to cover IAP. I’m glad that you liked the video🙂
Helpful video. For sure I am gonna follow your tips
Glad that you found it helpful 🙂
Indeed great job. it was much needed. As I can see there were no mock interviews videos available for iOS developer. Thank you for creating this
Glad that you found it useful 🙂
It was really helpful. have interview tomorrow.
Awesome, just awesome, we need more topics in interviews as well.
Like randomly asked questions.
Sure Aafaq, I’ll try to cover them.
Glad that you liked the video 🙂
@@iCode_Happy_Coding Cool, eager to catch them!
Super-duper! Thanks a lot! keep up the good work. MVVM vs MVC, struct vs class, concurrency and multithreading n more via mock are curiously expecting…
Sure, I’m working on the same and will be soon releasing videos on these topics. I’m glad that you liked the video 🙂
In coding test interviews what type programs they asked? Can you help me
Wow I was able wo answer almost all of the questions as I have seen each videos of yours. 💞 Thank you for all the amazing topics 💕
You are so welcome! 🙂
We want more videos like this. These are very informative.
Swift is reference type or value type? and how
Thanks for the video and some points were more clear the UI rendering on the main thread.
Thank you for sharing. Its really helpful
great video helped a lot 👍
Great...Nicely explained. Both have good command over the same. Impressive.
Thanks bhaiya. Your constant support keeps us motivated 🙂
Thank you, this is very amazing way to do mock interview.
Much appreciated, and looking forward for the upcoming videos.
Sure. I'm working on the content and will be releasing the videos for mock interviews soon(both initial rounds and system design rounds). Glad that you liked the video 🙂
Upload more videos like this. Its very informative.
informative ✌
Hi Pallav
Thanks for this video.
I didn't clearly understand the reason why extensions cannot have stored properties
Stored properties require memory to save values, and adding them through extensions will require addition in memory allotted for that type. That is how the existing behaviour of the types is being changed, which extensions are not allowed to do. That's why they can have computed properties, not stored ones. I hope that clears.
Thanks for watching the video 🙂
@@iCode_Happy_Coding And what happens when we add below things in extension
1. New methods
2. Computed properties
In terms of memory?
That relates to the memory allocation patterns of Swift, and in case of functions (local variables) it is done on stacks (instead of heaps).
I’ll try to discuss this in detail in one of the upcoming videos. Meanwhile, this can answer some of your queries
heartbeat.fritz.ai/memory-management-in-swift-heaps-stacks-baa755abe16a
Awesome.. Make some videos on interview preparations based on topics.
Good work.
Thanks for the suggestion Akshay. I recently did the video on Struct vs Class, you can have a look. I'll try cover more topics soon.
This is such an informative video. Could you please make more videos on ios interview prep.?
Sure Shivi, I'll try to cover more interview topics 🙂
Hehe protocols can’t actually hold variables, although I certainly see the confusion, get and set is really just protocol functions for implementation
Nicely done. However, an interview feels incomplete without the ending - HR will get back to you ;)
Haha... So true 😅
Make video on swift basic
Nice Video Pallav ... This will definitely help :)
Thanks Mayank, glad that you found it useful 🙂
Enjoyed the interview 😄
@pallav I would like to give you some donation, so that you can carry your work and focus on more Design Question on iOS Side. I also worked as iOS Application developer since last 10 years but never seen so contentfull videos. You are doing great work.
Really a nice video, subscribed your channel
Great Work!
Really Appreciated.
Thanks a lot! 🙂
Very useful. Please do more videos for iOS interview questions
Sure Suresh, working on the same.
Will be bringing more such video very soon.
Glad that you found it useful 🙂
The lady scares me, this kinda of interviews se he daar lagta hai lol. keep it up.
Helpful 👍
Glad to hear that 🙂
Thank you both.
Nice 😊👍
any questions related to database and api handling scenarios in mvvm and mvm .. and which makes better impact in long run ?
Thanks for the suggestion Rajesh. I'll try covering them in the next video that I'll do on interviews.
Thanks for this video. Content was on point. I was wondering what will be the degree of relevance of leetcode style questions in interviews? At SDE2 or SDE1?
Thanks for the kind words Rachit. About the leetcode thing, did you mean about DSA questions. That depends on the company that you are appearing for. Some of them focus more on System Design for SDE 2, while some of them still put DSA as a major filter for both SDE 1 and 2.
I'll try to cover DSA questions for mobile developers soon.
If I didn't get you right, let me know.
I love ur videos, but can u please insert a subtitle ? the auto generated of yt is kinda suck
Hi. Thanks for sharing this interview session. To clear the interview there are different rounds that will be there for any company. could you please post a set of interview rounds like that? Thanks.
Thanks for the suggestion Obulasetty. I’ll try making a video covering all the rounds 👍🏼
Very Good Video
Can you make more videos for interview?🙂
Please make more such videos for 2024
So nice. Did well.
Thanks Mittapalli, glad that you liked it 🙂
very informative! Please do more!!
Thanks Priya. I'm working on more such videos, and will be releasing them very soon.
Glad that you liked the video 🙂
How can I buy your T-shirt "Think Different"?
😊 That’s not mine, I bought it from Crazy Monk
crazymonk.in/developer-coder-linux-t-shirts/think-different-unisex-half-sleeve-t-shirt/
We need more interview and system design tutorial
I’m working on it, will try to complete it soon.
This is awesome.
Thanks Sudhanshu 🙂
Hi Pallav,
Is it possible to prepare for coding problems, DSA and DP in Swift? Or we have to do this in C++ or java? If it is possible then can you please share a good book or content of it where I can prepare it? Thanks in advance.
Hi, I'm not Pallav but maybe this can help you. First, yes, you can prepare yourself to practice with swift, give it a try in leetcode and hacker rank. For resources, google it and look for Swift data structure and algorithms from pack publishing, DSA in swift of raywenderlich and last but not least udacity swift DSA this one is a free course. Cheers.
Yes more such videos
Awesome video.. one question though, in case of computed properties in protocols, don’t we need to declare it in protocol as getter before writing into extension directly?
I liked this video. But I can suggest you to make more interactive.
Thanks for the feedback Prachi. I'll try to do that 🙂
Really useful...
Glad to hear that 🙂
Interview is very helpful 🙏🙏
Thanks Arjun. We’ll be releasing interviews videos for System Design round and other tech rounds very soon. Stay tuned.
Glad that you found it useful 🙂
Code wise explanation is better to understand.
Please provide interview questions for experience person..
Sure Neha 🙂
Please upload more videos on interview.
Sure Amit. I'll try to.
go through an interview with coredata
why are they switching the sound of "w" with the sound of "v", almost impossible to understand !!!
Make an interview for fresher iOS Devellopper
Please make more video that helps everyone
Yes Swapnil, we are working on content and will be releasing more interview videos very soon. Glad that you liked the video 🙂
Thanks for your video. Please add subtittle.
I recently gone through an interview and they gave a feedback stating you also need to do some certifications. What do you think what kind of certifications can a Mac/iOS developer can complete. Let me know if there are any
Sir, could you please share your Linkedin url
Nice video, but accent is hard to understand.
I just realised I am in no way ready for a interview damn sed life. ....
Please add subtittle 🙏🏻
I'll try to add subtitles. Thanks for bearing without subtitles.
Thanks 🙂
I hope I won't get any interviewer like this
bob
bob the kabob
I like to have LinkedIn connection with you or to follow your profile, would you mind share yours?
Sure Ahmed
www.linkedin.com/in/pallavtrivedi/
Geting add from scaller fake company firing its own employees lol