IBM Coding Question – Solved

5 Live
getQueryAnswers In a machine learning model, there are n data entries stored in the model's output cache cacheEntries. Each entry contains three values: 1. timestamp – when the prediction was made. 2. modelId – the identifier of the machine learning model. 3. predictionValue – the model's output, represented as a string containing an integer. A query handler receives q queries in the form of queries[q][2], where each query consists of: - modelId – identifying the machine learning model. - timestamp – specifying the time at which the prediction was made. Implement a function getQueryAnswers that: - Takes two inputs: - cacheEntries[n][3]: A list of cached predictions. - queries[q][2]: A list of queries. - Returns an array of integers, where each value corresponds to the predictionValue for the given modelId and timestamp.

Asked in: IBM

Image of the Question

Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| Given an n x m grid, where rows are numbered from 7 to n and columns from 1 to … |
| There are 'N' coders standing in a line, where i denotes the ith position of a … |
| A birthday party was attended by N number of kids, and each kid was given a uni… |
| Given a matrix of size m * n, where m denotes the number of rows (starting with… |
| A traveler is traveling from the city of Zeta to Omega. He starts with X amount… |
| As an operations engineer at Amazon, you are responsible for organizing the dis… |