Bloomberg LP Interview Question for Software Engineer / Developers






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

template<class T1;class T2;class T3> is a syntax error
the semicolons should be changed to commas
template<class T1, class T2, class T3>

- jav January 19, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

need to overload *?

- joke January 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yes I also think you need to overload*

- Anonymous February 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

A lot of these questions are from the brainbench C++ test.

- baski February 28, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The return type needs to be compatible with the expression a*b*c. Thus a*b needs to return a type that can be multiplied with c and (a*b) * c needs to return an int (or the return type of the function needs to be changed).

- Anonymous September 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Unless all the three template variables type are either int,float,double its behaviour is undefined

- Maankutti September 11, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Compiled and run the following:

1 #include <stdio.h>
2
3 template<class T1, class T2, class T3>
4 int Pr(T1 a,T2 b,T3 c)
5 {
6 printf("a: %f b: %f c:%f\n",a,b,c);
7 return a*b*c;
8 }
9
10 int main()
11 {
12 int x = Pr(1.1,2.1,3.1);
13 printf("%d\n",x);
14 return 0;
15 }

Output:
a: 1.100000 b: 2.100000 c:3.100000
7

So I see, either there is typo with ";" or there is syntactically nothing wrong. I am not sure whether the question involves semantic error of any kind.

- Anonymous January 06, 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