Topic — Add New » Posts Last Poster Freshness
FB interview question 4 akshayjohri 1 week

Given a function bool Zoo(int x) and its called for y times , how you will generate the true with probability x/y times .
lest say if x = 65 & y=100, how will you generate true with probability 65/100. You can represent true by 1 and fal...

Write a code that will check whether the memory allotted to the program at the i 4 Venki 1 week

Write a code that will check whether the memory allotted to the program at the initial and the memory returned to the system is same or not.

First repeating element in array 9 gogtesuyash 1 week

Find the first repeating element in an array of size n in O(n).
Elements are in range.
e.g 3,2,1,2,2,3
The first repeating element is 3.

code to convert decimal ip address to binary in C++ 2 rukawa 1 week

How shall we convert it optimally

Convert a BST 3 Guddu Sharma 2 weeks

Given a BST, convert it such that:
node->data = node->data + sum of all nodes which are greater than this node... do this for all nodes
5
/ \
2 13

13 remians 13,
5 becomes 18,
2 bec...

Best Hashing technique for string 2 jakati 2 weeks

What is the best hashing technique for strings?
Which hashing function should be used to minimize collision and how the collision will be resolved?

Directi Interview Question 2 rukawa 2 weeks

You are given a string of ‘n’ characters where n is even. The string only consist of 6 type of characters: (){}[]. The task is to form a well formed expression. A well formed expression consist of proper nesting of braces and their is no prior...

Novell Interview Question 1 Dheeraj 2 weeks

Construct an infinite family of strings over a fixed alphabet, where the total length of the edge-labels on their suffix tree grows faster than O(m), where 'm' is the length of the string. [That is, show that linear time suffix tree algorithm woul...

Google Interview Question 6 Venki 1 week

Write a program to show Fibonacci representation of a given number.

Ex- 15 can be represented as 100010 (1*13+0*8+0*5+0*3+1*2+0*1)

MST question 3 Guddu Sharma 2 weeks

Which Minimum Spanning Tree algorithm should be preferred for a given graph - Kruskal or Prim ?

Google interview question 2 Guddu Sharma 2 weeks

Print all the common ancestor of given two nodes in binary tree.

Here is my code, let me know if you find any bug

#include<stdio.h>
#include<stdlib.h>

struct node {
int data;
struct node *...

combine elements of an array, so as to minimize weights. 6 rohanag 1 week

This was a question asked in interview street at a code sprint.

Jonny'y father has purchased him a new toy. The beauty of the toy is that it comes in N components and Jonny can join them in ways he like to make powerful superheroes.

...

Google interview question 4 rukawa 1 week

Find Kth smallest element from a given 2D Matrix of size N*N

The complexity should be better than O(N^2)

Find triplets zero sum 3 Venki 2 weeks

given an array of +ve and -ve numbers, find all triplets in array with sum 0.

Consider {-1 0 1 2 -1 -4},
Triplets are
(-1, 0, 1)
(-1, 2, -1)

Longest Increasing Subsequence O(nlogn) 2 Venki 4 days

Can someone please explain O(nlogn) algo for LIS or give some good link other than the one at wiki and algorithmist??
Thanks!!

programming puzzle 3 ftaran 3 weeks

The goal is to construct the shortest possible sequence of integers ending with A, using the following rules:
the first element of the sequence is 1,
each of the successive elements is the sum of any two preceding elements (adding a si...

counting question 4 Guddu Sharma 3 weeks

How many binary NxN matrixes are possible that are symmetric in nature