Bloomberg LP Interview Question for Software Engineer / Developers






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

No. The template is compiled only if it is instantiated so the error is not caught until we try to create an object with the template.

- souaaz May 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

very true....

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

Yes. This will cause compilation error. The compiler generates code for a template class or function when the class or function is instantiated.

- kumuda April 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yes .... Both for template as well as normal classes if there is a syntax error is the source code of the class, the code will not compile

- abhimanipal May 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think template compilation happens in two phases. Phase 1 is just syntax check and phase 2 is actual instantiation. Phase 1 will catch any syntax errors

- pk May 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The answer is maybe, depend on your compiler. There is effectively two phases in template compilation. A syntax check and the instantiation itself. The compiler will not try to instantiate the template if it not used. So if there is nothing in main, the template is not used, so no error for the instantiation process. There might be errors for the syntax check, but the compiler may not check since the template is not used. The standard does not force the compiler to check syntax when the template is not used.

- eric pruneau May 22, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

souaaz is right. However a lot depends on the compiler.

- Anonymous June 02, 2010 | 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