My implementations for commonly asked questions in interviews. Method names are in italics. You can find the full implementation in this link or you can refer to individual implementations as shown below.

  1. Reverse a string reverseString(str: String)
  2. Reverse string in place reverseStringInPlace
  3. Print two sum in a array printTwoSum
  4. Implement Queue using Stacks QueueUsingStacks
  5. Binary Search Tree And Check For Validity BST
  6. Combine Two Sorted Arrays
  7. Print Common Numbers In Arrays printCommonNumbersIn
  8. Validate the brackets BracketValidator
  9. Get the maximum people living in a particular year GetMaximumYearPeopleLiving
  10. Adjacency graph / Graph Coloring Problem AdjacencyGraph graphColoringProblem
  11. Reverse Words in a Array
  12. Graph Traversal (Breadth First Search and Depth First Search)
  13. Check if all permutations of the word is palindrome or not
  14. Implement a custom nsnotification center in swift
  15. Deleting a node from a binary search tree in swift
  16. Find if the binary tree is balanced
  17. Find if a string is permutation palindrome
  18. Find shortest path between two nodes in a graph
  19. Dynamic Programming – Knapsack problem
  20. Second Largest Item in a binary search tree

More implementations are available here Gist