AlgoCasts
Run Tests:
cd exercises
jest reversestring/test.js --watch
Interview Questions
Given a list of integers and a target number, list all pairs that sum up to that number
Problem: Given a sequence of non-negative integers A and an integer T, return whether there is a continuous sequence of A that sums up to exactly T. Example: [23, 5, 4, 7, 2, 11], 20. Return True because 7 + 2 + 11 = 20 [1, 3, 5, 23, 2], 8. Return True because 3 + 5 = 8 [1, 3, 5, 23, 2], 7 Return False because no sequence in this array adds up to 7
Note: We are looking for an O(N) solution. There is an obvious O(N^2) solution which is a good starting point but is not the final solution we are looking for. It’s important for the code to be as efficient as possible.
Question: Determine if any 3 integers in an array sum to 0. Note: The following solutions assumes that repetitions (i.e. choosing the same array element more than once) are allowed, so the array [-5,1,10] contains a zero sum (-5-5+10) and so does [0] (0+0+0).
[4, 2, -1, 1, -5, 6, -4] = True
Takes 3 inputs :
array of points, integer k -> find the closest point to some other origin points,int o ->
O= 0
K= 1
n = {[1,1] [2,2] [3,3]}
Find the closest point from given O and K in n.
Interview Questions
You are to write pseudo code O(n) algorithm to maximize a one day trade. You will have 5 days of predicted prices and your algorithm must choose what day to buy and sell to maximize gains.
Question: matrices, graphs, data structures,list of lists,
--->>>> Merge K sorted Lists, Generate Valid Parenthesis, Variation of Buy/Sell Stock LeetCode question <----
Interview Questions Balance parenthesis by removal, generate fibonacci.
Interview Questions
Boggle game - given a board of letters (2d array) and a word (string), return whether the word exists in the board. From each letter you can move in all directions (including diagonals), but you cannot use the same letter twice.
Given an array of integers, write an in-place function to bring all the non-zero elements to the left of the array keeping the original order.
Write a basic Regex engine implementing the "." (any character) and "*" (previous rule, 0 to many). The function receives a string (letters only, no need for escaping) and a string pattern. It returns a bool whether the string matches the pattern. For example, the pattern "AB.*E" should match both "ABCDE" and "ABEEE".
Given a pointer to the head of a singly linked list, iterate it backwards printing the values in reverse. Give 2 implementations - a recursive one, and an iterative one.
Business/Product scenarios: Talking to a CEO of a company that do not currently use Facebook, how can they use their existing customers database to start a targeted campaign?; Which metrics are the most meaningful for a CEO? (Awareness/Conversions/Retention) How these metrics can be measured (technically) using Facebook products?; Using Facebook ads to promote a mobile app, how would you detect and count installs that were caused by the campaign on…
Interview Questions
Write an algorithm to verify if a tree is a binary search tree