"function findPrimes(n) {
if (n < 2) return [];
const primes = [];
for (let i=2; i <= n; i++) {
const half = Math.floor(i/2);
let isPrime = true;
for (let prime of primes) {
if (i % prime === 0) {
isPrime = false;
break;
}
}
if (isPrime) {
primes.push(i);
}
}
return primes;
}
`"
Tiago R. - "function findPrimes(n) {
if (n < 2) return [];
const primes = [];
for (let i=2; i <= n; i++) {
const half = Math.floor(i/2);
let isPrime = true;
for (let prime of primes) {
if (i % prime === 0) {
isPrime = false;
break;
}
}
if (isPrime) {
primes.push(i);
}
}
return primes;
}
`"See full answer
"
with youngsuccrate as(
select
strftime('%m', postdate) AS postmonth,
round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as yascrate
from
post
where
userid in (select userid from post_user where age between 0 and 18)
group by
post_month
),
nonyoungsucc_rate as(
select
strftime('%m', postdate) AS postmonth,
round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as nonyasc_rate
from
post
where
user_id in (select"
Bhavna S. - "
with youngsuccrate as(
select
strftime('%m', postdate) AS postmonth,
round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as yascrate
from
post
where
userid in (select userid from post_user where age between 0 and 18)
group by
post_month
),
nonyoungsucc_rate as(
select
strftime('%m', postdate) AS postmonth,
round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as nonyasc_rate
from
post
where
user_id in (select"See full answer
"I'm pretty sure Exponent's answer is wrong.
In the snippet below, they use "pl.name = 'Telephones' to attempt to filter down to the Telephone transactions, but they do this within a LEFT JOIN which means all product_lines rows are returned.
> LEFT JOIN product_lines pl
> ON p.productlineid = pl.id
> AND pl.name = 'Telephones'
Below is my solution. Also, I didn't see anywhere that said the "amount" column was in cents instead of dollars, but I still divided by 100 to be consistent with Exp"
Bradley E. - "I'm pretty sure Exponent's answer is wrong.
In the snippet below, they use "pl.name = 'Telephones' to attempt to filter down to the Telephone transactions, but they do this within a LEFT JOIN which means all product_lines rows are returned.
> LEFT JOIN product_lines pl
> ON p.productlineid = pl.id
> AND pl.name = 'Telephones'
Below is my solution. Also, I didn't see anywhere that said the "amount" column was in cents instead of dollars, but I still divided by 100 to be consistent with Exp"See full answer
"I might be missing something but the solution, seems to be incorrect.
...
, post_pairings AS (
SELECT
ps.user_id,
ps.postseqid AS failpostid,
ps.postseqid + 1 AS nextpostid
FROM post_seq AS ps
WHERE ps.issuccessfulpost IS TRUE
)
-- here ps.issuccessfulpost IS TRUE the condition should be FALSE
-- in that way ps.postseqid is the actual failed post(failpostid)
-- Additionally, at the end the join is assumming that the sequence id is going to match the post_id, wh"
Jaime A. - "I might be missing something but the solution, seems to be incorrect.
...
, post_pairings AS (
SELECT
ps.user_id,
ps.postseqid AS failpostid,
ps.postseqid + 1 AS nextpostid
FROM post_seq AS ps
WHERE ps.issuccessfulpost IS TRUE
)
-- here ps.issuccessfulpost IS TRUE the condition should be FALSE
-- in that way ps.postseqid is the actual failed post(failpostid)
-- Additionally, at the end the join is assumming that the sequence id is going to match the post_id, wh"See full answer
"I'll approach this by asking questions and creating scenarios based on answers. If the answer to any questions points to a specific issue, I'll double down on that to understand the issue. This is more of a RCA question.
First I'll quickly check
Were there any recent updates released before we observed the drops?
Assuming Yes, I'll check the updates released and check the test cases and testing results
If the issue is identified, I will engage with the product leadership, update them and conne"
Aekagra S. - "I'll approach this by asking questions and creating scenarios based on answers. If the answer to any questions points to a specific issue, I'll double down on that to understand the issue. This is more of a RCA question.
First I'll quickly check
Were there any recent updates released before we observed the drops?
Assuming Yes, I'll check the updates released and check the test cases and testing results
If the issue is identified, I will engage with the product leadership, update them and conne"See full answer
"Select
interface,
Count(case when issuccessfulpost then 1 end) as post_success,
Count() as postattempt,
ROUND((COUNT(CASE WHEN issuccessfulpost THEN 1 END) * 100 / COUNT()), 2) AS postsuccess_rate
from post where interface like 'Iphone%'
group by 1
order by postsuccessrate desc
`"
Richard B. - "Select
interface,
Count(case when issuccessfulpost then 1 end) as post_success,
Count() as postattempt,
ROUND((COUNT(CASE WHEN issuccessfulpost THEN 1 END) * 100 / COUNT()), 2) AS postsuccess_rate
from post where interface like 'Iphone%'
group by 1
order by postsuccessrate desc
`"See full answer
"I responded with a project that I was a part of during my capstone class. I described how I used HTML, Python, and PostGRESQL in conjunction to create a functioning website using SCRUM."
Kanishkan V. - "I responded with a project that I was a part of during my capstone class. I described how I used HTML, Python, and PostGRESQL in conjunction to create a functioning website using SCRUM."See full answer
"A/B testing is used when one wishes to only test minor front-end changes on the website.
Consider a scenario where an organization wishes to make significant changes to its existing page, such as wants to create an entirely new version of an existing web page URL and wants to analyze which one performs better. Obviously, the organization will not be willing to touch the existing web page design for comparison purposes.
In the above scenario, performing Split URL testing would be beneficial. T"
Sangeeta P. - "A/B testing is used when one wishes to only test minor front-end changes on the website.
Consider a scenario where an organization wishes to make significant changes to its existing page, such as wants to create an entirely new version of an existing web page URL and wants to analyze which one performs better. Obviously, the organization will not be willing to touch the existing web page design for comparison purposes.
In the above scenario, performing Split URL testing would be beneficial. T"See full answer
"from typing import List
def two_sum(nums: List[int], target: int) -> List[int]:
prevMap = {}
for i, n in enumerate(nums):
diff = target - n
if diff in prevMap:
return [prevMap[diff], i]
else:
prevMap[n] = i
return []
debug your code below
print(two_sum([2, 7, 11, 15], 9))
`"
Anonymous Roadrunner - "from typing import List
def two_sum(nums: List[int], target: int) -> List[int]:
prevMap = {}
for i, n in enumerate(nums):
diff = target - n
if diff in prevMap:
return [prevMap[diff], i]
else:
prevMap[n] = i
return []
debug your code below
print(two_sum([2, 7, 11, 15], 9))
`"See full answer
"with my_table as (select *
, rownumber() over(order by customerid) as row_index
from customers)
select
customer_id,
customer_name
from my_table
where row_index % 3 = 0"
Marcos G. - "with my_table as (select *
, rownumber() over(order by customerid) as row_index
from customers)
select
customer_id,
customer_name
from my_table
where row_index % 3 = 0"See full answer
"WITH high_score AS(
SELECT
player_id,
MAX(gamescore) AS maxscore
FROM scores
GROUP BY player_id
),
rankings AS(
SELECT
p.player_name,
p.team_id,
max_score,
DENSERANK() OVER(PARTITION BY p.teamid ORDER BY h.maxscore DESC) AS scorerank
FROM high_score AS h
JOIN players AS p
USING(player_id)
)
SELECT
team_id,
player_name,
max_score
FROM rankings
WHERE score_rank <= 2
GROUP BY teamid, playername
O"
Alvin P. - "WITH high_score AS(
SELECT
player_id,
MAX(gamescore) AS maxscore
FROM scores
GROUP BY player_id
),
rankings AS(
SELECT
p.player_name,
p.team_id,
max_score,
DENSERANK() OVER(PARTITION BY p.teamid ORDER BY h.maxscore DESC) AS scorerank
FROM high_score AS h
JOIN players AS p
USING(player_id)
)
SELECT
team_id,
player_name,
max_score
FROM rankings
WHERE score_rank <= 2
GROUP BY teamid, playername
O"See full answer