Interview Question for Developer Program Engineers


Country: India
Interview Type: Phone Interview




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

Java?

I would hope the compiler converts this to bytecode roughly equal to
String temp = "ABC";

It's all known at compile time.

- S O U N D W A V E October 11, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote

What version of Java?

- Anonymous October 11, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Good question.

- Anonymous October 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

I agree, modern compiler should convert String to StringBuilder. String literals are pooled in String pool.

- gstepanov@griddynamics.com October 11, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

why it won't be 4?

- d October 12, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the answer will be 4.
1. "A"
2. "B"
3. "C"
4. temp

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

Four Objects of String type are created: A, B and C and ABC

- Nawazish October 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

5 Objects will be created
A, B, C, AB, ABC

- Avinash Kumar October 23, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Between 0 to 5. String literals are in the string literal pool, so these strings ("A", "B", "C", "AB", "ABC") are created only if they are not in the pool.

- Nora November 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

5Object will create here.....A,B,C,AB,ABC

- amitiiest November 04, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Khusabhukumare

- Khusabhu, kumare January 23, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

5 object will create "A" "B" "C" "AB" "ABC" because the string object created and string concatinate

- Krashna Thakur February 21, 2020 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

5 object will create "A" "B" "C" "AB" "ABC" because the string object created and string concatinate

- Krashna Thakur February 21, 2020 | 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