Adding two numbers, each digit as a single element of array
I see some things that may help you improve your code.

Use const where practical

The sumOfTwo() function doesn't (and probably shouldn't) modify the passed integer arrays, so they should be declared const.

Show all required headers

The code uses malloc and free but the code does not show a the required include file.  For code reviews (and job interviews!), it's best to list the required includes.  This code needs only:

#include &lt;stdlib.h&gt;


Use stdbool.h when needed

This code contains lines like this:

int a1IsLongest = TRUE;


However, there are already bool types and values supported in the stdbool.h header.  Prefer those to non-standard types and values.  The line above would then be:

bool a1IsLongest = true;


Fix formatting

The indentation is not consistent, and in one case, there's a space between else and the following { but in other case there's no space.  Which convention you use is less important than choosing one and following it consistently.

Simplify your code

There are a number of extra variables and comparisons to determine which array is larger.  Why not instead simply assume that a1 is longer than or equal in length to a2 and then make that true?  It would simplify the code a lot.  For example, one could start the code this way:

if (lengthOfA1 &lt; lengthOfA2) {
    // swap the arguments to ensure a1 is not shorter than a2
    int *temp = a1;
    int templen = lengthOfA1;
    a1 = a2;
    lengthOfA1 = lengthOfA2;
    a2 = temp;
    lengthOfA2 = templen;
}


Assume a convenient data structure unless otherwise specified

It's not clear whether you were told that the data structure had the least significant or most significant digit first or whether either had leading zeroes.  The most convenient data structure would actually be to store the data with the least significant digit first, as I'll demonstrate in the next suggestion.

Allocate memory only once

The current code allocates some memory and then may allocate again if more is needed, copying the elements from the old to the new array.  There are several strategies that would allow you to allocate memory only once.  

The first is to note that the maximum additional memory required would be exactly one int and to simply allocate enough space for that, with the understanding that there would be, potentially, a leading zero in the answer.

The second would be to determine if a carry will be required and allocate space accordingly.  One way to do that would be to make two passes through the data.

The other possibility is to adjust the allocated length after calculation.  This could be done very simply using the realloc function. 

Prefer "less expensive" to "more expensive" operations

If the digits are decimal digits (not stated, but assumed), then the largest possible sum will be 9+9=18, so the largest possible carry value is 1.  If the resulting value is greater than 10, the current code uses this code:

answer[i] = result % 10;


The % operator typically does a division which is computationally expensive on many platforms.  Better is to simply use subtraction and the fact that the carry can only possibly be equal to 1 or 0.

if (result &gt;= 10) {
    result -= 10;
    carry = 1;
}


Check for memory allocation failure

Calls to malloc can fail.  Robust code should check for that and handle the out-of-memory condition appropriately.

Putting it all together

Here's a version incorporating all of these suggestions:

int *sumOfTwo(const int *a1, const int *a2, int lengthOfA1, int lengthOfA2, int *lengthDest)
{
    if (lengthOfA1 &lt; lengthOfA2) {
        // swap the arguments to ensure a1 is not shorter than a2
        const int *temp = a1;
        int templen = lengthOfA1;
        a1 = a2;
        lengthOfA1 = lengthOfA2;
        a2 = temp;
        lengthOfA2 = templen;
    }
    *lengthDest = lengthOfA1 + 1;
    int *result = malloc(*lengthDest*sizeof(a1[0]));
    if (result == NULL) {
        *lengthDest = 0;
        return NULL;
    }
    // copy a1 into result    
    memcpy(result, a1, lengthOfA1*sizeof(a1[0]));
    result[lengthOfA1] = 0;
    int carry = 0;
    int *end = result + *lengthDest;
    int val;
    // add in place
    for (int *digit = result; digit != end; ++digit) {
        val = carry + *digit;
        if (lengthOfA2) {
            val += *a2++;
            --lengthOfA2;
        }
        if (val &gt;= 10) {
            val -= 10;
            carry = 1;
        } else {
            carry = 0;
        }
        *digit = val;
    }
    return result;
}


Test harness

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
#include &lt;stdbool.h&gt;

// sumOfTwo() goes here

void printnum(const int *num, int len, int desiredlen)
{
    for (; desiredlen &gt; len; --desiredlen) {
        printf(" ");
    }
    for (num += len - 1; len; --len, --num) {
        printf("%u", *num);
    }
    puts("");
}

struct number {
    int len;
    int digits[5];
};

struct test {
    struct number n1, n2, expected;
};

struct test tests[] = {
    { { 1, {9} }, { 1, {9} }, { 2, { 8, 1 } }}, 
    { { 3, {8, 9, 9}}, {2, {1, 9}}, { 4, { 9, 8, 0, 1}}},
    { { 3, {8, 9, 9}}, {3, {0, 0, 1}}, { 4, {8, 9, 0, 1}}},
};

bool doTest(const struct test* t) {
    int lengthDest;
    int *answer = sumOfTwo(t-&gt;n1.digits, t-&gt;n2.digits, t-&gt;n1.len, t-&gt;n2.len, &amp;lengthDest);
    printnum(t-&gt;n1.digits, t-&gt;n1.len, 5);
    printnum(t-&gt;n2.digits, t-&gt;n2.len, 5);
    puts("-----");
    printnum(answer, lengthDest, 5);
    if (lengthDest != t-&gt;expected.len) {
        free(answer);
        return false;
    }
    for (int i = 0; i &lt; lengthDest; ++i) {
        if (t-&gt;expected.digits[i] != answer[i]) {
            free(answer);
            return false;
        }
    }
    free(answer);
    return true;
}

int main()
{
    int testcount = sizeof(tests) / sizeof(tests[0]);
    for (int i=0; i &lt; testcount; ++i) {
        printf("Test %d: %s\n\n", i+1, doTest(&amp;tests[i]) ? "OK " : "BAD");
    }
}


Test result

Here is the output of the test program:

    9
    9
-----
   18
Test 1: OK 

  998
   91
-----
 1089
Test 2: OK 

  998
  100
-----
 1098
Test 3: OK