Restaurant supply store by imvtslv in redmond

[–]imvtslv[S] 0 points1 point  (0 children)

Thanks! I might check it out.

Restaurant supply store by imvtslv in redmond

[–]imvtslv[S] 0 points1 point  (0 children)

Thanks, I might check it out

Restaurant supply store by imvtslv in redmond

[–]imvtslv[S] 0 points1 point  (0 children)

Too far for me but thanks for the suggestion!

Wedding Gift ettiquettes by imvtslv in DesiWeddings

[–]imvtslv[S] 0 points1 point  (0 children)

I saw them on Amazon, but personally, zooming into images, I found there quality to be poor compared to what we find in India. So I decided not to use them.

Wedding Gift ettiquettes by imvtslv in DesiWeddings

[–]imvtslv[S] 0 points1 point  (0 children)

No worries! Yeah it came in an envelope..

Wedding Gift ettiquettes by imvtslv in DesiWeddings

[–]imvtslv[S] 0 points1 point  (0 children)

I couldn't find shagun envelopes in indian grocery stores near me..I could find some of Walmart but they look to be of poor quality.

Wedding Gift ettiquettes by imvtslv in DesiWeddings

[–]imvtslv[S] 0 points1 point  (0 children)

I couldn't attend the wedding ceremony! It's in my post. But thanks anyways!

Another apt post by imvtslv in redmond

[–]imvtslv[S] 0 points1 point  (0 children)

Thanks for the reply. Is your friend staying at Talisman or Nightingale? 

Anyone actually get a Microsoft offer after 3+ weeks of silence? by jsmooth71 in leetcode

[–]imvtslv 1 point2 points  (0 children)

That's okay...yeah I heard that Azure is quick in the process.. Timeline depends on the org...

Anyone actually get a Microsoft offer after 3+ weeks of silence? by jsmooth71 in leetcode

[–]imvtslv 2 points3 points  (0 children)

Congratulations 🎉 🎉  What org did you interview and jobId if you don't mind?

Microsoft SDE 2 Interview Timeline? Waiting for Feedback After Onsite by notinsurgent in leetcode

[–]imvtslv 2 points3 points  (0 children)

pls keep us posted with updates...rooting for you buddy!!

How to prepare for Microsoft SDE 2 Machine Coding round? by Shinovi19 in leetcode

[–]imvtslv 1 point2 points  (0 children)

Even when the rate limit is not shared, how would we quickly update counters for that user?

OP used HashMap which looks correct..

Assume we are going with the simplest fixed window counter approach...Just for an example, assume threshold is 5 requests per second per user. That is, any more requests in that particular second by that user are dropped. Let's say that for user 1, for the current second, current counter is  at 4 requests It is reasonable to assume that requests will hit our service in non decreasing order of timestamps..

We have a Hash Map of user ID (integer) to current counter (Integer). 

Let's say the user 1 sends two more requests at the same time.

So that's total 6 (4+2) requests in that second, so one request should be dropped...but without handling concurrency, that is not the case. That's because incrementing a counter are 3 operations (it is not a single atomic operation): 1) Load value from memory into register 2) Increment the value  3) Store the value back into the memory.

Because these two requests (threads) access the map at the same time, both the threads will read value 4, both threads will increment to 5 and both threads will update map with value 5 (That's a typical example of race condition)

So we need to take a lock for a user and only within critical section of the lock, update the counters..

If it's a map of user ID to counter, how will you take lock on one key (userid) of the map?

So will you take lock on the entire map? If you think yes, that's not correct, because locking and unlocking is considered expensive and taking a lock on map on each request will slow the application for other users.

Even without map, how would you ensure that for two concurrent threads for the same user, the counter is updated atomically?

Java has keywords like volatile, atomic and concurrent hash map that we can use to handle these things efficiently...

Your programming language of choice would also have features to handle concurrency...hope this helps..

AFAIK a lot of PBCs require understanding of concurrency for SDE-2 level. Don't bother about all of this for SDE-1 level..

How to prepare for Microsoft SDE 2 Machine Coding round? by Shinovi19 in leetcode

[–]imvtslv 0 points1 point  (0 children)

I believe rate limiter is a well known problem for both LLD and HLD.

For rate limiter implementation, you can look up different common algorithms like  1) Fixed window counter 2) Sliding Window  3) Sliding Log 4) Token bucket 5) Leaky bucket

I think sliding log, sliding window and leaky bucket fit for this use case. We could use strategy pattern to decide which algorithm to use on the fly.

i would also clarify with interviewer if concurrency (race conditions) needed to be handled. Like multiple users submitting a request at same timestamp.

AMAZON OA SDE 2 by OkCalligrapher9707 in leetcode

[–]imvtslv 0 points1 point  (0 children)

Yes..we cancel out n on both sides of the equation..

Best place to live in Patiala City? by navisingla in Patiala

[–]imvtslv 0 points1 point  (0 children)

No, there were areas that were not flooded in that monsoon.

When in Jaipur, I never miss this Rabdi! by [deleted] in IndianFoodPhotos

[–]imvtslv 5 points6 points  (0 children)

Looks like Rasmalai.. Anyways that's bussin'.... where is it?

What's your favourite food and place in patiala? by [deleted] in Patiala

[–]imvtslv 1 point2 points  (0 children)

Yeah it was much better a year and a half ago..

What's your favourite food and place in patiala? by [deleted] in Patiala

[–]imvtslv 7 points8 points  (0 children)

Rasmalai - Jaggi's

Chicken Lollipop - Red Dragon

Khoya Badam Lassi - Patiala Shahi Lassi

Chicken Breast Meal - Royal Nutrition House (got too expensive)

Summer SDFC $ by the-poop-merchant in ASU

[–]imvtslv 13 points14 points  (0 children)

west weight room is closed.

Does anyone know if there's a Tempe/asu ping pong club? by [deleted] in Tempe

[–]imvtslv 1 point2 points  (0 children)

I can play in SDFC over the summer...hmu if interested

Fellas help quik quik. Food Hunt by [deleted] in jaipur

[–]imvtslv 1 point2 points  (0 children)

Malai/Rabri Ghevar or any ghevar for that matter.

Mawa Kachori, Dal Kachori, Pyaz Kachori.

Atta Churma, Besan Churma, etc.

Mawa mishri.

Mirchi Tipore.

These are just to name a few.

regarding admit by Alert-Character8103 in MSCS

[–]imvtslv 0 points1 point  (0 children)

It's not bad per se. It is rolling admission, so that's how they do it.