Symantec Interview Question
Principal Software EngineersCountry: United States
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
From the book: Effictive Java(Page 20)
Avoid creating unnecessary objects -
It is often appropriate to reuse a single object instead of creating a new function-ally equivalent object each time it is needed. Reuse can be both faster and more stylish. An object can always be reused if it is immutable.
As an extreme example of what not to do, consider this statement:
The statement creates a new String instance each time it is executed and none of those object creations is necessary. The argument to the String constructor("stringette") is itself a String instance, functionally identical to all of the objects created by the constructor. If this usage occurs in a loop or in a frequently invoked, millions of String instances can be created needlessly.
The improved version is simply the following:
This version uses a single String instance, rather than creating a new one each time it is executed. Furthermore, it is guaranteed that the object will be reused by any other code running in the same virtual machine that happens to contain the same string literal.
- trish August 17, 2013