Photo Sharing Service: System Design Interview with a Senior FAANG Engineer
Photo Sharing Service
Watch someone solve the photo sharing service problem in an interview with a FAANG engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.
Interview Summary
Problem type
Photo sharing service
Interview question
Design a photo-sharing service which allows users to:
- Upload a photo on their profile.
- See photos uploaded by other users the user follows.
Interview Feedback
Feedback about Orthogonal Warrior (the interviewee)
Advance this person to the next round?
Yes
How were their technical skills?
4/4
How was their problem-solving ability?
4/4
What about their communication ability?
4/4
What went well:
• Good question to confirm whether follow requests are auto-accepted or not
• Great question asking whether anonymous users are something we should support in the system or if all users are already verified/authenticated.
• Good questions asking what metadata I care about seeing associated with the photo. Great point about talking about the delete case.
• Solid job probing the functional requirements -- photo resolution, what limitations for read/write are on the system.
• Solid RESTful API design
• Good clarifying the need to come back to certain items -- such as the queue
• Explained rationale for the architectural components which were introduced -- LB, API GW for supporting indirection and horizontal scaling.
• Great call-outs on the why behind using NoSQL databases for supporting horizontal scaling along with call-outs for a specific technology.Areas for improvement:
• Improve -- did not clarify what non-functional requirements I care about.
• Improve -- take your time to talk through request/response payloads and status codes
• Improve -- should have clarified if I need to see a newsfeed of all photos uploaded by users the user follows
• Nit -- call out the need for versioning
Feedback about Platinum Lambda (the interviewer)
Would you want to work with this person?
Yes
How excited would you be to work with them?
4/4
How good were the questions?
4/4
How helpful was your interviewer in guiding you to the solution(s)?
4/4
Great interviewer. Great questions, was very happy with the feedback and hopefully things end up well!
Interview Transcript
Platinum Lambda: Excellent. How's it going?
Orthogonal Warrior: Oh, you know, it's preparing for interviews, so as good as you can be while handling the stress. Gotcha.
Platinum Lambda: When is your upcoming interview? How far out?
Orthogonal Warrior: It's actually tomorrow and it's the round of five over at Facebook. This is, I think, my fifth one of these mocks that I'm doing. I'm just trying to really make sure that I'm taking and getting feedback and getting used to that. I've, I haven't interviewed for a FAANG company in a number of years, so trying to brush off some of those skills.
Platinum Lambda: Gotcha. And then what level are you applying for?
Orthogonal Warrior: I'm going for an L6 over at Meta.
Platinum Lambda: Okay, perfect. All right. I hope this will get you more ready. Tomorrow's interview, we'll get started. I'm going to paste a question here. Sure. If you've seen this question before, let me know.
Orthogonal Warrior: Let's see. Design a photo sharing service which allows users to upload a photo on their profile and see photos uploaded. But I haven't, I mean, this sounds like Instagram. I know that Instagram is a common design problem. I have not actually done this problem personally.
Platinum Lambda: Okay, sounds good. All right, we'll get started then. Cool. But yeah, have a look and then let me know if you have any questions on the requirements.
Orthogonal Warrior: Yeah, if you don't mind, I'm actually going to just jump over, I'm going to copy this and jump over to the whiteboard. I'll probably be doing most of our discussion, driving most of our discussion there, if that's all right.
Platinum Lambda: Sure.
Orthogonal Warrior: So we'll drop those in there. All right, so design a photo-sharing service which allows users to upload a photo on their profile and see photos uploaded by other users. The user follows. Okay, so it's in that sense again, kind of a-la Instagram, it's going to be the same page, just visibility restricted. And then follow unfollow toggles there.
System Design Requirements
Functional Requirements
- Users must be able to upload a photo.
- Users must see only the photos of the users they follow.
Non-Functional Requirements
- High availability
- Low latency
Proposed API Endpoints
- POST /photos
- Upload a photo along with metadata
- GET /users/{id}/photos
- Retrieve a user's photos based on followed users
- GET /users/{id}/followers
- Retrieve the list of followers for a user
- GET /photos/recent
- Retrieve recent photos uploaded by followed users
Database Considerations
- Users Table (NoSQL)
- Photos Table (NoSQL)
- Followers Table (NoSQL)