Interview Question for Software Engineer / Developers






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

This is correct. It is using anonymous parameter and default parameter both here, even the parameter will not be used in the function body, the function itself has no problem.

- xiaofeng.ustc January 30, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can't assign a value to a parameter to a function.

- Anand July 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

If it is int cast(int *p = NULL){ return 0;}

This is right, we can assign default values

- ibnipun10 July 25, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

but it's meaningless. It does almost nothing.

- ftfish July 25, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

actually, I think assigning default value can only happened in declaration.

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

What kind of question it this!?!?

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

It will initialize the input parameter.

- gopikrishnaiah July 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There is no error in compiling. (ibnipun, you don't need the parameter name p)
Can anyone give an explanation?

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

Nothing is wrong in this code . I have compiled in Dev C++ . It doesn't show any error

- Ankur October 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Used to check you knowledge on default parameters I guess

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

For proper compilation space required between * and = (*= operator is illegal here) :D

- fiddler.g December 23, 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