## Recent Interview Questions

More Questions »- 0of 0 votes
find first not-repeating character by iterating through the length of the string only once.

- 1of 1 vote
You are given a scrambled input sentence. Each word is scrambled independently, and the results are concatenated. So:

'hello to the world'

might become:

'elhloothtedrowl'

You have a dictionary with all words in it. Unscramble the sentence.

- 0of 0 votes
The original question can be found from here :

franklinchen.com/blog/2011/12/08/revisiting-knuth-and-mcilroys-word-count-programs/

Read a file of text, determine the *n* most frequently used words, and print out a sorted list of those words along with their frequencies.

In the same spirit of the history:

1. Do it using pure shell scripting

2. Do it in the favourite language of your choice

Try to minimise code and complexity.

- 1of 1 vote
We define an undirected graph g,such that: The total number of nodes in the graph is g_nodes. The nodes are numbered sequentially as 1,2,3….g_nodes. The total number og edges in the graph is g_edges. Each edge connect two distinct nodes(i.e no edge connect a node to itself). The weight of the edge connecting nodes g_to[i] and g_from[i] is g_weight[i]. We define the weight of the path from some start node to some end node to the sum of all edges traversed on the path. Input formate: The first line contain two space-seperated integer describing the respective value of g_node and g_edge. Each line I of the g_edge subsequent lines contain three space –seperated integer describing the respective value of g_to[i],g_from[i] and g_weight[i]. The next line contain an integer denoting start The next line contain an integer denoting end. The next line contain an integer denoting w_extra. input 1:

4 4

1 2 2

2 3 1

2 4 2

3 4 3

1

4

5

Output:4

input2:

5 5

1 2 2

1 4 4

2 3 1

3 4 3

4 5 1

1

4

2

output:3

Int mincost(int g_nodes,int g_edged,int* g_from,int* g_to,int* weight,int start,int end,int w_extra)

{

}

- 0of 0 votes
1. If I say quick sort takes O(e^n ) on the average, would I be wrong?

2. Do you think O( f ) is a good idea for real engineering?

3.Given a choice, what other 'order of' measure would you propose to use ?

4. Do you see a real problem with the modified *order of* ?

5. If you were to sort 10 elements, what sorting method would you have used?

6. If you were to sort 1 trillion unicode characters, what sorting method you would have used?