/GC

Primary LanguageObjective-C

GC

Binary tree

1. Simple binary tree traversal recursive functions & Binary tree to list, in order The same list, back to in order binary tree

Answer

2. Write a method to compare two binary trees.

Answer

3. Verify that a binary search tree is indeed a binary search tree.

4. 判断一棵树是否是BST.

Answer

5. Given a binary tree, write code to print the tree out line by line.

[Answer]

6. You have a simple tree structure Ⓐ and its clone ⓐ.Each node in the tree has a pointer to it's parent as well as an array of its children. Given an original tree's node Ⓑ and cloned tree ⓐ, implement a method that returns ⓑ (the clone of Ⓑ). (Imagine finding the matching UIButton/UISlider/UIView in a separate cloned view controller.)

[Answer]

7. How would you copy a custom object like a "Node" from a search tree in Objective C?

[Answer]

iOS

1. Design a simple photo stream app

  • Asked me to architect an app that pulls photos from a server and displays them in a feed

Answer

Ref

3. How to detect a common superview

4. What is your least favorite Cocoa API

  • What is your favorite framework? Why?

5. iOS developers have a "dispatch_after(when, queue, block )" Grand Central Dispatch (GCD) function they can utilize but once it's set up, these calls can not be easily cancelled. Describe how you might implement a more convenient version of this named "cancellable_dispatch_after"

6. Search Quesitons

  • How could you cancel a block in the operation queue after it has been dispatched?

  • Complex question about GCD and blocks. Prepare yourself to talk about issues that may occur (deadlock, starvation, strong reference cycles).

8. What are the negatives of a singleton instance

9. How objects can send messages to each other in Objective-C

LeetCode

1. Move Zeroes

Answer

2. Kth Largest in N Arrays

Answer

3. Two sum

Answer

4. Connecting Graph - Union Find

Answer

5. Implement Trie - Trie

Answer

6. Number of Airplanes in the Sky - Sweep Line

Answer

7. Trapping Rain Water - Heap

Answer

8. Heapify - Heap

Answer

9. Data Stream Median - HashHeap

Answer

10.Sliding Window Maximum - Deque

Answer