Skip to content

Instantly share code, notes, and snippets.

@codephillip
Created July 5, 2024 11:54
Show Gist options
  • Save codephillip/a6af20b914e5cdd8ff3b0ee6ac282b09 to your computer and use it in GitHub Desktop.
Save codephillip/a6af20b914e5cdd8ff3b0ee6ac282b09 to your computer and use it in GitHub Desktop.
interview prep blog notes

Lessons

General

  • easy questions boost confidence

leetcode discussion groups - linkedlist - not common - 2 years is too old - filter latest questions - self question using script - 30 - 40 questions - graphs, dp, binary search are the most common - interviewing.io on youtube for interview simulations. pause, think through the solution, then play - clement

  • clarify and dry run

https://www.youtube.com/watch?v=GPIuPRqDGG8&ab_channel=DaveBurji

  • learn solutions not problems. learn patterns
  • collect easy and medium questions ordered by frequency
  • arrays, trees, backtracking, priority queues
  • top pyramid are most common, 1to1
  • less common questions is easier
  • Remember that to best prepare for your interviews, you should look at multiple ways of solving problems.
  • Use the editorial answers as opposed to youtube
  • Look at the algorithm not the solution. Look at the solution if the algorithm is ambiguous. Code out the algorithm
  • Write algorithm templates
  • Track using excel
  • Utilize the leetcode feature
  • Check other submissions and editorial after passing
  • Redo using a different method
  • practise with less info
  • come up with your own test cases
  • how would you optimize
  • You usually have to use more space (memory) to make something go faster (and vice-versa), so if you’re optimizing for speed, you probably need to use a data structure.
  • crosscheck

Undeclared variables Off-by-one errors Reversed conditionals (e.g. “<” instead of “>=”) Bad variable names Null pointer exceptions - If you worked with a mock interviewer, there are two questions you should answer: 1) how do you feel about your own performance, and 2) how would your interviewer rate you between hire, no hire, or on the fence. The key to these two questions is figuring out whether your self-assignment aligns with that of your interviewer

  • get a good grasp of the language ie collections, math, tips and tricks(start with the easy questions)
  • do the leetcode learn cards
  • start wide 2 weeks and narrow
  • do the leetcode assessments and get graded on other candidates; get highlighted areas of improvement
  • use youtube tutorials sparingly as some of the tutors are also learning or are full of non-sequitur
  • use chatgpt for concise answers and explanations
  • walkthrough the code with examples and visualise the output at each stage
  • buffer the question of you looked at the answer and use spaced repetition
  • hide the difficulty and tags
  • track progress in excel
  • most medium and difficult problems are built on the easy questions. study the editorial answers carefully and understand the fundamental approach ie binary search has left, right, normal
  • take note of gems in the editorial whether you passed or failed
  • bookmark algorithms to practice further
  • solving a problem vs knowing the patterns behind the problem

Key points

  • sorted array == binary search
  • Monotonic stacks are a good option when a problem involves comparing the size of numeric elements, with their order being relevant.
  • a good way to check if a problem should be solved with DP or greedy is to first assume that it can be solved greedily, then try to think of a counterexample
  • x in set() is O(1)
  • x in list() is O(n)

Steps

  • walk through
  • algorithm
  • code

Fundamentals(2 weeks)

  • learn to read code(explore other code submissions and discussion section)
  • DS arrays and strings
  • algo: two pointers, sliding window
  • practice the language basics ie collections, functools, statistics, utility functions of default DSAs

https://github.com/zhiwehu/Python-programming-exercises/blob/master/100%2B%20Python%20challenging%20programming%20exercises.txt https://leetcode.com/studyplan/programming-skills/ - learn to read the editorial answers ie find articles by good editors(hai_dee). all solutions are equal but some solutions are more equal than others - practice easy questions - practice design questions - practice binary search, divide and conquer, sorting algorithms

Intermediate(1 month)

Tools: level hide chrome extension, excel tracker, stopwatch https://leetcode.com/explore/interview/card/top-interview-questions-easy/ - practice by DSA/ leetcode cards following this roadmap(neetcode.io/roadmap)(1 every 2 days) week 3-4 - DS: stacks, queues, linkedlist, trees - algo: BFS, DFS, recurssion, backtracking - competition: 100 questions, daily, contest - assisted: topics, hints, use the algorithm not the code, look at the code as last resort, rewrite it from memory(don't submit, just bookmark as a redo and do it tomorrow)

Advanced(1 month)

https://leetcode.com/studyplan/top-interview-150 https://leetcode.com/studyplan/dynamic-programming https://leetcode.com/explore/interview/card/top-interview-questions-medium/ https://leetcode.com/explore/interview/card/top-interview-questions-hard/ - tackle by company and frequency - practice interviews using the leetcode assessment feature. keep track of the areas for improvement - practice strictly medium and hard questions - DS: heap, graphs, trie - algo: binary search, dp, greedy - redo passed questions using a different technique - most important: binary search, dp, graphs

Interview experience

application phase

  • compile job descriptions
  • tweak your CV often

interview

  • micro yeses
  • integrate your experience whenever possible
  • know about the company
  • ask intelligent questions. people like to talk about themselves. readup about the company, the tech stack, technology challenges and ask from there
  • prepare
    • why do you want to join our company
    • why did you leave your previous job
    • what is your weakness
  • build rapport
  • lead the interview. your last answer influences the next question
  • mutual connections with recruiter

System design tips

Clarifying questions/Constraint - constrain the problem, solve in 1 hr - share uses cases and focus on one

High level(metrics) - number of users, rps - memory, compute, latency, qps, throughput - ilities: scalability and performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment