Interview Questions

How to submit a question/solution to this repo

  • fork repo at http://github.com/alex-wap/interview-q
  • clone repo on your computer git clone http://github.com/your-username/interview-q
  • cd into folder cd interview-q
  • create branch git checkout -b branch-name
  • create folder and markdown file (use same name for both)
  • add link to markdown file to List of Problems
  • git add . , git commit -m "problem name" , git push origin branch-name
  • go to your forked repo on github and click New pull request
  • more github tips

Table of Contents

List of Problems

Framework for Solving Problems

  1. Write down your input and output for the problem
  • What is your input?
  • What is your output?
  1. Clarify assumptions
  • "I assume this is allowed"
  • "I assume this is happening"
  1. Consider edge cases (this gives you extra time to decide your approach):
  • empty
  • one element
  • two elements
  • negative index
  • correct loops
  • null input?
  • unexpected input?
  1. Choose a data structure to solve the program (confirm with your interviewer):
  • Linked List
  • Stack
  • Queue
  • Tree
  • Binary Tree
  • Binary Search Tree
  • Trie
  • Heap
  • Hash Map
  • Graph
  1. Psudeo code
  • List out edge cases on the side
  1. Write code
  • Plan for early termination (in if statement)
  1. Test code (for general and edge cases)

Resources