F5 Networks Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Keeps printing in a loop:

from a.h:<linenumber>,
from b.h:<linenumber>,
from a.h:<linenumber>,
from b.h:<linenumber>,
from b.h:<linenumber>,
a.h:<linenumber>: error: previous definition of 'class A'
....
.from a.h:<linenumber>,
from b.h:<linenumber>,
..goes on for sometime n stops

- blue_skin November 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

multiple defination will only occur if we dont have #ifdef at the start of the header file.
If we use #ifdef at the start of a header file, then I guess there will not be any problem.

- Anonymous November 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Thanks for posting these.

I'm surprised at their interview questions. No problem solving, all trivia.

- Anonymous November 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The macro would be #ifndef (not #ifdef). Use #ifndef then #define #endif.
This would prevent multiple inclusions of your header file.

- Anonymous December 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Good question. The programmer will end up with circular dependency. For example, if a.h contains structure A and a function void funA(A, B) and b.h contains structure B and a function void funB(A, B).

When these files are included in a source file, the compiler throws error, "one of the structure definition is not available". It is because none of the order "a.h followed by b.h" or "b.h followed by a.h" can provide the complete declaration of structures.

This can be solved by forward declaration of structures, passing references (pointers), strictly following top-down declaration across the common project files, etc...

- Venki May 04, 2011 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More