Three multiple-choice questions and two coding questions on HackerRank, with no camera required.
Multiple-choice questions
Time Complexity
for (int i = 0; i < n; i++) { for (int j = 0; j < i
i; j++) { for (int k = i; ~k; k -= 1) { temp++; } } }
Hash There are 7 computers in a network (numbered from 0 to 6). Each network request is assigned to one of those computers. Hash function used for that is: H(id) = id % 7 Which computer will have maximum load if the request ids are...
A retrieval augmented generation, i.e., RAG-based chatbot, assists doctors in diagnosing rare diseases. Factual accuracy and consistency are paramount, but traditional RAG metrics like signal-to-noise ratio and recall might be insufficient. Which two of the following approaches best address the challenges in evaluating the RAG pipeline in this domain? Pick ONE or MORE options: Develop a domain-specific metric that quantifies the coherence and plausibility of diagnoses within the context of medical knowledge graphs. Implement a hybrid evaluation system combining traditional RAG metrics with human-in-the-loop reviews from medical experts to assess factual accuracy and potential biases. Leverage active learning where user feedback on generated diagnoses continuously refines the RAG pipeline, focusing on improving specificity and reducing false positives for rare diseases. Utilize similarity-based metrics such as ROUGE score to assess the relevance of the generated output.
Solutions Engineering – Star Sum Given an integer k and graph G with g_nodes nodes and g_edges edges, find a star-graph. The value of a node i is given by values[i]. A k-star is defined as a non-empty subgraph of G that is a star-graph and has at most k arms. A k-star graph with k given as 3, 4, 5, and 6 respectively, would look like this: [image of star graphs] The goal is to return the sum of a k-star with the largest sum among all k-stars.
Function Description
Complete the function bestSumKStar in the editor below.
The function has the following parameter(s):
int g_nodes: the number of nodes in the graph.
int g_from[g_edges]: each g_from[i] denotes the first endpoint of the i-th edge in the graph.
int g_to[g_edges]: each g_to[i] denotes the second endpoint of the i-th edge in the graph.
int values[g_nodes]: each values[i] denotes the value assigned to node i.
int k: the maximum number of arms in a star we are looking for.
Constraints
2 ≤ g_nodes ≤ 10^5
1 ≤ g_edges ≤ 10^5
0 ≤ g_from, g_to ≤ n - 1
0 ≤ k ≤ 10^5
-10^3 ≤ values[i] ≤ 10^3, where 0 ≤ i < g_nodes
The graph does not contain any self-loops.
The graph contains at most a single edge between a pair of vertices.
5. I forgot this one, but it was very simple. Basically, detect duplicate messages within a specified time window and drop them.
Discussion
Loading comments…