Walmart Interview

Posted
12 Nov 2024
331 reads

Summary

I recently interviewed at Walmart, where the focus was on designing a data structure for O(1) time complexity operations like returning min/max and handling oldest/newest elements.

How it went

I had an interview at Walmart that centered around a challenging data structure design problem. I was asked to implement a data structure capable of performing several operations—specifically, returning the oldest, newest, minimum, and maximum elements, as well as fetching and removing the oldest and newest elements—all with a strict O(1) time complexity requirement.

Questions asked (1)

  1. 01

    Design Data Structure for O(1) Min/Max/Oldest/Newest

    Data Structures & Algorithms

    Design a datastructure which can perform following operations with O(1) time complexity:

    1. return oldest element
    2. return newest element
    3. return min
    4. return max
    5. fetch and remove oldest element
    6. fetch and remove newest element

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Walmart 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!