thoughtspot logo
Thoughtspot· SMTS - Frontend

Thoughtspot - SMTS - Frontend

Posted
16 Apr 2025
326 reads

Summary

I interviewed for an SMTS Frontend role at Thoughtspot. I successfully solved a coding question involving the design of a Store class, but despite my solution passing all test cases, I was ultimately rejected, which I found puzzling given the interviewer's apparent disinterest.

How it went

I recently interviewed at Thoughtspot SMTS position.

I felt things went really smooth.
i was also able to solve a question that was given in really less time.
but i got rejected.

here is a question i was asked.

const userStore = new Store();
userStore.save("user_id_1", "samuel jackson");


const unsubscribe1 = userStore.subscribe(
"user_id_1",
(value) => {
console.log("first", value);
}, // update function
() => {
console.log("cleanup1");
} // cleanup function
);
userStore.save("user_id_1", "samuel l jackson"); //all the updaters should get called corresponding to “user_id_1”

unsubscribe1(); //should remove the update function

I was asked to design a Store class from scratch. The class needed to support three main operations:

Subscribe – This method takes a key, an update function and a cleanup function. Also, the subscribe method should return a cleanup function that can remove that specific update function when it’s no longer needed.

Save – This takes a key and a value. When a value is saved, it should notify all the update functions subscribed to that key.

Remove – This should simply remove the key from the internal cache.

But i got rejected. Something doesnt feel right.

Is my solution wrong?

I agree there could be some optimisations.
but he could have asked me to optimise, but he dint utter a word.
he also seemed very disinterested in the interview from the beginning.
Really a very bad experience.

Questions asked (1)

  1. 01

    Design a Store Class with Subscribe, Save, and Remove

    Data Structures & Algorithms · Medium

    I was asked to design a Store class from scratch. The class needed to support three main operations:

    Subscribe – This method takes a key, an update function and a cleanup function. Also, the subscribe method should return a cleanup function that can remove that specific update function when it’s no longer needed.

    Save – This takes a key and a value. When a value is saved, it should notify all the update functions subscribed to that key.

    Remove – This should simply remove the key from the internal cache.

    Example usage:

    const userStore = new Store();
    userStore.save("user_id_1", "samuel jackson");

    const unsubscribe1 = userStore.subscribe(
    "user_id_1",
    (value) => {
    console.log("first", value);
    }, // update function
    () => {
    console.log("cleanup1");
    } // cleanup function
    );
    userStore.save("user_id_1", "samuel l jackson"); //all the updaters should get called corresponding to “user_id_1”

    unsubscribe1(); //should remove the update function

Know someone preparing? Send it to them:WhatsAppLinkedInX

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