fb

package
v0.0.0-...-ba76322 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

README

https://www.interviewbit.com/search/?q=Facebook

https://www.geeksforgeeks.org/top-10-algorithms-in-interview-questions/ https://www.geeksforgeeks.org/top-10-algorithms-in-interview-questions-set-2/?ref=rp

Storage Scalability Design Cache Amazon Facebook Google Ola Cabs Highly Available Database Amazon Facebook Highly Consistent Database Facebook Arrays Rotate Matrix Arrangement Google Facebook Amazon Max Sum Contiguous Subarray Array Math Facebook Paypal Yahoo Microsoft LinkedIn Amazon Goldman Sachs System Design Interview Questions Design URL Shortener Amazon Directi Zenefits Facebook Design Messenger Amazon Amazon Lab126 Facebook Google Twitter Design Search Typeahead Facebook Google Math Rearrange Array Number encoding Facebook Binary Search Square Root of Integer Search answer Facebook Amazon Microsoft Rotated Array Sort modification Facebook Rotated Sorted Array Search Sort modification Facebook Google Microsoft Amazon Strings Implement StrStr String Search Facebook Amazon Qualcomm Wipro Microsoft Integer To Roman String math Amazon Facebook Microsoft Twitter Roman To Integer String math Amazon Facebook Microsoft Twitter Pretty Json Pretty print Facebook Microsoft Count And Say string Simulation Facebook Amazon Add Binary Strings String math Facebook Microsoft Reverse the String Words Qualcomm Amazon Microsoft Cisco Facebook Two Pointers Diffk Sorting Facebook Intersection Of Sorted Arrays Multiple arrays Facebook Google 3 Sum Sorting Facebook Amazon Microsoft Sort by Color Inplace Update Facebook Microsoft Container With Most Water Tricks Facebook Google Amazon Adobe 3 Sum Zero Sorting Facebook Google Linked Lists Add Two Numbers as Lists List math Amazon Qualcomm Microsoft Facebook Reverse Link List II List 2 pointer pointer move list trick Facebook Microsoft Amazon Stacks And Queues Evaluate Expression Stack math Yahoo Google Facebook Largest Rectangle in Histogram cleverstack Google Facebook Amazon Backtracking All Unique Permutations Microsoft Facebook Google Combination Sum Subsets Facebook Amazon Adobe Generate all Parentheses II Bruteforce builder Pruned builder Facebook Microsoft Letter Phone Bruteforce builder Facebook Epic systems Hashing Substring Concatenation Incremental hash Facebook 2 Sum Hash Search Facebook Amazon Google Diffk II Hash Search Facebook Equal Key formation Facebook Tree Data Structure Least Common Ancestor Tree search Facebook Adobe Microsoft Amazon Google Valid Binary Search Tree Simple tree ops Amazon Facebook Max Depth of Binary Tree Root to leaf Goldman Sachs Facebook Bloomberg Microsoft BST Iterator BST traversal Apple Amazon Facebook Min Depth of Binary Tree Root to leaf Facebook Amazon Dynamic Programming Longest Increasing Subsequence 2D string DP Facebook Yahoo Epic systems Amazon Microsoft Unique Paths in a Grid Matrix DP Facebook Ways to Decode Simple array DP Facebook Amazon Best Time to Buy and Sell Stocks II Adhoc Amazon Facebook Best Time to Buy and Sell Stocks III DP tricky Amazon Facebook Best Time to Buy and Sell Stocks I Suffix / prefix DP Amazon Facebook Regular Expression Match 2D string DP Facebook Microsoft Regular Expression II 2D string DP Facebook Microsoft Google Graph Data Structure & Algorithms Level Order graph traversal BFS Facebook Groupon Goldman Sachs Clone Graph graph hashing Google Facebook Amazon Largest Distance between nodes of a Tree Depth first search Facebook Google DP on a tree Depth first search

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerWithMostWater

func ContainerWithMostWater(arr []int) (int, int, int)

two pointers increment left if returns area, i, j

func DiffK

func DiffK(arr []int, k int) (int, int)

incorrect solution

func DiffK2

func DiffK2(arr []int, k int) (int, int)

two pointers same direction assumes sorted make sure to check pointers are not same location and check absolute difference is K

func DiffKBinary

func DiffKBinary(arr []int, k int) int

binary search

func GenerateParenthesis

func GenerateParenthesis(n int) map[string]bool

func GetRotatedIndex

func GetRotatedIndex(arr []int) int

assume sorted

func GroupAnagrams

func GroupAnagrams(words []string) [][]string

func Intersection

func Intersection(a []int, b []int) []int

both arrays are sorted

func MaxContiguousSubarray

func MaxContiguousSubarray(array []int) int

func MaxProfit

func MaxProfit(arr []int) (int, int, int)

func MaxProfit2

func MaxProfit2(arr []int) (int, int, int)

func PrintLCA

func PrintLCA(node *LCANode, ns int, ch byte)

func RearrangeArray

func RearrangeArray(arr []int) []int

func RotateMatrix

func RotateMatrix(matrix [][]string) [][]string

func SearchRotatedArray

func SearchRotatedArray(arr []int, searchVal int, rotatedIndex int) int

split array into 2 by rotatedIndex and search in each

func SortByColor

func SortByColor(arr []int) []int

only values are -1, 0, 1

func SortItems

func SortItems(n int, m int, group []int, beforeItems [][]int) []int

func Stretch

func Stretch(root *StretchNode, amount int)

func ThreeSum

func ThreeSum(arr []int, s int) (bool, int, int, int)

func ThreeSumClosest

func ThreeSumClosest(arr []int, sum int) (int, int, int, int)

with duplicates after sorting two pointers are front and back. move only one pointer at a time depending on < sum or > dont forget absolute compare

func TreeLargestDistance

func TreeLargestDistance(array []int) int

func TreeLargestDistance2

func TreeLargestDistance2(root *LDNode) int

Types

type BSTIterator

type BSTIterator struct {
	Root *BiNode
	//position *BiNode
	Stack []*BiNode
}

func (*BSTIterator) AddAll

func (b *BSTIterator) AddAll(node *BiNode)

func (*BSTIterator) HasNext

func (b *BSTIterator) HasNext() bool

func (*BSTIterator) Next

func (b *BSTIterator) Next() string

func (*BSTIterator) Print

func (b *BSTIterator) Print()

type BiNode

type BiNode struct {
	Value string
	Left  *BiNode
	Right *BiNode
}

type FeedObject

type FeedObject struct {
	// contains filtered or unexported fields
}

type Graph

type Graph struct {
	Edges map[Vertex][]Vertex
}

type GroupGraph

type GroupGraph struct {
	Edges map[int][]int
}

type LCANode

type LCANode struct {
	Value int
	Left  *LCANode
	Right *LCANode
}

func LCA

func LCA(node *LCANode, x, y int) *LCANode

type LDNode

type LDNode struct {
	Value int
	Child []*LDNode
}

type NDCache

type NDCache struct {
	// contains filtered or unexported fields
}

type StretchNode

type StretchNode struct {
	Value int
	Left  *StretchNode
	Right *StretchNode
}

type TopoGraph

type TopoGraph struct {
	// contains filtered or unexported fields
}

func (*TopoGraph) TopoSort

func (t *TopoGraph) TopoSort() []string

type Vertex

type Vertex struct {
	Label string
}

func ArrangeLetters

func ArrangeLetters(dictionary []string) []Vertex

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL