"It depends on the size of the dataset. You want enough samples in both the testing, training and evaluation sets. If there is enough data, 70/20/10 is a good split"
Jasmine Y. - "It depends on the size of the dataset. You want enough samples in both the testing, training and evaluation sets. If there is enough data, 70/20/10 is a good split"See full answer
"def validateIP(ip):
"""
@param ip: str
@return: bool
"""
\# ip needs to be in X.X.X.X
\# X is from 0 to 255
\# split the ip at "."
split = ip.split('.')
if (len(split) != 4):
return False
for number in split:
if (int(number) 255):
return False
return True"
Anonymous Owl - "def validateIP(ip):
"""
@param ip: str
@return: bool
"""
\# ip needs to be in X.X.X.X
\# X is from 0 to 255
\# split the ip at "."
split = ip.split('.')
if (len(split) != 4):
return False
for number in split:
if (int(number) 255):
return False
return True"See full answer
"Yes, I need to compare the first half of the first string with the reverse order of the second half of the second string. Repeat this process to the first half of the second string and the second half of the first string."
Anonymous Condor - "Yes, I need to compare the first half of the first string with the reverse order of the second half of the second string. Repeat this process to the first half of the second string and the second half of the first string."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
"public static void sortBinaryArray(int[] array) {
int len = array.length;
int[] res = new int[len];
int r=len-1;
for (int value : array) {
if(value==1){
res[r]= 1;
r--;
}
}
System.out.println(Arrays.toString(res));
}
`"
Nitin P. - "public static void sortBinaryArray(int[] array) {
int len = array.length;
int[] res = new int[len];
int r=len-1;
for (int value : array) {
if(value==1){
res[r]= 1;
r--;
}
}
System.out.println(Arrays.toString(res));
}
`"See full answer
"-- Write your query here
With base as(
select
player_name
, team_id
, max(scores.gamescore) as gamescore
from players
join scores on players.playerid = scores.playerid
group by playername, teamid)
Select team_id
, player_name
, game_score
from (
Select teamid , playername ,gamescore, DenseRank() Over (Partition by teamid order by gamescore desc ) as rnk
from base) a where rnk <=2
`"
Palak S. - "-- Write your query here
With base as(
select
player_name
, team_id
, max(scores.gamescore) as gamescore
from players
join scores on players.playerid = scores.playerid
group by playername, teamid)
Select team_id
, player_name
, game_score
from (
Select teamid , playername ,gamescore, DenseRank() Over (Partition by teamid order by gamescore desc ) as rnk
from base) a where rnk <=2
`"See full answer
"Use an index, two pointers, and a set to keep track of elements that you've seen.
pseudo code follows:
for i, elem in enumerate(array):
if elem in set return False
if i > N:
set.remove(array[i-N])"
Michael B. - "Use an index, two pointers, and a set to keep track of elements that you've seen.
pseudo code follows:
for i, elem in enumerate(array):
if elem in set return False
if i > N:
set.remove(array[i-N])"See full answer
"While running the testloop I am getting an error RuntimeError: runningmean should contain 28 elements not 38.
I think it's the difference between the categorical features in train and test.
`"
Abinash S. - "While running the testloop I am getting an error RuntimeError: runningmean should contain 28 elements not 38.
I think it's the difference between the categorical features in train and test.
`"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
"Was given 90 minutes with an exhaustive set of requirements to be implemented as a full-stack coding exercise. It was supposed to have a UX, a server and a database to store and retrieve data.
The IDE was supposed to be self-setup before the interview.
The panel asked questions on top of the implementation around decision making from a technical perspective"
Aman G. - "Was given 90 minutes with an exhaustive set of requirements to be implemented as a full-stack coding exercise. It was supposed to have a UX, a server and a database to store and retrieve data.
The IDE was supposed to be self-setup before the interview.
The panel asked questions on top of the implementation around decision making from a technical perspective"See full answer
"Problem Statement: The Fibonacci sequence is defined as F(n) = F(n-1) + F(n-2) with F(0) = 1 and F(1) = 1.
The solution is given in the problem statement itself.
If the value of n = 0, return 1.
If the value of n = 1, return 1.
Otherwise, return the sum of data at (n - 1) and (n - 2).
Explanation: The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, typically starting with 0 and 1.
Java Solution:
public static int fib(int n"
Rishi G. - "Problem Statement: The Fibonacci sequence is defined as F(n) = F(n-1) + F(n-2) with F(0) = 1 and F(1) = 1.
The solution is given in the problem statement itself.
If the value of n = 0, return 1.
If the value of n = 1, return 1.
Otherwise, return the sum of data at (n - 1) and (n - 2).
Explanation: The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, typically starting with 0 and 1.
Java Solution:
public static int fib(int n"See full answer
"Here is my first shot at it. Please excuse formatting.
To find the maximum depth of the dependencies given a list of nodes, each having a unique string id and a list of subnodes it depends on, you can perform a depth-first search (DFS) to traverse the dependency graph. Here's how you can implement this:
Represent the nodes and their dependencies using a dictionary.
Perform a DFS on each node to find the maximum depth of the dependencies.
Keep track of the maximum depth encountered dur"
Tes d H. - "Here is my first shot at it. Please excuse formatting.
To find the maximum depth of the dependencies given a list of nodes, each having a unique string id and a list of subnodes it depends on, you can perform a depth-first search (DFS) to traverse the dependency graph. Here's how you can implement this:
Represent the nodes and their dependencies using a dictionary.
Perform a DFS on each node to find the maximum depth of the dependencies.
Keep track of the maximum depth encountered dur"See full answer
"You are given a string S and a number K as input, and your task is to print S to console output considering that, at most, you can print K characters per line.
Example:
S = "abracadabra sample"
K = 11
Output:
abracadabra
sample
Note that this problem requires the interviewee gather extra requirements from the interviewer (e.g. do we care about multiple white spaces? what if the length of a word is greater than K, ...)"
B. T. - "You are given a string S and a number K as input, and your task is to print S to console output considering that, at most, you can print K characters per line.
Example:
S = "abracadabra sample"
K = 11
Output:
abracadabra
sample
Note that this problem requires the interviewee gather extra requirements from the interviewer (e.g. do we care about multiple white spaces? what if the length of a word is greater than K, ...)"See full answer