Sie sind auf Seite 1von 2

Focus on following areas:

Data structures: Array, Linked List, Stack, Queue, Hash Table, BST, Map (Hash vs
Tree), Set, Trie & Graph. Understand cost of various operations like add, delete,
modify, search, sort, traverse, etc. Know pros and cons of each data structure and
what type of data they are good at representing.
Algorithms: Read up as many algorithms as you can. Pay close attention to how
they overcome the cons of data structures (if any) and exploit the pros of data
structures and any special attributes of data to find efficient solutions.
Maths: Brush up maths! It has a much bigger role to play than it appears in coding
interviews. By this time you will be good at problem solving. You will know how to
break down an unknown problem into similar and/or smaller known problems. Pick
some popular book(s) on coding interviews to know which maths topics are
relevant.
Coding: Practise writing elegant, correct and efficient code that is easy to read and
explain within 25-45 minutes.
Tips for coding interviews:
1. ask relevant questions before attempting to solve
2. break the problem into similar/smaller known problems
3. briefly discuss brute force approach, if required
4. where applicable, use
a. math
b. sorting
c. searching
d. traversal
e. recursion
f.

bit manipulation

g. dynamic programming
5. before implementing your algorithm
a. discuss it with the interviewer
b. discuss its time and space complexity

c. see if it can be improved based on above discussion


6. write test cases (before code!)
7. start small, test immediately
8. write functions that are
a. reusable
b. loosely coupled
c. small and do only one thing!
9. avoid
a. gotos
b. unnecessary variables
c. unnecessary/many/nested if-elses
10.always
a. validate input
b. check return codes
c. handle corner cases
d. trace your code with test cases before telling the interviewer - done!

Das könnte Ihnen auch gefallen