remmber-these

  1. n&(n-1) will set the lsb 1 to 0
  2. n& ~(n-1) will leaves the first lsb 1 as 1 and the rest as 0
  3. Traverse the tree only once. Figure out a way to do it. Ex: tilt, sum , balancedtree

OOPS design

  1. Parking Lot
  2. Elevator
  3. Restaurent Management System
  4. Card Game
  5. Ebook reader

Doubly linked list, print matrix in spiral form, Patient appointment system, design a URL shortener sevice.

Design (and draw an infrastructure diagram for) a system in which speed detection cameras upload snapshots for each vehicle (with a license plate ID, timestamp, and location included) and the system is queried to return all the speeders for a given location and date range. No implementation required.

implement hashmap Unix filesystem

multithreading Finding all the occurrences of a given string in another one?

implement three stacks using array

Design an event ticket system? Reinvent Ticketmaster.

Given two parameters, the first parameter being a string of words with no spaces, the second being a dictionary with all thinkable words, return the first string with spaces put in between the words.

Most efficient algorithm for sorting infinitely long array

Implement the floodfill (aka paint bucket) function of the Windows Paint program.

You are given an array that contains numbers increasing up to the maximum then decreasing. ( [1,2,3,2] , [2,3,6,7,2,1], etc) Find the largest number. Whats the time complexity of your answer?

how to compare two huge file in two different locations

Determine whether the binary representation of a number if a palindrome or not, code it on a white board.

LRU Cache Design a traffic signal control system Trap rain water problem . Diameter of a tree. Q. Stack boarding passes into source and destination. Q. Design system to do a db switch.
how would you keep online cache in synch with the database

Design the software backend for a system that checks if vehicles are speeding on roads. Constraints: 1 camera per direction of road.

Bizarre - I was asked technical questions, mental puzzles, man hole questions. all kinds of crazy stuff, from looking for string within a string, computational complexity of managing a b-tree, Monty hall problem, yada yada

(A1) Design a single machine, single user system for hotel table reservations. Constraints: assume 16 tables with capacity 4, 16 tables with capacity 8. Can book for just 1 hr. Max 2 months in advance. Which classes, which data-stuctures? (A2) What happens when a party of 16 requests for a table. You can join tables which are next to each other. Implement this.


(B1) Design a deck of cards. (B2) Now assume 10 million users…

DP Problems

  1. 0-1 Knapsack problem
  2. coin change
  3. partition equal sum subset
  4. Target sum
  5. Longest Increasing Subsequence
  6. Longest common Subsequence
  7. Longest Palindrome Substring/Subsequence
  8. Longest common Substring
  9. Combination sum 4/Stair case problem
  10. Decode ways
  11. Delete Operation for Two Strings
  12. Wiggle Subsequence

GitHub – sainadhreddy92

sainadhreddy92