Thursday, December 27, 2012

Compilation steps of a C program

There are four steps

1. Preprocessing
2. Compilation
3. Assembling
4. Linker

image

STEPS INPUT OUTPUT GCC
Pre Processing source file

preprocessed output (removing all # defines & replacing macros)

gcc -E a.c
output will be printed in console where we can see all the Macro are replaced.

Compilation

Preprocessed output file

Assembly language code

gcc -S a.c
output will be in a.s file

Assembling

Assembly code

Machine code

gcc -c a.c
output will be in a.o

Linker

Machine code

executable file

gcc a.c
output will be a.out file

Monday, December 24, 2012

Cisco Interview Questions

Had 5 rounds of interview

1. Telephonic technical Round
    * steps of compilation
    * storage classes & memory allocation
    * pass by value & pass by reference
    * questions on pointers
    * stack & heap in C
    * Reverse a linked list
    * Middle element of a linked list
    * difference between insertion & quick sort
    * time complexities of all sorting algorithms
    * difference between TCP & UDP

2. Technical round-1 (F2F)
    * TCP/IP layer
    * how ping works
    * IP header
    * questions about data link layer

3. Technical round-2 (F2F)
    * Find a duplicate in an array of 1 to n elements
    * swap without comparison
    * deletion of a linked list
    * find a loop in a linked list
    * set a bit in a integer
    * stack & heap - malloc & calloc
    * some questions in pointers

4. Technical round-3 (F2F)
    * find the sum of array using recursion
    * pattern matching
    * find the intersection of two linked list and questions on projects done.

5. Manager round (F2F)
    * how trace route works
    * how route works
    * ipconfig works
    * some HR questions like , how you manage pressure, strength etc.,