An image-processing framework manages application objects during one run. It opens sessions A, B, and C in that order, finishing all jobs in one session before opening the next. Their workloads are:
Session
Number of jobs
Jobs requesting a preview
A
3
First and third
B
2
None
C
4
Second and fourth
The framework applies these object-management rules:
There are no pre-existing instances of these four classes, no retries, and no additional instances beyond those specified. Here, an object is live while the framework retains it; garbage-collection timing is irrelevant.
Complete the table with exact integer counts. For each class, distinguish the total number of instances constructed during the run from the maximum number live at any one time.
Unlock full course notes by signing up
Cost of framework-managed exports
A hypothetical image-export framework uses two hook methods, application-supplied operations invoked by its controlling method. It calls eligible once for each of 18 images and calls export once for each image that qualifies. Exactly 11 images qualify. Every call returns normally, with no retries or early stopping.
Each eligible call takes 0.10 ms, each export call takes 0.80 ms, and all remaining framework work takes 1.50 ms in total. Execution is sequential, and these timings include all relevant work without overlap.
Find the number of eligible calls and the number of export calls, each as an exact whole number of calls. Also find the total execution time in ms, to one decimal place.
Customize behavior while preserving the workflow
A reporting framework provides run, which validates a session, invokes a registered exporter's write method, and records completion after a normal return. Validation and completion recording are required for every report. The documentation identifies write as the supported customization point and directs applications to use run as the report entry point.
Which changes follow the documented extension mechanism and preserve the required workflow? Select all that apply. Assume every described write implementation returns normally.
Trace batches that stop early
A message-delivery framework supports early termination: it stops examining a batch once two records have been delivered. Its controlling method is shown below. Each method call returns normally, accept has no side effects, and there are no retries.
The potential accept outcomes in original record order are:
Batch A: false, true, false, true, true.