Buddha

Buddha
Seek

Thursday, February 24, 2011

Interview Questions - 3

Google Interview Questions.

Interview Type: Telephonic
Interview Duration: 30 mins

1. What is the default signal generated by kill command ?

2. What is a sticky bit ?

3. Given a path, which system call returns the information about the inode ?

4. Given 10000 16 bit integers, and unlimited memory, what is the quickest way to count the total number of bits set in the array.

5. Given four operations
a. Read from CPU reg
b. Disk Seek
c. Context switch
d. Read from main memory

Rank them in order of speed.

6. Average case and worst case running time for quick sort.

7. What is the opposite of malloc in C.

8. Value of "a"[3 >> 1]

Wednesday, February 23, 2011

Interview Questions - 2

Some more questions:

Type: Data Structures
Company Type: Web, Software, e-Commerce

1. Given is a linked list, in which the Node data is the address of another node (e.g. Data of node 3 is storing address of node 5, data of node 5 is storing address of node 2, etc). How can you copy this linked list ?

Catch is when you copy memory changes, hence the data should change accordingly.

2. Given a Directed Graph, design an algorithm which can detect if there is a loop or not.

3. Given a Binary tree, where each node stores a certain value, find the average at the node.

4. Given an unsorted array, a number 'k', find how many pairs in the array sum up to the value 'k' in the most efficient way. Time complexity should be O(n).

5. Given 2 sorted arrays, and 1 array big enough to accomodate the other array [enough empty space], write a program to get the final array in O(m+n).

Tuesday, February 22, 2011

Interview Questions - 1

Interview Month: February
Interview Position: Software Engineer
Interview Duration: About 30 minutes
Interview Company Type: Networking

1. Whats the library used for threading in C on Unix based systems ?

2. What is the pthread library call used to create a new thread and the parameters to the call?

3. How do you think the pthread_lock() is implemented ?

4. Will this work for multi processor/core systems also ? {This question asked in many interviews}
Dont know a proper answer to this question yet. Any links would be helpful.

5. What is malloc? System call or Library Call? Why?

6. At what times does malloc invoke a system call? Does it always invoke?
Answer is something regarding maintaining buckets. Check out malloc implementation details

7. What is a hash-map data structure? How does it store data?

8. Advantages and disadvantages of using a hashmap. Give examples of systems where you would not use 1.

Friday, February 18, 2011

And I am back....

The desire to key my thoughts couldn't keep me away from here.

Hey everyone, look I am back.