Company: Hewitt Associates

TEXAS Instuments
1.which code executes faster?
code1:- for(i=0;i for(j=0;j large_array[i][j]=0;

code2:- for(j=0;j for(i=0;i large_array[i][j]=0;
ans:code1
2.void fn (int *ptr)
{
static int val=100;
ptr=&val;
}
main()
{
int i=10;
printf(“%d”, i);
fn(&i);
printf(“%d”, i);
}
ans:prints 10,10
3. C supports – call by value only.
4.main()
{
int i=1;
fork();
fork();
printf(“%d”,i+1);
}
ans :- prints 2 four times
12.#define max(a,b) (a>b)?a:b
main()
{
int m,n;
m=3+max(2,3);
n=2*max(3,2);
printf(“%d,%d”,m,n);
}
ans:-m=2,n=3
13.int fn()
{
int x=2;
return x;
}
char * g()
{
char x[4];
strcpy(x,”hello”);
return x;
}
main()
{
char *s;
s=g();
fn();
printf(“%sn”,s);
}
14.representation of -0.375 — 111.101
15.1-way set assosiated memory —– mapped
ans:-direct
16. translation look aside buffers used in______
ans:- cache memory probably
17. DSP
18. faster IPC mechanism
ans:- shared memory
19.some question on gates(figure)
ans:- c or d
20. A+(barA)B= A+B
21. time page
1 1
2 2
3 1
4 3
5 4
6 stop
what are the pages in memory. C memory page table size=21
22. write swap methods with out using temp variables.
23.count no. of 1,s in a word with out counting individaul bits.
24.complexity of binary search tree .