Skip to main content

Posts

Showing posts from April, 2021

Leetcode tips

  If input array is sorted then - Binary search - Two pointers If asked for all permutations/subsets then - Backtracking If given a tree then - DFS - BFS If given a graph then - DFS - BFS If given a linked list then - Two pointers If recursion is banned then - Stack If must solve in-place then - Swap corresponding values - Store one or more different values in the same pointer If asked for maximum/minumum subarray/subset/options then - Dynamic programming If asked for top/least K items then - Heap If asked for common strings then - Map - Trie Else - Map/Set for O(1) time & O(n) space - Sort input for O(nlogn) time and O(1) space

System Design And Analysis Complete

What is System Design Systems design is the process of defining the architecture, product design, modules, interfaces, and data for a system to satisfy specified requirements. Systems design could be seen as the application of systems theory to product development How to Prepare for System Design While every system design interview is different, there are some common steps you should cover, even if the conversation might not be as sequential as your ideal thought process. The system design interview is an open-ended conversation, which you’ll be expected to lead. Try using the following steps to guide your discussion: Step 1 — Understand the Goals Clarifying ambiguities early in the interview is critical. Candidates who spend time clearly defining the end goals of the system have a better chance of success than those who don’t. For that reason, make sure you understand the basic requirements and ask clarification questions. Start with the most basic assumptions: ·  ...