Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

Interview Questions and Answers :: Cisco

Home > Experience Archives > Cisco > Interview Question Set 2
Telephonic Round First Round (F-2-F) Second Round (F-2-F)
    Answer:
    // C program using recursion to reverse a string.

    # include
    void reverseString(char *str)
    {
    if (*str)
    {
    reverseString(str+1);
    printf("%c", *str);
    }
    }

    int main()
    {
    char a[] = "India is a great country";
    reverseString(a);
    return 0;
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    To Set Bit use bitwise OR operator (|)
    number |= 1 << x;

    To clear Bit use bitwise AND operator (&)
    number &= ~(1 <
    To toggle bit use bitwise XOR operator (^)
    number ^= (1 << x)
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    1. Inline follows strict parameter type checking, macros do not.
    2. Macros are always expanded by preprocessor, whereas compiler may or may not replace the inline definitions.
    3. Compiler has no idea about macros, compiler knows about inline functions.
    4. Inline follows strict parameter type checking, macros do not.
    5. Macros are always expanded by preprocessor, whereas compiler may or may not replace the inline definitions.
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    LinkedListNode nthToLast(LinkedListNode head, int n) {
    if (head == null || n < 1) {
    return null;
    }
    LinkedListNode p1 = head;
    LinkedListNode p2 = head;
    for (int j = 0; j < n - 1; ++j) { // skip n-1 steps ahead
    if (p2 == null) {
    return null; // not found since list size < n
    }
    p2 = p2.next;
    }
    while (p2.next != null) {
    p1 = p1.next;
    p2 = p2.next;
    }
    return p1;
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    #define SIZE(type) (size_t)((type *)100 + 1) - (size_t)((type *)100)
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    void IsLitttleOrBigEndian()
    {
    char word = 1;
    if((*(char *)& word) == 1 )
    printf(“\n Machine is little Indian”);
    else
    printf(“\n Machine is big Indian”);
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    #include
    Void main() {
    int **array;
    array = (int **)malloc(nrows * sizeof(int *));
    if(array == NULL)
    {
    fprintf(stderr, "out of memory\n");
    return;
    }
    for(i = 0; i < nrows; i++)
    {
    array[i] = (int *)malloc(ncolumns * sizeof(int));
    if(array[i] == NULL)
    {
    fprintf(stderr, "out of memory\n");
    return;
    }
    }
    for(i = 0; i < nrows; i++)
    free(array[i]);
    free(array);
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

Telephonic Round First Round (F-2-F) Second Round (F-2-F)
    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    Non-Recursive
    ========

    void reverse(struct node ** head)
    {
    struct node* prev = NULL;
    struct node* current = *head;
    struct node* next;
    while (current != NULL)
    {
    next = current->next;
    current->next = prev;
    prev = current;
    current = next;
    }
    *head = prev;
    }
    This trick might help you
    there are three pointer ( prev, current, next)
    next = current*
    current* = prev
    prev = current
    current = next

    if we see from above logic then before = is like top to bottom then bottom to top .
    * marked pointer will have next.

    Recursive
    =======


    struct node * recLinkedList(struct node *head, struct node *prev)
    {
    struct node *tmp = head->next;
    head->next = prev;
    if ( tmp != NULL)
    recLinkedList(tmp, head);

    return head
    }

    int main()
    {
    struct node *head = recLinkedList (head, NULL);
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    void Is32BitsOr46Bits()
    {
    char word = 1;
    if((*(char *)& word) == 1 )
    printf(“\n Machine is 32 bits”);
    else
    printf(“\n Machine is 64 bits”);
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

Telephonic Round First Round (F-2-F) Second Round (F-2-F)