Mock iOS Facebook Interview 2020 - Software Engineer

  Рет қаралды 20,606

iOS Academy

iOS Academy

Күн бұрын

Пікірлер: 47
@deerdeer4071
@deerdeer4071 4 жыл бұрын
try checking the "move zeros to front" with the array [0, 7, 0]
@SerJG
@SerJG 4 жыл бұрын
Thank you for the video and sharing this information. As for your method that should return an array with all zeros in the beginning of it: In case when array has already zero in the beginning it will swap it to the end e.g. 0, 1, 2, 3, 4 and results of function will be 4, 1, 2, 3, 0
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Good catch - I actually noticed this after uploading. The solution would be to run a while loop to move the front index inward until a non 0 is found.
@Ryan-sr9zv
@Ryan-sr9zv 4 жыл бұрын
Swift 5 ... Just removeAll(where:) O(n), take the counts before and after O(2), and then append the filtered array O(1) to an array of zeros O(zeros)? Easier to maintain, less iteration.
@christopherliudahl-rackley9108
@christopherliudahl-rackley9108 3 жыл бұрын
FINALLY something in Objective-C! Please do more in Objective-C!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Coming soon
@venkateswarid8231
@venkateswarid8231 2 жыл бұрын
Thank u..do more for beginners coding questions in interview
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon
@Oscar-ig2gm
@Oscar-ig2gm 3 жыл бұрын
I think the solution for first question was wrong, but I liked your video ;)
@ZAP1able
@ZAP1able 4 жыл бұрын
What a chance! I am looking for algorithms and data structures with swift videos and I said almost I found one but it is objc
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Don’t worry, I will be adding more in Swift
@MrMarat24
@MrMarat24 3 жыл бұрын
I think that for "Return whether or not it contains the UIView" you could have used just a while loop that runs on while(targetView != nil) { if(targetView == view || view == [targetView superView]) { return YES; } targetView = [targetView superView]; } without recursion. this solution should solve it in O(logn) while your solution works in o(n)
@franciselias1381
@franciselias1381 4 жыл бұрын
swift solution for first question: func zerosHandler (_ array : [Int]) -> (Int, [Int]) { var counter = 0 var newArray = [Int]() for eachValue in array { if eachValue == 0 { counter += 1 newArray.insert(eachValue, at: 0) } else { newArray.append(eachValue) } } return (counter, newArray) }
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Also a great solution! Thanks for sharing
@shynggyssaparbek2209
@shynggyssaparbek2209 3 жыл бұрын
Doen't insert works in O(N). Your solution would be O(N ^ 2) then
@franciselias1381
@franciselias1381 3 жыл бұрын
@@shynggyssaparbek2209 the point of this comment was to show that you can return multiple values from one func in swift. Inserting at row 0 does cost o(n) time since it shifts all elements which would make this algo run at o(n^2). A simple dictionary/hashmap could make this run o(n)..
@amitnaskar1497
@amitnaskar1497 4 жыл бұрын
Thank you for making this video. Do you provide any session on ios interview?
@iOSAcademy
@iOSAcademy 4 жыл бұрын
You're welcome! And yes! I do 1 on 1 and I also have a whole program for interviewing coming soon. Dm me on instagram @frazzyfraz
@amitnaskar1497
@amitnaskar1497 4 жыл бұрын
@@iOSAcademy I sent the request, please accept and I messaged you on LinkedIn. Please let me know if we can speak on iOS interview program. Thanks!
@sarojtiwari2496
@sarojtiwari2496 4 жыл бұрын
Your videos are very informative. Also can you share the code for the second question in swift
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Glad you like them! Sure, I plan to do mock interviews in swift as well!
@vijaytholpadis
@vijaytholpadis 4 жыл бұрын
I happened to solve it in Swift. Hope it helps. ------ func checkFor(_ view: UIView, in initialNode: UIView) -> UIView? { //Base case if initialNode.subviews.isEmpty { if initialNode == view { return initialNode.superview } } for i in 0..
@MrTalhakhan01
@MrTalhakhan01 2 жыл бұрын
Aren't these very basic tests for a company like Facebook?
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Yes
@JoffreyB
@JoffreyB 3 жыл бұрын
You don't need to zoom in like 10000000x, it's hard to see the whole code structure when you zoom into 1 line of code. Please do take note of that. Great video!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thanks for the feedback!
@cuevas714
@cuevas714 4 жыл бұрын
Awesome video ! Just subscribed :)
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Glad you liked it!
@pallaviligade5398
@pallaviligade5398 3 жыл бұрын
Do we need to write testcase for this type small Question. Also If there are any 1 hr task e.g API Parsing etc then do we need to write test case.
@HaggleLad
@HaggleLad 3 жыл бұрын
You recommend testing your solution but don't Facebook use Coderpad with execution *disabled* (in 2020), so that's not possible right?
@trs_4612
@trs_4612 3 жыл бұрын
funky question, guys. i legit don't know if you are an iOS Developer then you will interview using swift? i'm not familiar with the language. why i can't picture it is because given the nature of the interviews like loops, DS, and algorithm, i can't picture using swift for that.
@iOSAcademy
@iOSAcademy 3 жыл бұрын
You can use swift or objc
@trs_4612
@trs_4612 3 жыл бұрын
@@iOSAcademy thank you. i will do some more digging. i just switched from grinding leetcode using Python to iOS interviews.
@sheldon94666
@sheldon94666 4 жыл бұрын
It would be wrong if there is a nil nsnumber in that areay
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Correct
@vijaytholpadis
@vijaytholpadis 4 жыл бұрын
Thanks for the video. I solved the "Bringing zeros to the front" problem in the following way in Swift. It also retains the order of other elements. Time complexity: O(n) ---------- func bringZerosToTheFront(_ array: inout [Int]) { var countIndex = array.count - 1 let arrayLength = array.count for i in (0..
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Nice! Great solution
@42ALR42
@42ALR42 4 жыл бұрын
In a more Swifty way I would do a reorder function like this : func reArrangeArray(input: inout Array, indexDelete: Int, indexInsert: Int) -> Array { let reArrangedItem = input.remove(at: indexDelete) input.insert(reArrangedItem, at: indexInsert) return input } An then the method to use it func reorder() { var arrCopy = arr arrCopy.enumerated().forEach { (index , item) in if item == 0 { reArrangeArray(input: &arrCopy, indexDelete: index, indexInsert: 0) } } print(arrCopy) }
@mike_zander
@mike_zander 3 жыл бұрын
Hey great video! Even though Facebook uses Obj-C, can you use swift for these domain specific questions??
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Yes you can! I personally did a few years back ;)
@abdulrahim46
@abdulrahim46 4 жыл бұрын
Thanks. Keep up the good work!
@iOSAcademy
@iOSAcademy 4 жыл бұрын
thanks!
@AnkitSoni30
@AnkitSoni30 4 жыл бұрын
thanks for the video..
@SWATversion3
@SWATversion3 4 жыл бұрын
Your move zeros to front will not work if the array starts with 0 or a series of zeros. This solution will get you disqualified.
@Денис-ж3ф5р
@Денис-ж3ф5р 2 жыл бұрын
Objective c ++ ?
@iOSAcademy
@iOSAcademy Жыл бұрын
You can use that or objc
Facebook iOS Interview Question (Meta - Swift) - 2022
14:53
iOS Academy
Рет қаралды 12 М.
Design Instagram News Feed - iOS System Design Interview
18:25
Andrey Tech
Рет қаралды 18 М.
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Coding Interview | Software Engineer @ Bloomberg (Part 1)
30:05
Keep On Coding
Рет қаралды 4,7 МЛН
How to: Work at Google - Example Coding/Engineering Interview
24:02
Life at Google
Рет қаралды 7 МЛН
Most Tech Interview Prep is GARBAGE. (From a Principal Engineer at Amazon)
12:57
Easy Google Coding Interview With Ben Awad
28:00
Clément Mihailescu
Рет қаралды 1 МЛН
iOS Developer Mock Interview | Tech Round (Round-2)
31:37
Amazon iOS Interview Question (2022)
14:47
iOS Academy
Рет қаралды 13 М.