Q1
Log parser
user-id page-type-id
User IDs are arbitrary strings that uniquely represent a given user; if a user visits multiple pages, each log entry will have the same user ID. Page type IDs are arbitrary strings that uniquely represent a given kind of page on our site, such as the homepage, a product detail pages, or the shopping cart. Tons of users visit our website, but there are only a few dozen types of pages.
We can use our weblogs to answer questions about user b...
show more
Q2
Given a 2-D MxN matrix having each value as difficulty for the block
struct node { int x; int y; struct node *next; };
struct path { int difficulty; struct node *pathlink; }
Ex matrix - 4X4 matrix
7 9 2 11 13 23 1 3 14 11 20 6 22 44 3 15
Minimum difficulty = 7 (a[0][0])+ 2(a[0][2]) +3(a[3][2])+15(a[3][3]) = 27 Path trace will have = 7->2->3->15
Q3
Find the number of times each character occurs in the string.
eg teddy d= 2 e=1 t=1 y=1
Q4
How to add two integers without using arithmetic operators?
Q5
check sign of two numbers
Given two signed integers, write a function that returns true if the signs of given integers are different, otherwise false. For example, the function should return true -1 and +100, and should return false for -100 and -200. The function should not use any of the arithmetic operators.
Q6
How to save a Binary Search Tree to a disk and then retrieve it?
Q7
Given an array containing 0s and 1s, find the maximum contiguous sub sequence which has equal number of 1s and 0s
Examples
1) 10101010
The longest contiguous sub sequence that satisfies the problem is the input itself
2)1101000
The longest sub sequence that satisfies the problem is 110100
Q8
How to find all elements that appear more than n/2 times in a given list.
Q9
Given a file with a lot of words (10 million) find out the top 10% most frequently occurring words
Q10
Change making problem.