Delete an element from a doubly linked list.
Category: Uncategorized
Detect a palindrome
Devise an algorithm for detecting when a string is a palindrome. Ex: A man, a plan, a canal, Panama”.
(Another from: http://www1.cs.columbia.edu/~kns10/interview/)
Example palindromes I got from a quick web search.
Write an algorithm to detect a loop in a link list
Print out a binary tree
Write a function and the node data structure to visit all of the nodes in a binary tree
(Got it from: http://www1.cs.columbia.edu/~kns10/interview/)
Detect overflow in addition
Whats the simples way to check if the sum of two unsigned integers has resulted in an overflow.
(Another from http://www1.cs.columbia.edu/~kns10/interview/)
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
(Another problem from http://www1.cs.columbia.edu/~kns10/interview/)
Write a simple lexical analyzer
Write a small lexical analyzer – interviewer gave tokens. expressions like “a*b” etc.
( Another from: http://www1.cs.columbia.edu/~kns10/interview/ )
Spiral print a 2D array
Write a routine that prints out a 2-D array in spiral order! (another one from http://www1.cs.columbia.edu/~kns10/interview/)
Implement uniqe for a sorted array
Write code to extract unique elements from a sorted array. e.g. (1,1,3,3,3,5,5,5,8,8,8,8) -> (1,3,5,9)
Slow ball question but good for practice. (I got it from http://www1.cs.columbia.edu/~kns10/interview/)
Count the bits in a 32 bit integer
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution). (Got this question from http://www1.cs.columbia.edu/~kns10/interview/ )