X

# Algorithm  Questions

View By:

Q31 Write C code to implement the strstr function.

Write C code to implement the strstr (Search for a substring) function. Do not use any system library such as strlen.

Q32 Find the missing number from a set of 4 billion numbers

You have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing, i.e there are only 3,999,999,999 numbers, You need to find the missing number.

Q33 Given a file with a lot of words (10 million) find out the top 10% most frequently occurring words

Given a file with a lot of words (10 million) find out the top 10% most frequently occurring words.

Q34 If u could find the (n/4)th element of an array in O(n) time, then what is the worst time complexity of quick sort algo if this algorithm is used to decide the pivot element

If u could find the (n/4)th element of an array in O(n) time, then what is the worst time complexity of quick sort algo if this algorithm is used to decide the pivot element.

Q35 What is Derating factor

Explain derating factor.

Q36 Design a microprocessor

Your group designs a microprocessor for use in cell phones and palmtop computers. You currently fabricate your chips on a 0.25micron process. A new fabrication facility with a 0.13micron process has asked you if you would like to switch to their facility. What do you believe will be the three most important tradeoffs between remaining with the 0.25 micron fabrication process and switching to the 0.13 micron process?

Q37 How to choose between optimization and work completion

The average performance of products in your market segment triples every 36 months. Your design engineers have proposed an optimization that will increase performance by 12%. The optimization will postpone the completion date of the project by 2 months. Should the engineers implement the optimization and postpone the completion date, or should they stick to the original schedule?

Q38 How to find the first 0 in an array containing unknown number of 1s int the beginning.

Given an input array of size unknown with all 1's in the beginning and 0's in the end. Find the index in the array from where 0's start, consider there are millions of 1's and 0's in the array .i.e array is very big e.g array contents 1111111.......1100000.........0000000

Q39 How will you print a spiral path in a 2D matrix

Given a matrix (2D array) of m x n elements (m rows, n columns), write a function that prints the elements in the array in a spiral manner.

Q40 How will you print a string in reverse order, using only putchar and nothing else.

Given only putchar (no sprintf, itoa, etc.), print a string in reverse order.