Anda di halaman 1dari 2

http://www.geeksforgeeks.

org/tag/microsoft/
http://www.geeksforgeeks.org/microsoft-interview-experience-set-107-on-campus-fo
r-internship/
http://www.geeksforgeeks.org/microsoft-interview-experience-set-104-on-campus-fo
r-idc/
http://www.geeksforgeeks.org/implement-lru-cache/

1. implement LRU -
2. find kth smallest
3. find square root of number without using sqrt function
4. implement hashmap n write a good hash function for string
5. write a function which takes array A,B and output (A-B)U(B-A)
6. given a directed graph construct another graph from given such that if path e
xists
from vertices A to vertices B and from B to C, then path from A to C and C to A
should also exist.
7. longest palindromic substring from given string of characters
===online test questions from cocube.com===
1:An array of integers is given which represents the heights of n buildings.Sun
start falling from the left side. If there is a building of certain Height, all
the buildings right of it having lesser heights cannot see the sun. Find the no.
of buildings which can see the sun.
2: Rearrange a given array in-place such that all the negative numbers occurs be
fore positive numbers.(Maintain the order of all -ve and +ve numbers as given in
the original array)
3: Find the sum of leaf nodes at minimum depth of a tree. Return -1 if root is N
ULL.
=====another one=====
Q2. Given a string S and two indexes i & j, modify the string in a pattern such
that:
characters from [0 to i] index are now at back of the string.
characters from [j till end of string] are in front of string.
e.g. S = abcdef and i=1, j=3.
Output should be: defcab
Constraint: Constant Space.
Q3. https://leetcode.com/problems/simplify-path/
Q.1 A 5*5 matrix of spiral order is
spiral
Now for an N*N spiral matrix filled similar to one given above, find element pre
sent at [R,C] position where R=row s number, C=column s number.
Constraint: You can t create matrix itself. Print number without creating matrix e
xplicitly.

=============another==========
i) Given the numbers n and k, change the k th bit of the number n to 0 if it is 1 , e
lse return the number n itself
Example:
For n=13 (1101) & k=2, return 13
For n=13 (1101) & k=3, return 9 (1001)
ii) Return the sum of two binary numbers represented as strings
Example:
For n1=111 & n2=10011, return 11010
http://www.geeksforgeeks.org/add-two-bit-strings/
iii) Return the sum of all the leaf nodes at minimum level in a binary tree. If
there exists no tree, then return -1
Example:
For the above binary tree, return 100 (40+60)
=================another another===========
1. Given an array of n numbers, replace each element with it s farthest coprime in
the range [2, 250]. Example, the farthest coprime for 2 is 249 and for 243 is 2
.
2. Given a number n, return the factorial of the number as a string. (The number
was passed as an integer parameter and the string had to be returned.)
3. Given two trees, tree A and tree B, return the size of the subtree if B is a
subtree of A. Otherwise, return zero.
http://www.geeksforgeeks.org/check-if-a-binary-tree-is-subtree-of-another-binary
-tree/
=============another another another=========
1. Given a Linked List of integers, write a function to modify the linked list i
n-place such that all odd numbers appear before all the even numbers in the modi
fied linked list. The relative order of even and odd numbers should remain the s
ame. http://www.geeksforgeeks.org/segregate-even-and-odd-elements-in-a-linked-li
st/
2. Given a floating point number, calculate its square root without using in-bui
lt sqrt() function.
3. Given a pattern string and a test string, implement RegEx substring matching.
If the pattern is preceded by a ^, it will match with the starting position. Si
milarly, if it is preceded by a $, it will match the ending position. If no such
markers are present, it will check whether pattern is a substring of test.
Ex : ^coal
coaltar
Result : True
tar$
coaltar
Result : True
abcd
efgh
Result : False
(Optional)
1. Print boundary traversal of Binary tree in clockwise direction.(Note: check f
or leaf nodes in left and right traversal for a given tree). http://www.geeksfor
geeks.org/boundary-traversal-of-binary-tree/
2. Rotate a square image 90 degree clockwise. Optimize as much as u can. Similar
Question: http://www.geeksforgeeks.org/inplace-rotate-square-matrix-by-90-degre
es/

Anda mungkin juga menyukai