Google | Onsite | System Design | Staff Software Engineer
Anonymous User
1840

Hi Everyone,
I interviewed this week (Aug-2022) with google for my system design.
My Exp: 15 years of total exp.

System Design-I
Design a metrics collection system for a company.
your company has mobile app/website from which you wants to collect these user metrics.
These metrics data are not critical (ex not SRE related)

System Design-II
Design a system for street view image taxis. Taxi can take street images and upload it into sytem.
system should do some processing on images (quality, privacy, consistency checks) before saving the final image to cloud.

My approach SD-I
I asked first questions about the requirements-

  • what kind of metrics data it will have, text or any time? -> any type
  • what is the request per seconds for this system?
  • read/write pattern? looks like write heavy system.
  • my availability vs consistency considerations. I choosen highly available and eventual consistent.
  • clarified about my considerations for scale & estimations calculations.

Funct Req.

  • User can send data to metrics system.
  • User can query data from metrics system. (batch more query)

Non-Functional Req.

  • Highly Available
  • Write Latency - 1 sec per event
  • Write heavy
  • Eventual Consistency
  • Scalability

Scale
(all confirmed with interviewer about data, I did some wrong calculate also in hurry, which I corrected here :)
100 Aps
10-20 events /hours
50 Million / app ->
100 * 50 M * 20 -> 100 Billion/hour -> 2400 Billion/day -> 2 B/sec

No of Servers ->
1 event -> 1KB size
2 Bil/sec * 1 KB -> 2 TB/sec
one server bandwidth: 100 MB/sec
2000,000 MB/100 MB -> 20 K servers (looks a lot)
total storage- 2 TB/sec * 10^5 -> 200 PB/day

Then talk about these topics->

  • High Level Design
    • draw simple: User -> LB -> service -> DB design
    • talk about some trade offs, then modified to User -> LB -> Async (Message Queue) -> service -> DB design
    • talk about which DB (SQL vs NO SQL) choosen nosql due to schemaless data, large data, scalable system
      also talk about 2-3 min each these-
  • API Design
  • Database Design
  • Trade-Offs
  • Failover
  • Sharding & Replication
  • Caching
  • Edge Cases
  • Peak traffic
  • Security & Data Privacy
  • Monitoring & Alert
  • Conclude The Design

followup questions

  • what is user using some offline apps (without internet) how will you handle these cases
    Ans. I told to use some local data storage at user device and push data after some time when user connected with network.

overall it was good.

  • I feel I should have talk more about requirement.
    ex. mobile apps, which types of apps, data, size vs website data ? offline mobile apps?
    what user event and frequency for collecting data?
  • I should take my own design decisions with reasons, drive them rather than clarifying design related things with interviwer.
    ex. I asked non-functional requirement clarifications. it should be my design so I should propose them.

My approach SD-II
Functional Requirement

  • Device can capture a image
  • Device can upload an image
  • Process image
  • Store image

Non-Functional Requirement

  • Highly Available
  • Write heavy
  • Eventual consistent
  • Latency : 500 ms (capture/upload)

Scale & Estimation
1k taxi/city
10 impage/1 km
2k * 1k image/day -> city
2 M /city
2 M * 10 MB -> 20 TB/day
20 PB /day

High Level Design
first talk about base design then used async model -
User (devices) -> LB -> MQ -> Image Upload Service -> Image Process Service -> DB (meta-nosql & cloud storage)

then same all topic wise discussion.
It was not very good as interviewer asked a lot so I was not able to talk all my points.

Please provide your expert comments so we all can smash these companies interviews together :)

still waiting for the feedback about interview!

Comments (6)