Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Daily

  1. Round Robin CTCI Problems daily using whiteboard (120 questions in book + Careercup + Glassdoor, etc.)
  • Time constraint myself. Move fast
  • Talk outloud
  • Ensure I use algorithm solving strategies - CTCI Summary, Use 4 Algo approaches, and optimize with BUD
  1. One Data Structure, Algorithm, and Concept daily using no syntax or whiteboard

*Make sure to check out careercup Facebook specific questions

Glassdoor + Careercup Questions

1. 5x Balance a string with parentheses. "a(b)" -> "a(b)"; "(((((" -> ""; "(()())" -> "(()())"; ")ab(()" -> "ab()"; 
    etc...  + You have a string consisting of open and closed parentheses, but parentheses may be imbalanced.
2. 2x Given a 2D array of characters ('-' , 'X' , 'R' , 'T   '),
    find out whether there is a path from the robot 'R' to the target 'T'. 
    The robot can move up, down, left or right. 
    Cells marked with 'X' are blocked and cannot be passed through.
3. 5x Give tasks of diferrent kinds and a cooldown time. 
    Tasks of same kind must be separated by at least cooldown time to executed. 
    Write a program to detect conflicts in meeting schedules... 
    Given a schedule (array of start and end times) for meetings, provide an 
    algorithm that finds the minimum number of rooms needed for the day.    
4. 3x Do an in-place (without allocating any extra memory) rearrangement of a list of integers, 
    putting non-zero elements first. 
5. 6x Given Binary Tree is Binary Search tree or not.
6. 3x Given an array of integers find a contiguous subset that sums to a given number  
7. 3x Given a string break it up into meaningful sentence 
    "thesystemisrunning" => the system is running + Figure out how many words are in a string  
8. longest path in a tree regardless the directions? 
9. 2x Valid lottery number given string of digits
10. 2x find area of a room, 2D array, robot can move up down left right


Extra, probably google:
1. Parse a string containing numbers and "+", "-" and parentheses. Evaluate the expression.
2. You have a string of numbers, i.e. 123. 
    You can insert a + or - sign in front of ever number, or you can leave it empty. 
    Find all of the different possibilities, make the calculation and return the sum. 
    For example; +1+2+3 = 6 +12+3 = 15 +123 = 123 +1+23 = 24 ... -1-2-3 = 6 ... 
        Return the sum of all the results. 
3. variation of LCA problem  
4. Given two words and a dictionary, print the path from one word to the next 
    changing one letter at a time  
5. Given a list of chars, return the 2nd most frequently occurring char. 
6. Matrix of 0s and 1s, find left most 1
7. Find prime factors of number
8. mutiply two huge numbers one="98245092837409283720348029384" two="19823049823402938423"
9. Given %, ie. .4, find number in sorted array at position.
10. got get repeating decimal patter of division e.g. 1/3, 1/6
11. given n1, n2 is the same number after removing 1 digit. Given the sum n1+n2,
    find all possible values for n1,n2
12. given odd number print diamond pattern recursively
13. Store BST in list, then restore

Reading in CTCI

1. 3x Print all permutations of a given string.  
2. merge two sorted linked lists  
3. Given an array of integers find the sum of k largest integers in that array.
4. Singly linked list. Print it backwards.
5. Search for an item in a sorted, but rotated, array.  
6. Permutation subsets 
7. 2x Coin DP problem
8. use bit operations to write a function that will determine if a number is a power of 2  
9. rotate a matrix 90 degrees clockwise  
10. Print a binary tree by column.  
11. Get digit - number of appearences of digit in array. i.e. 3 => {3, 13, 23, 30} = 4 times. 
    get digit - remove any number containing a digit. 
    get digit - return nth number
12. Can you use union to find detect cycle in directed graph
13. 3x Write fib iterator
14. In order successor of binary tree

Questions to google

1. Given the alphabet encoded as numbers (e.g., a=1, b=2, ..., z=26), 
    and a sequence of numbers (e.g., "23413259802"), 
    how many strings can be generated. 
2. Number pad combinations problem.
3. Given a million a million integers find the kth smallest  
4. Output a substring with at most k unique characters.
    "aabc" and k=2 -> "aab"  
5. Wildcard Pattern recognition  + match a regular expression to a string.  

Tips and Information about the interview

  • understanding of data structure fundamentals like pointers (as if you weren't using an object-oriented language).
  • Same as before OO, Algos, design etc.
  • They want to see that I can turn my ideas into code => fast
  • 45 mins. speed is important, have to move quick
  • Use Hints!!
  • Questions I ask are very important
  • Ensure you use variable names that demonstrate to the READER that you know what you are talking about (not just to you). i.e. use 'nextPointer' vs 'abc', don't put data type (like 'string' or 'int') in the name, use names that say what it is USED FOR not what it IS. Ask yourself: Would someone who has never spoken to you be able to understand what this variable is for?

Interviewer is a Coding and Algorithms ("Ninja")

  • Ask standard coding and algos questions.
  • Questions are designed to be challenging
  • know how to traverse a graph (either BFS or DFS)
  • understand how to do recursions.

Questions

Get FB Careercup + Glassdoor

MIT Google Handouts

FB site to practice coding: https://codelab.interviewbit.com/registration. (Careercup.com, Topcoder.com and Hackerrank.com are good places to go for practice problems also).

Career Cup All

Resources and Links

Big-O

Tutorial point data structures and algos