Taro Logo

Software Engineer Interview Experience - San Jose, California

May 1, 2010
Positive ExperienceGot Offer

Process

  1. Define Storage Classes and explain their application domain.
  • register: Tells the compiler to use a CPU register for fast access to that variable.
  • auto: A variable created and initialized when defined. It is not visible outside of its block.
  • static: Defined inside a function, it retains its value between calls. It is always initialized with 0. Defined as global within a file, it is visible only to functions in that file.
  • extern: Indicates the definition of the variable is in another file.
  1. Define the Storage Qualifiers
  • const: Defines a variable whose value cannot change during program execution.
  • volatile: Defines a variable that can be changed indirectly. An example is a counter register updated by hardware.
  • mutable: A member of a structure or object can be changed even if the structure, for example, is declared const. Ex: struct complex {mutable int x; int y;}; const complex Mycomplex = {1, 2}; Mycomplex.x = 3; /* correct */
  1. Give an example for a variable that is both "const" and "volatile". Is it possible?

Yes, a status register for a microcontroller is an example.

  1. Detect if a linked list is circular.

Use two pointers. One increments by one element at a time, and the other increments by two. If the list is circular, the pointer incrementing by two will eventually overlap with the first pointer.

  1. Do you have any remarks?

Consider the following macro definition:

#define res(a) a*a

Using it in this form may lead to unexpected results. For example, if 'a' is replaced with (2+3), the result will be 2+3*2+3 = 11, not (2+3)*(2+3) = 25.

Always use parentheses for safety: #define res(a) (a)*(a).

  1. Define a "dangling" pointer.

A dangling pointer is obtained by using the address of an object that has already been freed.

  1. Is there any difference between const int* ptr and int *const ptr?

Yes, there is a major difference. The first defines a pointer to constant data, and the second defines a constant pointer.

  1. What is the declaration and definition of a variable?

A definition provides the implementation for a variable or function. A declaration makes a variable or function known to the compiler without providing its implementation.

  1. Give a solution for a stack overflow situation.

Consider the following recursive function:

c func_call() { func_call(); }

Every time the function is called, the return address is stored on the stack. This infinite recursion will eventually cause a stack overflow. A solution involves ensuring that all recursive functions have a proper base case to terminate the recursion.

  1. Give 4 examples of an infinite loop.
  • while (1) {} * for (;;) {} * do {} while (1); * c label: goto label;

Questions

What is the difference between the DES and RSA algorithms?

Was this helpful?

Interview Statistics

The following metrics were computed from 125 interview experiences for the Cisco Software Engineer role in San Jose, California.

Success Rate

54%
Pass Rate

Cisco's interview process for their Software Engineer roles in San Jose, California is on the easier side as most engineers get an offer after going through it.

Experience Rating

Positive65%
Neutral23%
Negative12%

Candidates reported having very good feelings for Cisco's Software Engineer interview process in San Jose, California.

Cisco Work Experiences