Coding Interview Problems

Post here for backup and looking up.

Data Structures

1. Integer
– find number of 1s
– next largest smaller
– smallest larger number
– determine if is palindrom
– itoa, atoi
– add 2 numbers w/o using + or arithmetic operators
– implement *, -, / using only +
– find max of two numbers w/o comparison
– swap two numbers with +/-
– swap two numbers with ^
– given an integer, find the closest number that is palindrome
– implement putlong() by putchar()
2. Bit array
3. Linked list
– find cycle,
– find position of cycle starts
– reverse LL
– delete a node in middle
– each node contains a value pointer pointing to a node,
duplicate LL.
– remove duplicates from sorted/un-sorted LL.
– find n-th to last node to end
– number is represented by LL, add 2 numbers Read the rest of this entry »

Advertisements