"Initialize left pointer: Set a left pointer left to 0.
Iterate through the array: Iterate through the array from left to right.
If the current element is not 0, swap it with the element at the left pointer and increment left.
Time complexity: O(n). The loop iterates through the entire array once, making it linear time.
Space complexity: O(1). The algorithm operates in-place, modifying the input array directly without using additional data structures.
"
Avon T. - "Initialize left pointer: Set a left pointer left to 0.
Iterate through the array: Iterate through the array from left to right.
If the current element is not 0, swap it with the element at the left pointer and increment left.
Time complexity: O(n). The loop iterates through the entire array once, making it linear time.
Space complexity: O(1). The algorithm operates in-place, modifying the input array directly without using additional data structures.
"See full answer
"Before diving into answering this, I would like to ask some clarifying questions -
High Level - What is the mission, goal, target for this year for WhatsApp?
Assumption answer - 10X growth in users
Do we have any road map where we can see it with more details?
Yes we wish, it is kind of all over the place
Do you know how far we have come from the start of the year to achieve that target?
Yeah we have done some progress but not much
Which quarter are we in?
1"
Umang S. - "Before diving into answering this, I would like to ask some clarifying questions -
High Level - What is the mission, goal, target for this year for WhatsApp?
Assumption answer - 10X growth in users
Do we have any road map where we can see it with more details?
Yes we wish, it is kind of all over the place
Do you know how far we have come from the start of the year to achieve that target?
Yeah we have done some progress but not much
Which quarter are we in?
1"See full answer
"Being a marketplace, there are two users that Uber wants to satisfy: the rider and the driver. I think the ultimate success metric is related to how well riders and drivers get matched.
The ultimate goal for the rider is to get to their destination as efficiently as possible.
Some concerns for the rider may be
Matching with drivers
Minimizing waiting time waiting to be matched and waiting for the driver to arrive
Ease of pick-up and drop-off (ie. Driver coming from the opposite side of t"
Elisa L. - "Being a marketplace, there are two users that Uber wants to satisfy: the rider and the driver. I think the ultimate success metric is related to how well riders and drivers get matched.
The ultimate goal for the rider is to get to their destination as efficiently as possible.
Some concerns for the rider may be
Matching with drivers
Minimizing waiting time waiting to be matched and waiting for the driver to arrive
Ease of pick-up and drop-off (ie. Driver coming from the opposite side of t"See full answer
"Since the problem asks for a O(logN) solution, I have to assume that the numbers are already sorted, meaning the same number are adjacent to each other, the value of the numbers shouldn't matter, and they expect us to use Binary Search.
First, we should analyze the pattern of a regular number array without a single disrupter.
Index: 0 1 2 3 4. 5 6. 7. 8. 9
Array:[1, 1, 2, 2, 4, 4, 5, 5, 6, 6]
notice the odd indexes are always referencing the second of the reoccurring numbers and t"
Bamboo Y. - "Since the problem asks for a O(logN) solution, I have to assume that the numbers are already sorted, meaning the same number are adjacent to each other, the value of the numbers shouldn't matter, and they expect us to use Binary Search.
First, we should analyze the pattern of a regular number array without a single disrupter.
Index: 0 1 2 3 4. 5 6. 7. 8. 9
Array:[1, 1, 2, 2, 4, 4, 5, 5, 6, 6]
notice the odd indexes are always referencing the second of the reoccurring numbers and t"See full answer
Software Engineer
Coding
🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.
"Form what I know I would state the following two points:
Only 20% of google's $180B revenue comes from non-ad revenue sources. Google Cloud is a big part of Google's revenue diversification efforts. Google cloud at $13B is still under 10% of total revenue.
Google cloud is at position 3 compared after Amazon AWS and Microsoft Azure. Typically only top 2 platforms take majority of stake in a lot of businesses.
Google Cloud's Goal: Become one of the top two Cloud platforms in the world by deep"
Venkateswara reddy K. - "Form what I know I would state the following two points:
Only 20% of google's $180B revenue comes from non-ad revenue sources. Google Cloud is a big part of Google's revenue diversification efforts. Google cloud at $13B is still under 10% of total revenue.
Google cloud is at position 3 compared after Amazon AWS and Microsoft Azure. Typically only top 2 platforms take majority of stake in a lot of businesses.
Google Cloud's Goal: Become one of the top two Cloud platforms in the world by deep"See full answer
"I am not sure if I agree with the approach taken in the mock video. Should FB build a tablet? is not the same as "Design FB tablet." This is an analytical decision question, not a design question. I would have done strategic analysis using Porter's five forces or maybe SWOT and value chain analysis to decide rather than designing a product.
My answer will be to examine critical factors to decide to build tablet vs. to build apps for existing non-FB tablets (ipads and android tablets)
Users"
Ammro H. - "I am not sure if I agree with the approach taken in the mock video. Should FB build a tablet? is not the same as "Design FB tablet." This is an analytical decision question, not a design question. I would have done strategic analysis using Porter's five forces or maybe SWOT and value chain analysis to decide rather than designing a product.
My answer will be to examine critical factors to decide to build tablet vs. to build apps for existing non-FB tablets (ipads and android tablets)
Users"See full answer
"Define: What is the Verified Badge Product?
The Meta verified badge is a product displayed alongside a verified user’s profile across all Meta platforms.
Mission: Why Build the Verified Badge Product?
Trust and Authenticity: Meta's primary reason for introducing a Verified Badge is to enhance trust and authenticity across the platform. By confirming the identities of key figures and influencers, Meta can assure users that their interactions are with genuine profiles, no"
realkimchi - "Define: What is the Verified Badge Product?
The Meta verified badge is a product displayed alongside a verified user’s profile across all Meta platforms.
Mission: Why Build the Verified Badge Product?
Trust and Authenticity: Meta's primary reason for introducing a Verified Badge is to enhance trust and authenticity across the platform. By confirming the identities of key figures and influencers, Meta can assure users that their interactions are with genuine profiles, no"See full answer
"When are you talking about Sales
Is the Number of Items that have dropped or GMV dropped ?
If the GMV has dropped then clearly there is a drop in the Price of Items ? Is there any category or White Goods which have lead to decrease in the Price of Goods ?
Is there a Long Term Promotion running By the Marketing and not because of it ?
A customer Journey in a typical Market Place is that customer adds items to car
Go To E-Commerce Site -----> Search--->Add Items to Bag"
Akshai V. - "When are you talking about Sales
Is the Number of Items that have dropped or GMV dropped ?
If the GMV has dropped then clearly there is a drop in the Price of Items ? Is there any category or White Goods which have lead to decrease in the Price of Goods ?
Is there a Long Term Promotion running By the Marketing and not because of it ?
A customer Journey in a typical Market Place is that customer adds items to car
Go To E-Commerce Site -----> Search--->Add Items to Bag"See full answer
"I would start off by talking about the goals of this feature.
What's the goal of Instagram with blue check marks? What does it aim to achieve? For the purpose of this question, I am assuming that Instagram wants to verify celebrities/famous people/brands as the original profile that differentiates them from fake profiles or other fan groups. It's also to develop trust and credibility amongst Instagram users.
The mission of Facebook is to connect people across the globe. Instagram, which is a p"
Anonymous Shrimp - "I would start off by talking about the goals of this feature.
What's the goal of Instagram with blue check marks? What does it aim to achieve? For the purpose of this question, I am assuming that Instagram wants to verify celebrities/famous people/brands as the original profile that differentiates them from fake profiles or other fan groups. It's also to develop trust and credibility amongst Instagram users.
The mission of Facebook is to connect people across the globe. Instagram, which is a p"See full answer
"One of the biggest risks I have taken was in a recent product, where we developed a new feature and released the feature externally without QA sign-off.
Feature - Interactive Travel Itinerary Maps
We had about ten days from the time we decided to include this new feature in the external launch. Usually, the biggest chunk of time in each release cycle was the sign-off from an external QA team. We fast-tracked the dev effort and completed the development of the feature in five days. Unfortunately,"
R S. - "One of the biggest risks I have taken was in a recent product, where we developed a new feature and released the feature externally without QA sign-off.
Feature - Interactive Travel Itinerary Maps
We had about ten days from the time we decided to include this new feature in the external launch. Usually, the biggest chunk of time in each release cycle was the sign-off from an external QA team. We fast-tracked the dev effort and completed the development of the feature in five days. Unfortunately,"See full answer
"Video has audio disruption starting at ~7th minute, did not understand what law he was talking about. Can someone please clarify?"
Ushita S. - "Video has audio disruption starting at ~7th minute, did not understand what law he was talking about. Can someone please clarify?"See full answer
"Clarify the question. Any specific system?
Will study the related systems in the environment.
Will define the goal, attributes of the system, stakeholders expectations, problems this system is going to address in case these things don't exist already.
With the above two steps, I Will come up with a draft of the System KPI.
Will run it with leadership, stakeholders and will incorporate feedback.
In parallel, will come up with quantification on these performance factors.
Fina"
Anonymous Krill - "Clarify the question. Any specific system?
Will study the related systems in the environment.
Will define the goal, attributes of the system, stakeholders expectations, problems this system is going to address in case these things don't exist already.
With the above two steps, I Will come up with a draft of the System KPI.
Will run it with leadership, stakeholders and will incorporate feedback.
In parallel, will come up with quantification on these performance factors.
Fina"See full answer
"Mission: Tiktok's mission is to inspire creativity and Joy.
Any business wants to make sure that they are serving the value to their customers:
For TikTok customers are:
Viewers 2. Content Creators 3. Advertisers
So few metrics we could measure are:
Time spent/day
Total no of videos created/day
engagement rate = users who interacted in one of the meaningful action on Tiktok / total users at a day level
either likes, share, watched vide for at least 5 mins, created video
"
Nikita B. - "Mission: Tiktok's mission is to inspire creativity and Joy.
Any business wants to make sure that they are serving the value to their customers:
For TikTok customers are:
Viewers 2. Content Creators 3. Advertisers
So few metrics we could measure are:
Time spent/day
Total no of videos created/day
engagement rate = users who interacted in one of the meaningful action on Tiktok / total users at a day level
either likes, share, watched vide for at least 5 mins, created video
"See full answer
"C : Okay. So I would want to start with knowing what is the product for which we have to build a recommendation system.
I : This is a photo sharing product.
C : Okay. So is this something on the lines of Instagram?
I : Yes
C : Okay. And are we a new product co or we have some current product built already?
I : You can assume yourself.
C : Okay. Is there any demography or country we are targeting?
I : No, this is a global product
C : Okay. So, the biggest goal of any product recommendation system"
Kartikeya N. - "C : Okay. So I would want to start with knowing what is the product for which we have to build a recommendation system.
I : This is a photo sharing product.
C : Okay. So is this something on the lines of Instagram?
I : Yes
C : Okay. And are we a new product co or we have some current product built already?
I : You can assume yourself.
C : Okay. Is there any demography or country we are targeting?
I : No, this is a global product
C : Okay. So, the biggest goal of any product recommendation system"See full answer
"Clarifying
Travellers in this context are people who are taking domestic or international flights. Answer: Correct.
Are we designing to integrate into an existing product line or completely standalone? Answer: Integrate into existing products.
Are we designing for a specific geography? Answer: Let’s try North America first; we can expand later.
Company Mission
Organize the world’s information and make it universally accessible and useful.
Company Strategy
"
Darpan D. - "Clarifying
Travellers in this context are people who are taking domestic or international flights. Answer: Correct.
Are we designing to integrate into an existing product line or completely standalone? Answer: Integrate into existing products.
Are we designing for a specific geography? Answer: Let’s try North America first; we can expand later.
Company Mission
Organize the world’s information and make it universally accessible and useful.
Company Strategy
"See full answer