PhonePe Interview Expertise for SDE (2 – 5 Years Skilled)


View Dialogue

Enhance Article

Save Article

Like Article

There have been complete 4 rounds

  • Machine coding
  • DS/Algo
  • Design Spherical
  • Hiring supervisor Spherical

Machine Coding Spherical: Have to implement the multilevel cache design.

Every degree will retailer Key-Worth pairs of information. Each KEY and VALUE are of sort String. L1 is the highest most degree and Ln is the final degree.

You might be given the next configuration and particulars in regards to the system:

Max variety of ranges of cache. The system begins with just one degree initially and grows to a max variety of ranges as per the config.
The capability of every degree, i.e. variety of components that may be saved. The dimensions is mounted for each degree, though every degree might have a special capability.
This Cache system ought to be capable of carry out following operations:

  • READ KEY Operation
    Learn will begin from L1 degree. If KEY is discovered at this degree, then this worth can be returned. If KEY isn’t discovered at this degree, then attempt to learn from the subsequent degree. Maintain doing this till the worth of KEY is discovered at some degree or the final degree has been reached. If the worth of KEY is discovered at some degree, then this VALUE also needs to be written into the primary degree and the anticipated write conduct ought to observe as specified within the subsequent part.
  • WRITE KEY Operation
    Writes will begin from degree L1. If a degree is full, evict any key-value pair from this degree and write the evicted k-v pair into the subsequent degree. If the subsequent degree can be full, evict any k-v pair from that degree and insert within the subsequent degree and so forth. For those who attain the final degree, add a brand new degree and insert the evicted Okay-V pair on this new degree.
  • DELETE KEY operation
    Deletes the given key from all the degrees the hot button is current in.

Eviction Technique: We’d like the technique to be pluggable. For this downside, implement LFU (Least Incessantly Used) i.e take away the important thing which has been used least steadily.

You’ll be evaluated primarily based on

DS Algo Spherical: There have been 2 issues it was carried out by interview vector:

  1. https://www.geeksforgeeks.org/build-lowest-number-by-removing-n-digits-from-a-given-number/
  2. Variation of prefix sum. Given person and a number of logtime want to seek out person with max log time in final 1 hour

Design Spherical: Design flight aggregator system. Aggregator will get information from completely different airways and person will be capable of search and ebook flight from aggregator. Interviewee anticipating the excessive degree design. How the info can be fetched from airways concerning the flights and the way it will likely be saved in our database. Segregate the system in numerous microservices. Because the visitors on search api is excessive so how it will likely be dealt with. Want to point out connecting flight as effectively if no direct flight is offered. How you can deal with reserving of various airways and api failures and all.

I advised interviewee that we will use mysql for this software because it assist ACID and our usecase are additionally glad. For looking we will use a number of slaves however he requested if visitors will increase then how it will likely be dealt with as spawning a brand new slave and replicating the info will take time, which i couldn’t reply. And that was finish of my interview journey