7

Scenario A: You have a system that solves problem X. Scenario B: You have a system that solves problem X and has to ensure that it is always synchronized with the redundant backup. It is pretty clear that the system in Scenario B has to perform strictly more work than the system in Scenario A, therefore the redundancy has a performance impact. However, note ...


4

I apologize for initially missing the additional requirement aside from just sorting values. I think the requirements are still a bit unclear but based on the code and visual plus some assumptions, think I mostly follow. Essentially each cell has two areas that it can 'dominate': the submatrix where it is the bottom-left cell and the one where it is the top-...


3

I would recommend not to tamper with ID ranges, this becomes overly complicated and makes unjustified assumptions about the ID value ranges or the order in which a users looks at the blog posts. The posts have unique IDs. Store the IDs of the seen posts per user somewhere, maybe in a table "seen_posts". Then use something along the lines of SELECT ...


3

Two simple examples: Adding an index to a database table is a common way to introduce redundancy, with the intention of speeding up read operations on that table. However, if a table is more frequently used for write operations than for read operations, adding an index might slow operations down - each write operation now has to update the index. A second ...


2

The following algorithm recursively computes the result by finding the maximum element in the current matrix, then subdividing in two sub-matrices (just like in Helena's answer) and repeating the same calculation on both sub-matrices. The results are collected in a list, which is sorted at the end. The complexity of finding the maximum value in a matrix is O(...


2

First, as others have pointed out, in general doing more, costs more, so in most cases adding more work results in an increased cost (aka performance reduction). Secondly, you are missing the most important part of that sentence. An always-on service is said to be scalable if adding resources to facilitate redundancy does not result in a loss of performance ...


1

Tracing is usually more than just adding labels. Tracing is a feature of an APM solution that lets you follow a request from its entry point into the system through the entire system. With the APM solutions that I've used, this often involved instrumenting the runtime environment to understand down to individual method calls and the result and performance of ...


1

From your question I understand you like to I want to make sure that the request calls from devices are as randomly distributed so as to make the load on the server as even as possible. So I would start with giving each device the ability to randomly select the time it should contact the server, and not enforcing this on the server side. You like your ...


1

First, whenever you pick one maximum, you remove the whole row containing it, so you cannot ever pick two maxima in the same row, so you can pick at most N values. This means the execution time would be at most O(N^3). Unfortunately, this just improves your estimate, and doesn't do anything to the actual time. Here's what I do: For each row, we start by ...


Only top voted, non community-wiki answers of a minimum length are eligible