IBM Coding Question – Solved

12 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

| The supply chain manager at one of Amazon's warehouses is shipping the last con… |
| Determine the highest value after executing n steps on an infinite 2D grid that… |
| Amazon Prime Video is developing a new feature called "Segmentify." This featur… |
| In this new stock prediction game launched on Amazon Games, Player 1 provides P… |
| Amazon operates numerous warehouses, with each warehouse holding inventory[i] u… |
| In Amazon's highly efficient logistics network, minimizing operational overhead… |