Aricent Interview Question for Testing / Quality Assurances


Country: India
Interview Type: In-Person




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

a memory leak occurs when a computer program incorrectly manages memory allocations. A memory leak may happen when an object is stored in memory but cannot be accessed by the running code

- Wendy April 08, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a memory leak occurs when a computer program incorrectly manages memory allocations.In object-oriented programming, a memory leak may happen when an object is stored in memory but cannot be accessed by the running
ex-

#include <stdlib.h>
 
void function_which_allocates(void) {
    /* allocate an array of 45 floats */
    float * a = malloc(sizeof(float) * 45);
 
    /* additional code making use of 'a' */
 
    /* return to main, having forgotten to free the memory we malloc'd */
}
 
int main(void) {
    function_which_allocates();
 
    /* the pointer 'a' no longer exists, and therefore cannot be freed,
     but the memory is still allocated. a leak has occurred. */

}

- Ajit April 21, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use "top" command.

- Tharani May 02, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In case of dynamic memory allocation in C/C++ if you have lost all the references/pointers to a memory allocated using malloc/calloc OR new, new[] etc. then this memory can never be freed/deleted because no reference is available to this memory and memory is said to be leaking. This memory can not be allocated to store some other thing by the program.

A shell script can only be used to find memory leak by static code analysis of the program This can be done by grepping the number of malloc/new etc and matching them with the number of free/delete etc. In case there are more malloc/new then then the program might contain a memory leak.

- jitendra October 08, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In case of dynamic memory allocation in C/C++ if you have lost all the references/pointers to a memory allocated using malloc/calloc OR new, new[] etc. then this memory can never be freed/deleted because no reference is available to this memory and memory is said to be leaking. This memory can not be allocated to store some other thing by the program.

- jitendra October 08, 2015 | 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