CSE 335 MODULE 3 - DATA PERSISTENCE AND LOCAL
STORAGE QUESTIONS WITH ANSWERS AND EXPLANATIONS
Question 1. A feature is being redesigned because Saving and transforming a large local dataset causes
visible frame drops during scrolling. Which approach is most defensible?
A. Move expensive disk I/O and transformation work away from the main UI thread, then publish completed results
safely back to the UI.
B. Create an index on the field or field combination used by the important selective lookup, after measuring the query
pattern.
C. Define expiration, version, event-based invalidation, or revalidation rules that match how quickly the data can
become obsolete.
D. Consider storing a derived or duplicated value with an explicit update policy when the measured read benefit justifies
the consistency cost.
Correct Answer: A. Move expensive disk I/O and transformation work away from the main UI thread, then publish
completed results safely back to the UI.
Explanation: Move expensive disk I/O and transformation work away from the main UI thread, then publish completed results
safely back to the UI. User interaction remains responsive while persistence work proceeds asynchronously.
Question 2. Engineers diagnose the following weakness: Deleting the visible record leaves hidden
caches, exports, and local history with no cleanup rule. Which design idea most directly counters it?
A. Backup and restore policy
B. Data retention and deletion lifecycle
C. Offline write queue
D. Referential integrity
Correct Answer: B. Data retention and deletion lifecycle
Explanation: Data retention and deletion lifecycle is the most direct match. Define retention limits and deletion paths that
remove obsolete local copies, derived caches, and queued artifacts according to policy.
Question 3. After adopting Offline write queue, which validation step best tests the design claim rather
than a different concern?
A. Create divergent edits from the same starting version and verify that synchronization follows the documented conflict
policy.
B. Force both successful and failed server responses and verify that the optimistic state either becomes confirmed or is
correctly reconciled.
C. Save, relaunch, and change each setting independently, verifying that missing keys fall back to documented
defaults.
D. Create offline changes, terminate and relaunch the app, reconnect, and verify that pending operations resume
without duplication.
Correct Answer: D. Create offline changes, terminate and relaunch the app, reconnect, and verify that pending
operations resume without duplication.
Explanation: Create offline changes, terminate and relaunch the app, reconnect, and verify that pending operations resume
without duplication. This directly validates the intended use of Offline write queue; the other checks target different concerns.
,Question 4. A mobile team has this requirement: Sensitive locally stored records must remain unreadable
if the storage file is copied from the device. Which design choice best addresses it?
A. Keep the file in the application sandbox and request broader sharing permissions only when the product requirement
truly needs them.
B. Use the platform security facility intended for credentials or cryptographic secrets rather than ordinary preferences or
source code.
C. Use platform-appropriate encrypted storage or database encryption with keys protected outside the data file itself.
D. Use an object-persistence framework or mapping layer that manages model identity, relationships, fetching, and
persistence lifecycle.
Correct Answer: C. Use platform-appropriate encrypted storage or database encryption with keys protected
outside the data file itself.
Explanation: Use platform-appropriate encrypted storage or database encryption with keys protected outside the data file
itself. Copied persistence files do not reveal plaintext sensitive content without access to the protected key material.
Question 5. A code review finds this problem: UI code manually serializes every object graph and
reconstructs relationships in screen controllers. Which concept most directly addresses the underlying
design issue?
A. Relational database
B. Object persistence mapping
C. Key-value preferences
D. Conflict resolution policy
Correct Answer: B. Object persistence mapping
Explanation: Object persistence mapping is the most direct match. Use an object-persistence framework or mapping layer
that manages model identity, relationships, fetching, and persistence lifecycle.
Question 6. A team chooses Conflict resolution policy because Two devices modify the same logical
record while disconnected and later synchronize. Which outcome best justifies that choice?
A. User work survives process restarts and can be synchronized after connectivity recovers.
B. Concurrent edits are resolved predictably instead of whichever network response arrives last accidentally winning.
C. The interface responds quickly while eventual server outcomes are still handled explicitly.
D. The database stays focused on structured queryable metadata while large sequential file content can use
file-storage semantics.
Correct Answer: B. Concurrent edits are resolved predictably instead of whichever network response arrives last
accidentally winning.
Explanation: Concurrent edits are resolved predictably instead of whichever network response arrives last accidentally
winning. That is the primary value of Conflict resolution policy for the stated requirement.
,Question 7. Which review or test is most tightly aligned with confirming Referential integrity?
A. Inject a failure between the writes and verify that the store contains either the full operation or none of it.
B. Change the underlying records and verify that the denormalized value is updated or invalidated according to the
documented policy.
C. Attempt to insert or delete records that would violate the relationship and verify that the configured integrity rule
behaves as intended.
D. Verify that files are created in the intended app-specific directory and that cache files can be cleared without deleting
durable documents.
Correct Answer: C. Attempt to insert or delete records that would violate the relationship and verify that the
configured integrity rule behaves as intended.
Explanation: Attempt to insert or delete records that would violate the relationship and verify that the configured integrity rule
behaves as intended. This directly validates the intended use of Referential integrity; the other checks target different
concerns.
Question 8. A refactor is proposed after reviewers notice that Data is duplicated casually with no rule for
keeping copies consistent. Which named concept is most relevant?
A. Normalization
B. Intentional denormalization
C. App-specific file storage
D. Background persistence work
Correct Answer: B. Intentional denormalization
Explanation: Intentional denormalization is the most direct match. Consider storing a derived or duplicated value with an
explicit update policy when the measured read benefit justifies the consistency cost.
Question 9. A feature is being redesigned because A large local table is frequently filtered by the same
lookup field and queries become slow as data grows. Which approach is most defensible?
A. Move expensive disk I/O and transformation work away from the main UI thread, then publish completed results
safely back to the UI.
B. Bind user values as query parameters rather than concatenating them into SQL text.
C. Keep the file in the application sandbox and request broader sharing permissions only when the product requirement
truly needs them.
D. Create an index on the field or field combination used by the important selective lookup, after measuring the query
pattern.
Correct Answer: D. Create an index on the field or field combination used by the important selective lookup, after
measuring the query pattern.
Explanation: Create an index on the field or field combination used by the important selective lookup, after measuring the
query pattern. The database can locate matching rows without scanning the entire table for that lookup.
, Question 10. For the requirement that The same customer address is duplicated in many order rows and
updates leave conflicting copies. what is the strongest benefit of applying Normalization?
A. Reducing redundant mutable data lowers update anomalies and improves consistency.
B. A deliberate tradeoff can improve critical read performance when synchronization of the derived value is well
defined.
C. User interaction remains responsive while persistence work proceeds asynchronously.
D. Invalid relationships are rejected consistently even if multiple code paths write to the database.
Correct Answer: A. Reducing redundant mutable data lowers update anomalies and improves consistency.
Explanation: Reducing redundant mutable data lowers update anomalies and improves consistency. That is the primary value
of Normalization for the stated requirement.
Question 11. The team observes that Offline edits exist only in memory and disappear if the app is
terminated before reconnecting. Which principle or pattern is the clearest corrective direction?
A. Optimistic local updates with reconciliation
B. Idempotent synchronization
C. Offline write queue
D. Data retention and deletion lifecycle
Correct Answer: C. Offline write queue
Explanation: Offline write queue is the most direct match. Record pending operations durably in an ordered or
dependency-aware queue and retry them according to explicit policy.
Question 12. A feature is being redesigned because The product no longer needs a class of stored
personal data after an account or feature is removed. Which approach is most defensible?
A. Define retention limits and deletion paths that remove obsolete local copies, derived caches, and queued artifacts
according to policy.
B. Classify data by recovery value and configure backup/restore behavior so durable user data and disposable cache
are treated differently.
C. Use a small key-value preferences store rather than creating a relational schema for unrelated scalar settings.
D. Store the shared entity once and reference it through keys rather than duplicating mutable facts across rows.
Correct Answer: A. Define retention limits and deletion paths that remove obsolete local copies, derived caches,
and queued artifacts according to policy.
Explanation: Define retention limits and deletion paths that remove obsolete local copies, derived caches, and queued
artifacts according to policy. Stored data does not persist indefinitely after its legitimate product purpose ends.
Question 13. Why would Atomic transactions be particularly valuable when A transfer operation must
debit one record and credit another, and either both changes should persist or neither should.?
A. Atomicity prevents partial updates from leaving the data in an internally inconsistent state.
B. Invalid relationships are rejected consistently even if multiple code paths write to the database.
C. Simple settings can be persisted with minimal schema and query overhead.
D. Secret material receives stronger access controls and key-management protections than general-purpose local
storage.
Correct Answer: A. Atomicity prevents partial updates from leaving the data in an internally inconsistent state.
Explanation: Atomicity prevents partial updates from leaving the data in an internally inconsistent state. That is the primary
value of Atomic transactions for the stated requirement.
STORAGE QUESTIONS WITH ANSWERS AND EXPLANATIONS
Question 1. A feature is being redesigned because Saving and transforming a large local dataset causes
visible frame drops during scrolling. Which approach is most defensible?
A. Move expensive disk I/O and transformation work away from the main UI thread, then publish completed results
safely back to the UI.
B. Create an index on the field or field combination used by the important selective lookup, after measuring the query
pattern.
C. Define expiration, version, event-based invalidation, or revalidation rules that match how quickly the data can
become obsolete.
D. Consider storing a derived or duplicated value with an explicit update policy when the measured read benefit justifies
the consistency cost.
Correct Answer: A. Move expensive disk I/O and transformation work away from the main UI thread, then publish
completed results safely back to the UI.
Explanation: Move expensive disk I/O and transformation work away from the main UI thread, then publish completed results
safely back to the UI. User interaction remains responsive while persistence work proceeds asynchronously.
Question 2. Engineers diagnose the following weakness: Deleting the visible record leaves hidden
caches, exports, and local history with no cleanup rule. Which design idea most directly counters it?
A. Backup and restore policy
B. Data retention and deletion lifecycle
C. Offline write queue
D. Referential integrity
Correct Answer: B. Data retention and deletion lifecycle
Explanation: Data retention and deletion lifecycle is the most direct match. Define retention limits and deletion paths that
remove obsolete local copies, derived caches, and queued artifacts according to policy.
Question 3. After adopting Offline write queue, which validation step best tests the design claim rather
than a different concern?
A. Create divergent edits from the same starting version and verify that synchronization follows the documented conflict
policy.
B. Force both successful and failed server responses and verify that the optimistic state either becomes confirmed or is
correctly reconciled.
C. Save, relaunch, and change each setting independently, verifying that missing keys fall back to documented
defaults.
D. Create offline changes, terminate and relaunch the app, reconnect, and verify that pending operations resume
without duplication.
Correct Answer: D. Create offline changes, terminate and relaunch the app, reconnect, and verify that pending
operations resume without duplication.
Explanation: Create offline changes, terminate and relaunch the app, reconnect, and verify that pending operations resume
without duplication. This directly validates the intended use of Offline write queue; the other checks target different concerns.
,Question 4. A mobile team has this requirement: Sensitive locally stored records must remain unreadable
if the storage file is copied from the device. Which design choice best addresses it?
A. Keep the file in the application sandbox and request broader sharing permissions only when the product requirement
truly needs them.
B. Use the platform security facility intended for credentials or cryptographic secrets rather than ordinary preferences or
source code.
C. Use platform-appropriate encrypted storage or database encryption with keys protected outside the data file itself.
D. Use an object-persistence framework or mapping layer that manages model identity, relationships, fetching, and
persistence lifecycle.
Correct Answer: C. Use platform-appropriate encrypted storage or database encryption with keys protected
outside the data file itself.
Explanation: Use platform-appropriate encrypted storage or database encryption with keys protected outside the data file
itself. Copied persistence files do not reveal plaintext sensitive content without access to the protected key material.
Question 5. A code review finds this problem: UI code manually serializes every object graph and
reconstructs relationships in screen controllers. Which concept most directly addresses the underlying
design issue?
A. Relational database
B. Object persistence mapping
C. Key-value preferences
D. Conflict resolution policy
Correct Answer: B. Object persistence mapping
Explanation: Object persistence mapping is the most direct match. Use an object-persistence framework or mapping layer
that manages model identity, relationships, fetching, and persistence lifecycle.
Question 6. A team chooses Conflict resolution policy because Two devices modify the same logical
record while disconnected and later synchronize. Which outcome best justifies that choice?
A. User work survives process restarts and can be synchronized after connectivity recovers.
B. Concurrent edits are resolved predictably instead of whichever network response arrives last accidentally winning.
C. The interface responds quickly while eventual server outcomes are still handled explicitly.
D. The database stays focused on structured queryable metadata while large sequential file content can use
file-storage semantics.
Correct Answer: B. Concurrent edits are resolved predictably instead of whichever network response arrives last
accidentally winning.
Explanation: Concurrent edits are resolved predictably instead of whichever network response arrives last accidentally
winning. That is the primary value of Conflict resolution policy for the stated requirement.
,Question 7. Which review or test is most tightly aligned with confirming Referential integrity?
A. Inject a failure between the writes and verify that the store contains either the full operation or none of it.
B. Change the underlying records and verify that the denormalized value is updated or invalidated according to the
documented policy.
C. Attempt to insert or delete records that would violate the relationship and verify that the configured integrity rule
behaves as intended.
D. Verify that files are created in the intended app-specific directory and that cache files can be cleared without deleting
durable documents.
Correct Answer: C. Attempt to insert or delete records that would violate the relationship and verify that the
configured integrity rule behaves as intended.
Explanation: Attempt to insert or delete records that would violate the relationship and verify that the configured integrity rule
behaves as intended. This directly validates the intended use of Referential integrity; the other checks target different
concerns.
Question 8. A refactor is proposed after reviewers notice that Data is duplicated casually with no rule for
keeping copies consistent. Which named concept is most relevant?
A. Normalization
B. Intentional denormalization
C. App-specific file storage
D. Background persistence work
Correct Answer: B. Intentional denormalization
Explanation: Intentional denormalization is the most direct match. Consider storing a derived or duplicated value with an
explicit update policy when the measured read benefit justifies the consistency cost.
Question 9. A feature is being redesigned because A large local table is frequently filtered by the same
lookup field and queries become slow as data grows. Which approach is most defensible?
A. Move expensive disk I/O and transformation work away from the main UI thread, then publish completed results
safely back to the UI.
B. Bind user values as query parameters rather than concatenating them into SQL text.
C. Keep the file in the application sandbox and request broader sharing permissions only when the product requirement
truly needs them.
D. Create an index on the field or field combination used by the important selective lookup, after measuring the query
pattern.
Correct Answer: D. Create an index on the field or field combination used by the important selective lookup, after
measuring the query pattern.
Explanation: Create an index on the field or field combination used by the important selective lookup, after measuring the
query pattern. The database can locate matching rows without scanning the entire table for that lookup.
, Question 10. For the requirement that The same customer address is duplicated in many order rows and
updates leave conflicting copies. what is the strongest benefit of applying Normalization?
A. Reducing redundant mutable data lowers update anomalies and improves consistency.
B. A deliberate tradeoff can improve critical read performance when synchronization of the derived value is well
defined.
C. User interaction remains responsive while persistence work proceeds asynchronously.
D. Invalid relationships are rejected consistently even if multiple code paths write to the database.
Correct Answer: A. Reducing redundant mutable data lowers update anomalies and improves consistency.
Explanation: Reducing redundant mutable data lowers update anomalies and improves consistency. That is the primary value
of Normalization for the stated requirement.
Question 11. The team observes that Offline edits exist only in memory and disappear if the app is
terminated before reconnecting. Which principle or pattern is the clearest corrective direction?
A. Optimistic local updates with reconciliation
B. Idempotent synchronization
C. Offline write queue
D. Data retention and deletion lifecycle
Correct Answer: C. Offline write queue
Explanation: Offline write queue is the most direct match. Record pending operations durably in an ordered or
dependency-aware queue and retry them according to explicit policy.
Question 12. A feature is being redesigned because The product no longer needs a class of stored
personal data after an account or feature is removed. Which approach is most defensible?
A. Define retention limits and deletion paths that remove obsolete local copies, derived caches, and queued artifacts
according to policy.
B. Classify data by recovery value and configure backup/restore behavior so durable user data and disposable cache
are treated differently.
C. Use a small key-value preferences store rather than creating a relational schema for unrelated scalar settings.
D. Store the shared entity once and reference it through keys rather than duplicating mutable facts across rows.
Correct Answer: A. Define retention limits and deletion paths that remove obsolete local copies, derived caches,
and queued artifacts according to policy.
Explanation: Define retention limits and deletion paths that remove obsolete local copies, derived caches, and queued
artifacts according to policy. Stored data does not persist indefinitely after its legitimate product purpose ends.
Question 13. Why would Atomic transactions be particularly valuable when A transfer operation must
debit one record and credit another, and either both changes should persist or neither should.?
A. Atomicity prevents partial updates from leaving the data in an internally inconsistent state.
B. Invalid relationships are rejected consistently even if multiple code paths write to the database.
C. Simple settings can be persisted with minimal schema and query overhead.
D. Secret material receives stronger access controls and key-management protections than general-purpose local
storage.
Correct Answer: A. Atomicity prevents partial updates from leaving the data in an internally inconsistent state.
Explanation: Atomicity prevents partial updates from leaving the data in an internally inconsistent state. That is the primary
value of Atomic transactions for the stated requirement.