"-- Write your query here
select
id,
(case
when p_id is null then 'Root'
when pid in (select id from treenode_table)
and id in (select pid from treenode_table) then 'Inner'
else 'Leaf' end) as node_types
from treenodetable
order by 1;
`"
Anonymous Roadrunner - "-- Write your query here
select
id,
(case
when p_id is null then 'Root'
when pid in (select id from treenode_table)
and id in (select pid from treenode_table) then 'Inner'
else 'Leaf' end) as node_types
from treenodetable
order by 1;
`"See full answer
"We'll consider cost-effectiveness, environmental impact, convenience, and scalability. Here are key metrics and trade-offs to consider:
Cost Metrics
Operational Costs: Compare the direct costs associated with operating each mode of transit, including vehicle maintenance, fuel or energy, and driver salaries.
Subsidization Level: Assess how much subsidy each option requires per ride or per passenger to remain free or low-cost to employees.
Cost Efficiency: Analyze the cost p"
Siddhant S. - "We'll consider cost-effectiveness, environmental impact, convenience, and scalability. Here are key metrics and trade-offs to consider:
Cost Metrics
Operational Costs: Compare the direct costs associated with operating each mode of transit, including vehicle maintenance, fuel or energy, and driver salaries.
Subsidization Level: Assess how much subsidy each option requires per ride or per passenger to remain free or low-cost to employees.
Cost Efficiency: Analyze the cost p"See full answer
"WITH filtered_posts AS (
SELECT
p.user_id,
p.issuccessfulpost
FROM
post p
WHERE
p.postdate >= '2023-11-01' AND p.postdate < '2023-12-01'
),
post_summary AS (
SELECT
pu.user_type,
COUNT(*) AS post_attempt,
SUM(CASE WHEN fp.issuccessfulpost = 1 THEN 1 ELSE 0 END) AS post_success
FROM
filtered_posts fp
JOIN
postuser pu ON fp.userid = pu.user_id
GROUP BY
pu.user_type
)
SELECT
user_type,
post_success,
post_attempt,
CAST(postsuccess AS FLOAT) / postattempt AS postsuccessrate
FROM
po"
David I. - "WITH filtered_posts AS (
SELECT
p.user_id,
p.issuccessfulpost
FROM
post p
WHERE
p.postdate >= '2023-11-01' AND p.postdate < '2023-12-01'
),
post_summary AS (
SELECT
pu.user_type,
COUNT(*) AS post_attempt,
SUM(CASE WHEN fp.issuccessfulpost = 1 THEN 1 ELSE 0 END) AS post_success
FROM
filtered_posts fp
JOIN
postuser pu ON fp.userid = pu.user_id
GROUP BY
pu.user_type
)
SELECT
user_type,
post_success,
post_attempt,
CAST(postsuccess AS FLOAT) / postattempt AS postsuccessrate
FROM
po"See full answer
"Some follow-up questions to correctly understand what "improve" means here?
Is it to have:
more riders,
better user experience,
monetization,
more/new market penetration.
Let's assume interviewer requested to choose whatever I prefer.
I choose better user experience which might trigger other areas of improvement as well.
Some more probing questions:
To I need to consider USA only or any other country/region or global?
Can I consider only popular on demand taxi service for this question?
One wa"
Manohar A. - "Some follow-up questions to correctly understand what "improve" means here?
Is it to have:
more riders,
better user experience,
monetization,
more/new market penetration.
Let's assume interviewer requested to choose whatever I prefer.
I choose better user experience which might trigger other areas of improvement as well.
Some more probing questions:
To I need to consider USA only or any other country/region or global?
Can I consider only popular on demand taxi service for this question?
One wa"See full answer
"Understanding the problem:
What do we mean by email notification experience here? Is it the quantity of notifications or quality?- it's the quality of the experience i.e. how can we make the experience better & more user centric
How would you define enhance in this context?- here enhacement means improving the engagement with the emails resulting in more people viewing the photo/s on FB with email as source
Are we supposed to enhance the viewer's experience only or the creators as w"
Debajyoti B. - "Understanding the problem:
What do we mean by email notification experience here? Is it the quantity of notifications or quality?- it's the quality of the experience i.e. how can we make the experience better & more user centric
How would you define enhance in this context?- here enhacement means improving the engagement with the emails resulting in more people viewing the photo/s on FB with email as source
Are we supposed to enhance the viewer's experience only or the creators as w"See full answer
"I would like to speak loud to narrow the scope of this question so I can be effective in identifying a solution to the problem on hand. Hope that is OK.
You mentioned, “Re-design the airport experience”. Is there a goal for this re-design exercise? Some top goals that come to my mind are the following. Please guide me so I can set it and we can proceed from there.
“Increase the number of passengers who travel to and from this airport”
“Improve customer satisfaction”
**“Get in"
Tara J. - "I would like to speak loud to narrow the scope of this question so I can be effective in identifying a solution to the problem on hand. Hope that is OK.
You mentioned, “Re-design the airport experience”. Is there a goal for this re-design exercise? Some top goals that come to my mind are the following. Please guide me so I can set it and we can proceed from there.
“Increase the number of passengers who travel to and from this airport”
“Improve customer satisfaction”
**“Get in"See full answer
"Clarifying question: may I assume that this would be for all new units that Roku would be selling? Ie. they wouldn't be sending new remotes to existing Roku customers? (assume interviewer agrees)
Here's how I would approach this analysis:
Identify purpose and value of this button for customers
Identify the purpose and value for HBO/Max and Roku
Posit: HBO should be willing to pay up to the value that HBO/Max gets minus potential discount by Roku for the value that Roku would get
Pre"
Anonymous Sparrow - "Clarifying question: may I assume that this would be for all new units that Roku would be selling? Ie. they wouldn't be sending new remotes to existing Roku customers? (assume interviewer agrees)
Here's how I would approach this analysis:
Identify purpose and value of this button for customers
Identify the purpose and value for HBO/Max and Roku
Posit: HBO should be willing to pay up to the value that HBO/Max gets minus potential discount by Roku for the value that Roku would get
Pre"See full answer
"Precision - Out of all the things we picked as correct, how many were actually correct?
recall - Out of all the things that were truly correct, how many did we actually find?"
Vineet M. - "Precision - Out of all the things we picked as correct, how many were actually correct?
recall - Out of all the things that were truly correct, how many did we actually find?"See full answer
"Overall a very good summary of ranking problems.
I wish there are more details in the post on depth of modeling. One can talk more about advance ML architectures like DCN, BertRec etc"
Kapil D. - "Overall a very good summary of ranking problems.
I wish there are more details in the post on depth of modeling. One can talk more about advance ML architectures like DCN, BertRec etc"See full answer
"Clarifying questions
Scope: Just Reels in Facebook, or Instagram too? Mobile and desktop?
Goal: Any specific goal we know of or up to me to decide?
Framework/Overview
Strategy
Metric options with pros/cons
North Star Metric (NSM)
Risks & countermetrics
Strategy / The Why: we want to give people …
Meta: the power to build community + Bring people closer together
Reels: new form of self-expression / entertainment with short form video and pro editing tools
Ads in Re"
Mike Z. - "Clarifying questions
Scope: Just Reels in Facebook, or Instagram too? Mobile and desktop?
Goal: Any specific goal we know of or up to me to decide?
Framework/Overview
Strategy
Metric options with pros/cons
North Star Metric (NSM)
Risks & countermetrics
Strategy / The Why: we want to give people …
Meta: the power to build community + Bring people closer together
Reels: new form of self-expression / entertainment with short form video and pro editing tools
Ads in Re"See full answer
"Assumptions and Clarifications!
1 . What is the aim? increase monetization or to just provide easy accessible food for customers
2.What are the supposed items to be available in the vending machines?
3.How many Vending Machines per hotel if more than 1 Can we add different items in the machines or are they supposed to be similar?
4.Which company is looking to Design this machine?Is it google? Or some other company?
5.These machines should they be available to paying guests or visitors or bot"
Prabhav G. - "Assumptions and Clarifications!
1 . What is the aim? increase monetization or to just provide easy accessible food for customers
2.What are the supposed items to be available in the vending machines?
3.How many Vending Machines per hotel if more than 1 Can we add different items in the machines or are they supposed to be similar?
4.Which company is looking to Design this machine?Is it google? Or some other company?
5.These machines should they be available to paying guests or visitors or bot"See full answer
"Clarifying Questions
Is the product a digital or physical marketplace? (Digital)
Are we building an educational platform, freelance platform, or marketplace? (Freelance platform)
Are we focusing on a specific geographical location? (India)
Will the platform involve online transactions? (Yes)
User Personas
Individual Gardeners: Self-employed gardeners offering their services.
Gardening Agencies: Organizations providing gardening services.
**Educational Institutio"
Preetham m P. - "Clarifying Questions
Is the product a digital or physical marketplace? (Digital)
Are we building an educational platform, freelance platform, or marketplace? (Freelance platform)
Are we focusing on a specific geographical location? (India)
Will the platform involve online transactions? (Yes)
User Personas
Individual Gardeners: Self-employed gardeners offering their services.
Gardening Agencies: Organizations providing gardening services.
**Educational Institutio"See full answer
"The addition of an intermediate "sanitization" ML is something Neeraj used in the Uber Eats design and again seems kind of outside the scope here and redundant. This can simply be built into the AI response model to save a step. It's not clear what benefit this step provides, and he basically said we should have it "just because it would be good" and there's no concrete reasoning why to include it.
Adding a Kafka queue to handle the thumbs-down ratings? For what purpose do you need a queue othe"
Robert H. - "The addition of an intermediate "sanitization" ML is something Neeraj used in the Uber Eats design and again seems kind of outside the scope here and redundant. This can simply be built into the AI response model to save a step. It's not clear what benefit this step provides, and he basically said we should have it "just because it would be good" and there's no concrete reasoning why to include it.
Adding a Kafka queue to handle the thumbs-down ratings? For what purpose do you need a queue othe"See full answer
"Assumptions:
We're looking only at a single large dealership in San Jose, per the question, not all large car dealerships
New cars already come with tires; the dealer does not have to purchase them separately
A couple of different ways I might approach this:
Approach 1: Estimate based on # cars serviced per day
Dealer intakes 10 cars for servicing per hour (based on anecdotal observation)
100 cars serviced per day (assuming service dept. open 10 hours per day)
Cars that need onl"
Andrew B. - "Assumptions:
We're looking only at a single large dealership in San Jose, per the question, not all large car dealerships
New cars already come with tires; the dealer does not have to purchase them separately
A couple of different ways I might approach this:
Approach 1: Estimate based on # cars serviced per day
Dealer intakes 10 cars for servicing per hour (based on anecdotal observation)
100 cars serviced per day (assuming service dept. open 10 hours per day)
Cars that need onl"See full answer
"Clarifying questions:
What city/ country are we talking about?
Indian metro.
What all counts as a grocery store? Do have to cover dark stores as well which are not open to public?
Only consider all grocery stores where public pick up is allowed.
Do we have to include hyper markets/ super markets as well or only smaller stores?
Include both.
Okay, so I would be considering the Indian metro of Bangalore here.
The overall equation is , **total number of grocery stores = Number of small grocer"
Kartikeya N. - "Clarifying questions:
What city/ country are we talking about?
Indian metro.
What all counts as a grocery store? Do have to cover dark stores as well which are not open to public?
Only consider all grocery stores where public pick up is allowed.
Do we have to include hyper markets/ super markets as well or only smaller stores?
Include both.
Okay, so I would be considering the Indian metro of Bangalore here.
The overall equation is , **total number of grocery stores = Number of small grocer"See full answer