Adobe Phone Screen - one coding, one system design

Just had a phone screen at Adobe. Was about one hour. Didn't expect the system design question, but the coding was probably an easy leetcode, and I did get it correct, except it wasn't
the optimal version, as it was just off the top of my head. The coding question was:

"Find the missing Number"

The didn't ask me to code, but I explained it in detail my approach as follows:

 internal int getMissingNoTooSlow(int[] a)
        {
            var len = a.Length;
            Array.Sort(a);
            var missing = 0;
            for (var i = 0; i < len; i++)
                if (a[i] != i + 1)
                    missing = i + 1;

            return missing;
            
        }

So, the correct answer would be just calculating the total if there were no missing numbers,
then subtracting every value of the array which would leave the missing number in total:

static int getMissingNo(int[] a)
    {
	    var n = a.Length;
        int total = (n + 1) * (n + 2) / 2;
 
        for (int i = 0; i < n; i++)
            total -= a[i];
 
        return total;
    }

Then the design question was just to design a social media platform. I didn't design it I just explained it on a zoom call. A very vaque question, but I had some idea of how to do it, so I asked the following:
,

  • How many users are on the platform
  • What is more important: Posts being instantly updated on the platform, or speed of a user posting, or viewing the users posts
    I didn't get too much into detail at that point, but they then asked about the database, so I described a basic table structure, like users, posts, and the relationship between them so a user
    would have many posts, 1 to many. and some other tables, which I forgot about.
  • They asked about the database, I said I would shard probably by user name for speed, not sure what I was talking about at that point, but it seemed somewhat correct.
  • I said I would use a load balancer somewhere in the system
  • I said there may be some other db process that updates the posting db so that it is an 'eventually consistent' system

But, didn't pass the interview. I think the coding question, I should have gotten it, but just missed the point about the calculation, doh!.
And the system design was just a discussion, but I could have done better, missed probably a big part of it.

Anyways, that's what an Adobe phone screen is about, kind of a mix of coding, and design. But, still not up to speed on designing systems, so does anyone have a good resource
for that? I've been on youtube for a while, but I cant quite grasp it all 100%, I just forget half of what I've learned after a while anyways,

Comments (0)