Written test paper at Cisco interview Question paper

Written test paper at Cisco interview Question paper
1. The starting location of an array is 1000. If the array[1..5/...4] is stored in row major order, what is the location of element [4,3]. Each word occupies 4 bytes.
Ans: 1056 (Check it out for yourself!)
2. In a tertiary tree, which has three childs for every node, if the number of internal nodes are N, then the total number of leaf nodes are?
Ans: (2N+1)
3. Explain the term "locality of reference" ?
Ans: In computer science, locality of reference, also called the principle of locality, is the term applied to situations where the same value or related storage locations are frequently accessed. There are three basic types of locality of reference: temporal, spatial and sequential:
Temporal locality -
Here a resource that is referenced at one point in time is referenced again soon afterwards.
Spatial locality -
Here the likelihood of referencing a storage location is greater if a storage location near it has been recently referenced.
Sequential locality -
Here storage is accessed sequentially, in descending or ascending order.
4. What is the language used for Artificial Intelligence
Ans: lisp
5. What is the character set used in JAVA 2.0 ?
Ans: Unicode
6. char a =0xAA ;
int b ;
b = (int) a ;
b = b >> 4 ;
What is the output of the above
program segment ?

Ans: fffffffa
7. struct s1 { struct { struct { int x; } s2 } s3 }y;
How does one access x in the above given structure definition ?

Ans: Compilation failes as ";" is missing immediately after declaration of the strcuture variables s2 and s3.
Otherwise, we can access x like this: y.s3.s2.x
8. Why there is no recursion in Fortran ?
Ans. There is no dynamic allocation.
9. What is the worst case complexity of Quick sort?
Ans. O(n2)
10. What will be sequence of operating system activities when an interrupt occurs ?
Ans: Most modern general purpose microprocessors handle the interrupts the same way. When a hardware interrupt occurs the CPU stops executing the instructions that it was executing and jumps to a location in memory which either contains the interrupt handling code or an instruction branching to the interrupt handling code. This code usually operates in a special mode for the CPU, interrupt modeand, normally, no other interrupts can occur in this mode. There are exceptions though; some CPUs rank the interrupts in priority and higher level interrupts may happen. This means the first level interrupt handling code must be very carefully written and it often has its own stack which it uses to store the CPU's execution state (all of the CPU's normal registers and context) before it goes off and fully handles the interrupt. Some CPUs have a special set of registers that only exist in interrupt mode and the interrupt code can use these registers to do most of the context saving it needs to do. When the interrupt has been handled, the CPU's state is restored and the interrupt is dismissed. The CPU will then continue to doing whatever it was doing before being interrupted. It is important that the interrupt processing code is as efficient as possible and that the operating system does not block interrupts too long.
11. In a sequential search, what is the average number of comparisons it takes to search through n elements ?
Ans: (n+1)/2.
12. What is the size of the array declared as double * X[5] ?
Ans. 5 * sizeof ( double * )
13. A binary search tree with node information as 1,2,3,4,5,6,7,8 is given. Write the result obtained on preorder traversal of the binary search tree ?
Ans : (Not sure!)
14. If size of the physical memory is 232-1, then what is the size of the virtual memory ?

S -> A0B
A-> BB0
B-> AA1
How many strings of length 5 are possible with the above productions?

16. (3*4096+15*256+3*16+3). How many 1's are there in the binary representation of the result?
Ans. 10 ( 16179 = 11111100110011)
17. In memory mapped I/O how is I/O is accessed ?
Ans: uses the same address bus to address both memory and I/O devices, and the CPU instructions used to access the memory are also used for accessing devices.
18. What is the use of ALE in 8085 ?
Ans: To latch the lower byte of the address.
19. If the logical memory of 8 X 1024 is mapped into 32 frames, then the number of bits for the logical address are____ ?
Ans. 13
20. Context free grammar is useful for which purpose ?
21. In ternary number representation, numbers are represented as 0,1,-1.(Here -1 is represented as 1 bar.) How is 352/9 represented in ternary number representation?

22. There are processes which take 4,1,8,1 machine cycles respectively. If these are executed in round robin fashion with a time quantum of 1, what is the time it take for process 4 to complete ?
Ans. 9
23. The minimum frequency of operation is specified for every processor because......
a)for interfacing slow peripherals
b)dynamic memory refreshing.
c)to make compatible with other processor.
24. For linked list implementation , which search is not applicable ?
Ans: Binary search.
25. Each character is represented by 7 bits, 1 bit is used to represent error bit and another bit for parity. If total number of bits transmitted is 1200 bits, then what is the number of symbols that can be transmitted ?
Ans: 133
26. Explain set associativity of cache ?
27. Write the postfix form of the following expression . A+[[(B+C)+(D+E)*F]/G]
28. What is the function of the linker?
29. void f(int y)
struct s *ptr;
ptr = malloc (sizeof (struct)+99*sizeof(int));
struct s{
int i;
float p;
when free (ptr) is executed, then what will happen?
30. To concatenate two linked lists strings, the order is O(1) is obtained for what kind of list?
31. main()

{ fork();
How many times it will print hello?
32. char A[5,6] How many bytes it requires?
33. Bridges are used in which layer?
34 .Bigendian means
a)lower byte stored in lower address
b)lower byte stored in higher address
one of these is correct.u can verify in Any micro processor book.
35 main()
{ j=0
what is the value of i & j at the end of the loop

ans: 10,46

No comments: