Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 849 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 849 Bytes

Signal Filter Test Assignment

External system generates signals at random intervals. You need to implement Java filter that accepts at most N signals per minute (at any time).

Filter must implement the following interface:

	interface Filter {
		boolean isSignalAllowed();
	}

The following pseudo-code illustrates how your filter could be used:

	Filter frequencyFilter = new YourFilter(N); 
	while (true) {
		Signal signal = waitForSignal();
		if (frequencyFilter.isSignalAllowed()) {
		   process (signal);
		}
	}

Implementation must be efficient and thread-safe. Parameter N can be a immutable for lifetime of the filter. Another example can be found here.

If you have questions don't hesitate to ask.