"Functional Requirement
Upload the file of any type
POST v1/drive
Upload the another version of file.
POST v1/drive/{fileId}
Delete the file.
DELETE v1/drive/{fileId}
Share the file.
POST v1/drive/{fileId}
Control the access level of the file.
Provide the file accessibility following the directory structure.
Non Functional Requirement
Reliability: The file along with its versions uploaded should be"
Vikash A. - "Functional Requirement
Upload the file of any type
POST v1/drive
Upload the another version of file.
POST v1/drive/{fileId}
Delete the file.
DELETE v1/drive/{fileId}
Share the file.
POST v1/drive/{fileId}
Control the access level of the file.
Provide the file accessibility following the directory structure.
Non Functional Requirement
Reliability: The file along with its versions uploaded should be"See full answer
"Understanding the Basics
Choosing Learning Resources
Practicing and Applying Knowledge
Seeking Help and Staying Updated
Leveraging Modern Tools"
An D. - "Understanding the Basics
Choosing Learning Resources
Practicing and Applying Knowledge
Seeking Help and Staying Updated
Leveraging Modern Tools"See full answer
"First of all, stack and heap memory are abstraction on top of the hardware by the compiler. The hardware is not aware of stack and heap memory. There is only a single piece of memory that a program has access to. The compiler creates the concepts of stack and heap memory to run the programs efficiently.
Programs use stack memory to store local variables and a few important register values such as frame pointer and return address for program counter. This makes it easier for the compiler to gene"
Stanley Y. - "First of all, stack and heap memory are abstraction on top of the hardware by the compiler. The hardware is not aware of stack and heap memory. There is only a single piece of memory that a program has access to. The compiler creates the concepts of stack and heap memory to run the programs efficiently.
Programs use stack memory to store local variables and a few important register values such as frame pointer and return address for program counter. This makes it easier for the compiler to gene"See full answer
Software Engineer
Coding
+2 more
🧠Want an expert answer to a question? Saving questions lets us know what content to make next.
"naive solution:
def countprefixpairs(words):
n = len(words)
count = 0
for i in range(n):
for j in range(i + 1, n):
if words[i].startswith(words[j]) or words[j].startswith(words[i]):
count += 1
return count
using tries for when the list of words is very long:
from collections import Counter
class TrieNode:
def init(self):
self.children = {}
self.count = 0 # To count the number of words ending at this node"
Anonymous Unicorn - "naive solution:
def countprefixpairs(words):
n = len(words)
count = 0
for i in range(n):
for j in range(i + 1, n):
if words[i].startswith(words[j]) or words[j].startswith(words[i]):
count += 1
return count
using tries for when the list of words is very long:
from collections import Counter
class TrieNode:
def init(self):
self.children = {}
self.count = 0 # To count the number of words ending at this node"See full answer
"In 2019, I was given a very important problem to solve. In a team of 3 we had to build a mobility assist device. The customer segment we would go for was something we could decide. The project was very close to me as I had lost someone I loved because of cancer and I saw how reduced mobility was a huge pain point in not being able to do physical activities. My team could only think of elderly people as the main target market.
As the Head of Product what I did was:
1) I helped them dive even d"
Soumya S. - "In 2019, I was given a very important problem to solve. In a team of 3 we had to build a mobility assist device. The customer segment we would go for was something we could decide. The project was very close to me as I had lost someone I loved because of cancer and I saw how reduced mobility was a huge pain point in not being able to do physical activities. My team could only think of elderly people as the main target market.
As the Head of Product what I did was:
1) I helped them dive even d"See full answer
"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
"Without using a recursive approach, one can perform a post-order traversal by removing the parent nodes from the stack only if children were visited:
def diameterOfTree(root):
if root is None:
return 0
diameter = 0
stack = deque([[root, False]]) # (node, visited)
node_heights = {}
while stack:
curr_node, visited = stack[-1]
if visited:
heightleft = nodeheights.get(curr_node.left, 0)
heightright = nodehe"
Gabriele G. - "Without using a recursive approach, one can perform a post-order traversal by removing the parent nodes from the stack only if children were visited:
def diameterOfTree(root):
if root is None:
return 0
diameter = 0
stack = deque([[root, False]]) # (node, visited)
node_heights = {}
while stack:
curr_node, visited = stack[-1]
if visited:
heightleft = nodeheights.get(curr_node.left, 0)
heightright = nodehe"See full answer
"I told a story about how our team was focussed on moving a key metric i.e. NPS and to do that we build 3 top requested user feature. Post release the detractors % didn't move even though the detractors request for features shipped went down. Then I connect with users and did some analysis post which we realised that we need to pivot our focus from shipping features to enabling complete workflows for our users i.e. shipping all those feature which are used together in a feature as then only users"
Aditya S. - "I told a story about how our team was focussed on moving a key metric i.e. NPS and to do that we build 3 top requested user feature. Post release the detractors % didn't move even though the detractors request for features shipped went down. Then I connect with users and did some analysis post which we realised that we need to pivot our focus from shipping features to enabling complete workflows for our users i.e. shipping all those feature which are used together in a feature as then only users"See full answer
"function serialize(list) {
for (let i=0; i 0xFFFF) {
throw new Exception(String ${list[i]} is too long!);
}
const prefix = String.fromCharCode(length);
list[i] = ${prefix}${list[i]};
console.log(list[i])
}
return list.join('');
}
function deserialize(s) {
let i=0;
const length = s.length;
const output = [];
while (i < length) {
"
Tiago R. - "function serialize(list) {
for (let i=0; i 0xFFFF) {
throw new Exception(String ${list[i]} is too long!);
}
const prefix = String.fromCharCode(length);
list[i] = ${prefix}${list[i]};
console.log(list[i])
}
return list.join('');
}
function deserialize(s) {
let i=0;
const length = s.length;
const output = [];
while (i < length) {
"See full answer
"\# Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
self.max_sum = float('-inf')"
Jerry O. - "\# Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
self.max_sum = float('-inf')"See full answer
"Count items between indices within compartments
compartments are delineated by by: '|'
items are identified by: '*'
input_inventory = "*||||"
inputstartidxs = [1, 4, 6]
inputendidxs = [9, 5, 8]
expected_output = [3, 0, 1]
Explanation:
"*||||"
0123456789... indices
++ + # within compartments
^ start_idx = 1
^ end_idx = 9
-- - # within idxs but not within compartments
"*||||"
0123456789... indices
"
Anonymous Unicorn - "Count items between indices within compartments
compartments are delineated by by: '|'
items are identified by: '*'
input_inventory = "*||||"
inputstartidxs = [1, 4, 6]
inputendidxs = [9, 5, 8]
expected_output = [3, 0, 1]
Explanation:
"*||||"
0123456789... indices
++ + # within compartments
^ start_idx = 1
^ end_idx = 9
-- - # within idxs but not within compartments
"*||||"
0123456789... indices
"See full answer