Samsung Interview Question for Software Engineer / Developers


Country: -
Interview Type: In-Person




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

Well Good but Known Question.

1> Primarily the answer is Return type plays no Role in this mechanism and if someOne mistakenly did than in C++ compiler shouts...
2> However in different argument variable types. Actually C++ Compiler optimizes the function Name in Symbol Table by appending internal reference mechanism which can be deference internally. This is clearly visible if some one check the polymorphism using virtual pointer and virtual table.

- Prem October 11, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If there are two overloaded functions like
Add(float,int);
Add(int,float);

Compiler will generate unique identifier to identify these functions, and these identifier may look like these respectively.

Add_int_float
Add_float_int

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

C++ does not support overloading by return type. Other languages might, if they can infer from context which type is needed in a particular expression.

- eugene.yarovoi October 09, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I don't think any language can support overloading by return type. Ex: int ans=f(x,y) double ans=f(x,y)how can I know which function to call ? based on the type of answer it assign to?

- Anonymous October 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

If a language wanted to support that...yes, that would be how.

- eugene.yarovoi November 08, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

not sure but chk this.
generallly associativity of assignment operator is Right To Left. so in an assignment operator function is first called, and that point f time it does not know about the right hand side variable's data type and i think this is the reason for compiler not supporting overload of function having same signature but diff return type.
please correct me if i m wrong

- pradeep March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

complier internally coverting like that
char add(int,char)----->_z23aic
char add(int,float)----->_z23aif
so here _z23 is return type so return type not checking

- shekar.raj3 August 30, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Its called Name mangling supported in c++ and not in c that is why c++ supports function overloading and c does not.

- AP February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

hi

- naresh_NITT October 09, 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