Company: HCL Technologies

Test Date : 8 September 2005
Paper Type : Technical – C & C++

Texas Instruments Date : 8/9/2005

given an expression tree and asked us to write the in fix of that expression
four choices : 2

global variables in different files are
a:at compiletime
b) loading time
c) linking time
d)execution time

size of(int)
a) always 2 bytes
b) depends on compiler that is being used
c) always 32 bits
d) can’t tell

which one will over flow given two programs
2 prog 1: prog2:
main() main()
{ {
int fact; int fact=0
long int x; for(i=1;i<=n;i++) fact=factoral(x); fact=fact*i; } } int factorial(long int x) { if(x>1) return(x*factorial(x-1);
a) program 1;
b) program 2;
c) both 1 &2
d) none

variables of fuction call are allocated in
a) registers and stack
b) registers and heap
c) stack and heap

avg and worst case time of sorted binary tree

data structure used for proority queue
a) linked list b) double linkedd list c)array d) tree

char str[5]=”hello”;
if(str==NULL) printf(“string null”);
else printf(“string not null”);
what is out put of the program?
a) string is null b) string is not null c) error in program d) it executes but print nothing

There are 0ne 5 pipe line and another 12 pipe line sates are there and flushed time taken to execute five instructions a) 10,17
b) 9,16

for hashing which is best on terms of buckets
a)100 b)50 c)21 d)32 ans 32

void f(int value){
for (i=0;i<16;i++){ if(value &0x8000>>1) printf(“1”)
else printf(“0”);
what is printed?
a) bineray value of argument b)bcd value c) hex value d) octal value

void f(int *p){
static val=100;
int a=10;
printf(“%d “,a);
printf(“%d “,a);
what will be out put?

struck a{
int x;
float y;
char c[10];
union b{
int x;
float y;
char c[10];
which is true?
a) size of(a)!=sizeof(b);

# define f(a,b) a+b
#defiune g(c,d) c*d
find valueof f(4,g(5,6))
a)26 b)51 c) d)

find avg access time of cache
a)tc*h+(1-h)*tm b)tcH+tmH
c) d) tc is time to access cache tm is time to access when miss occure

char a[10]=”hello”;
out put of the program?
a) string is null b) string is not null c) program error d)

simplyfy k map
1 x x 0
1 x 0 1

int f(int a)
//some stuff
what are x & y types
a) x is int y is pointer to afunction which takes integer value

char a[5][15];
int b[5][15];
address of a 0x1000 and b is 0x2000 find address of a[3][4] and b[3][4]
assume char is 8 bits and int is 32 bits
a) b) c) d)
there are 20 questions all in techinical paper and 36 questions in appititude test in appititude thay have given all diagrams and asked to find what comes next thay are quite easy and i hope if u practice r.s aggraval u can do it easily for tecnical thay have given 1 hr for 20 questions and for not technical thay have given only 40 min and 36 questions
this is the paper i have right now for TI aptitude test consist of all pictorial questions. ie in each question he will give 8 diagrams and ask to find th 9’th diagram in that sequence.You go through RS Agarwal. These aptitude questins are
very easy. Just pratice them. In RS Agarwal gothrough SERIES chapter. It is suffient. There are 35 aptitude
questions. First 25 are very easy. Do these questions in just 15 or 20 minutes. Because last questions are
very touch.

3 flipflops are connected so that after 0 to 5 count occured next number is zero. So what is the counter?
Ans: mod 6 counter

simplication of some boolean expression which is simple. Boolean Expression is A+A’B.

Given inorder sequence and preorder sequence and asked to find out postorder sequence.

Some question on value of a static variable.

Given an interger in binary form,find the number of ones in that number without counting each bit.(This questin is not multiple choice question. This question carries more marks. So please take care for this question.)

1-way set associative memory is called—–
a)direct b)something c)1-way set associative 4)something
Ans: c

Fastest IPC mechanism is
a)shared memory b)pipes c)named pipes d)semaphores

Some page references are given. You are asked to implement it with Least Frequently Used algorithm.

Some diagram is given. Iam describinmg the diagram. A 2*1 MUX is given. The inputs are A,B. Output is C. C and A are tied together. What is the diagram.?

This paper is for Electrical & Electronics students. There is separate test for computer Science Students. There are 20 questions.
1)Some circuit is given. Iam describing the circuit.A resistor R & a capacitor C are connected in parallel.
To this circuit another circuit which is having a capacitorof capacity 2C & an impedence Z, is connected in series.
You are asked to find out the value of Z? Note that 2C & Zare connected in series.
Some circuit which consist of only resistors R is given. This is a repetative circuit. U have to find the effctive
resistance of the entire circuit.

Two wave forms are given. You are asked to write the cirsuit to get B(second wave form) from A(first wave form).

#define SUM(a,b) a+b

number(int i)
static int i=0;
Ans: I don’t know.

Some circuit is given. I can’t describe the circuit. There are
3 resistors,3 capacitors & one inverter.. The question is
What is the value of the frequency such that the circuit oscillates.
Ans:I don’t know the answer.

7)Question on flipflop. So gothrough all flipflops.

8)There are 5 questions on Nmos & Pmos circuits.

This Paper is for Computer Science Students. THis paper is very easy. You can definitely do it in one hour.
The fastest memory is
(i) DRAM, (ii) ROM, (iii) SRAM, (iv) Main memory
Ans : SRAM

Programing exceptions are
(i) Asynchronous, (ii) Synchronous, (iii) None
Ans : Asynchronous

DSP which architecture is used
(i) MIMD, (ii) SIMD, (iii) Nueman, (iv) Harvard Architecture
Ans : Harvard Architecture

C prog. for searching for an element in linked list

unsigned char i;
int sum;
for(i=0; i<300; i++) sum+ = i; printf("nSum = %dn", sum); } Ans : infinite loop void fn(int *p) { static int val = 100; p = &val; } main() { int i=10; printf("i=%dn", i); fn(&i); printf("i=%dn", i); } Ans : i=10 i=10 int a[10[15]; char b[10[15]; (a) location g a[3][4], if base location g a[0][0] is ox1000 (b) location g b[3][4], if base location g b[0][0] is ox2000 int taken 32 bits and char taken 8 bits. Ans : (a) ox10C4 (b) ox2031 Implement OR gate function with 2*1 MUX Ans : A ___________ --------|2*1 MUX | B | |--------o/p --------| | | ----------- |_______|C B=C Implement 4*1 MUX with 2*1 MUXES Swapping without using a temporary variables. (2 methods) (i) x = x+y; y = x-y; x = x-y; (ii) x = x^y; y = x^y; x = x^y; Count no of 1's in a word without using bit by bit. (This question carries more marks. It is not a multiple choice question. Code 1 : for(i=0; i<1000; i++) for(j=0; j<100; j++) x = y; Code 2 : for(i=0; i<100; i++) for(j=0; j<1000; j++) x = y; Which code will execute faster (i) Code 1 and Code 2 are of same speed, (ii) Code 1, (iii) Code 2, (iv) None. Ans : Code 2 main() { int a[10] = {1, 2, 3, ...., 10}, i, x=10, temp; for(i=0; itemp = a[i]; a[i] = a[x-i-1]; a[x-i-1] = temp; } (i) All contents of array a are reversed (ii) Only some portions are altered (iii) Remains same (iv) None Ans : (iii) An array is stored in row major order. The memory capacity is 30 MB. And in unix system demand paging is used. Which one will give more page faults? #define V_L_I 10000 int i, j, array[V_L_I][V_L_I]; Code 1 : array[i][j] = 1; Code 1 : for(j=0; jfor(i=0; iarray[i][j] = 1; Ans : Code 2 In C which parameter passing technique is used? (i) call by value, (ii) call by reference, (iii) both Ans : call by value A circuit is given with 2 exclusive OR gates whose boolean expression will be y = '(AB) + AB (' indicates bar) (17) main() { int i = 1; fork(); fork(); printf("ni = %dn", i+1); } Ans : 4 printfs will occur and i = 2 Compute the complexity of Binary search. Ans : O(lg n) ( Answer in detail. This is not a multiple choice question. It carries more marks.) Write expression for the tree graph : Ans : ((a-b) + c*d)/x # define MAX(a, b) a>b ? a:b
int m, n;
m = 3 + MAX(2, 3);
n = 2 * MAX(3, 2);
printf(“m = %d, n = %dn”, m, n)
Ans : m=2, n=3