Apple Interview Question for Software Engineer in Tests


Country: United States
Interview Type: Phone Interview




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

I found code in stackoverflow site

static unsigned char our_memory[1024 * 1024]; //reserve 1 MB for malloc
static size_t next_index = 0;

void *malloc(size_t sz)
{
    void *mem;

    if(sizeof our_memory - next_index < sz)
        return NULL;

    mem = &our_memory[next_index];
    next_index += sz;
    return mem;
}

void free(void *mem)
{
   //we cheat, and don't free anything.
}

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

1) Give a very large size(1000000000) and check if its able to allocate
2) Provide number values 1,3,0,100
3) Give a character in size to api
4) GIve blank spaces
5) NUll value for size field in api
6) Call the api from multiple sessions

- Gaurav Khurana May 11, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1.Enter characters
2. Try for null values
3.TRy for blank spaces
4.TRy with very large size
5. Enter combination of chars & numbers

- s.chaudhari84 October 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.


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