Thoughtspot - SMTS - Frontend

thoughtspot logo
thoughtspot
SMTS - Frontend
April 16, 20253 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.

Full Experience

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.

Interview Questions (1)

Q1
Design a Store Class with Subscribe, Save, and Remove
Data Structures & AlgorithmsMedium

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

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

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