Interview Tips
- Ask Clarifying Questions (Very Important)
- State your assumption out loud
- Very important to make sure interviewer and you are on the same page
- Start with the simplest algorithm
- Brute force can hep with making sure interviewer and you are in the same page
- Try not to stop with the simplest algorithm
- Think about all the data structures you know and try figuring out which one would be the best fit for the given problem
- Try figuring out Time as well as Space Complexity, iterate to make it better. Find the right middle ground.
- Take feedback seriously
- When implementing real code is required not pseudocode.
- test your solution
- boring corner case (input is null), interesting corner cases
- trade offs are very important
- code should seem maintainable, readable, when needed divide the code into functions
- Data Structures, Edge Cases, Input Methods, Handle Cases, Limits for data, Complexity, Return TypesTest Solutions on example data and edge cases dataWrite Clean, Structured and Compact CodeCreate Test Cases that may break initial solutionSolution Thoughts
- Can the inverted problem be solved more compactly? Can the problem be reduced? Complement Conditions?Methods
- Brute Force, Recursion, LoopingPossible Edge Cases
- Duplicates, Empty/nullFocus on solving problems, and not your ability to solve it Identify limits for variables usedAnalysis
- Time, Space, Network, Power, CPU Registers
Data Structures
- Arrays
- Unordered Sets
- Linked Lists
- Heaps
- Stacks
- Queue
- Hash Tables
- Maps
- Binary Trees
- Graphs
- Spanning Trees
Tasks
- Searching - Binary, Linear
- Sorting - Selection, Insertion, Merge, Heap Sort, Quick Sort
- Tree Traversal - BFS, DFS
- String Manupulation
- Bit Manipulation
Concepts
- Sliding Window
Algorithmic Methodologies
- Divide and Conquer
- Greedy
- Dynamic Programming
- Branch and Bound
- Backtracking
Common Problems
- 2D prefix sum
Interview Scoring
- Analytical Skills
- Did you need help?
- Is your solution optimal?time taken
- design/architect the solution, structure the problem and solution
- tradeoffs of a different decision
- Coding Skills
- ability to transform your algorithm to reasonable code
- was code clean and well organized
- Technical Knowledge
- CS Foundation
- Experience
- Technical Decisions in the past
- drive, initiative
- Cultural Fit/Communication skills
Interviewer feedback
- Did you understand the question without much help
- Did you understand the need for pre processing
- What are the data structures that you used? Did you pick the right one?
- How did you approach the data structure?
- Did you find the optimal algorithm
- Do you know how to compute time complexity
A few good questions
- https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-ii/
- https://leetcode.com/problems/zigzag-conversion/description/
- https://leetcode.com/problems/longest-palindromic-substring/description/g