(Paper) National Instruments Placement Paper: 03-Sep-2011

National Instruments

Placement Paper:

1. sqrt(b^2 - 4ac), if a =[0, 0.5] and b=[4, infinity), Whats the range of c?

2. Write a recursive function to get the product of all the digits of a number.(eg: for 123: output 1*2*3; for 56: output 5*6=30)

3. Find the 100th number of the series 2, 4, 8, 14, 22, 32....

4. Find the 20,000th element of the series 1, 2,2, 3,3,3, 4,4,4,4, ....

5. Write a single statement to check whether a given number is a power of 2.

6. T(n) = 2*T(n-1)+2^(n-1); T(1) = 1. Find T(7).

7. int index, i=0, k=0, j=0;
for(index=0; index <= some_number; index++){
i = i+1;
if( (i/5) == 1 ){
i=0;
k = k+1;
if( (k/5) == 1){
k=0;
j = j+1;
}}}
What's the value of i, k, j interms of 'some_number' after the the execution of for loop?

8. A bag contains 3 coins out of which * 1 coin is painted RED both the sides * 1 coin is painted BLUE both the sides* 1 coin is painted RED with one side and BLUE with another. Two coins are selected from the bag and tossed. Find the probability of  getting both as RED.

9. What's the effect of(or write a common code) the following code on an array of 8 elements? 
for(i=0; i<4; i++)
a[i] += a[i+4];
for(i=0; i<4; i++)
a[i] += a[i+2];
for(i=0; i<4; i++)
a[i] += a[i+1];

Company Name: National Instruments
No of Rounds:
Screening Test
Exam/Interview Date: 03-Sep-2011