USA | Traba | Phone

Location
USA
Posted
29 Dec 2025
346 reads

Summary

I had a phone screen interview with Traba where I was asked to implement a cache with specific eviction policies and discuss time complexity improvements. I presented my approach and am hopeful for a positive outcome.

How it went

Not too bad of an interview problem! The best part was that the interviewer does not expect working code. In fact, for my approach, I was allowed to stub out some of the functions but I talked through the mechanics.

Fingers crossed for a pass

Questions asked (1)

  1. 01

    Implement Cache with Priority and LRU Eviction Policy

    Data Structures & Algorithms

    Your job is to implement a cache as per the below requirements:

    • get(key: string)
    • set(key: string, value: string, priority: int)
    • evictCache

    Eviction policy:

    • Remove the key/value pair with the highest priority number
    • If there is a tie, remove the least recently accessed key/value pair

    Followup: Any opportunity to improve the time complexity of evictCache. I had a linear time complexity and needed to discuss how to improve it

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Traba recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!