• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 22 pages
Exam (elaborations)

Cse 335 Exam Prep Questions With Answers And Explanations

Document preview thumbnail
Preview 3 out of 22 pages

Cse 335 Exam Prep Questions With Answers And Explanations

Content preview

CSE 335 EXAM PREP QUESTIONS WITH
ANSWERS AND EXPLANATIONS
1. A developer preparing for a comprehensive assessment sees this requirement: A view owns a
Boolean that
tracks whether an inline help panel is expanded. Which option is the best implementation choice?
A. @Binding
B. @State
C. @Environment
D. @Query
Correct Answer: B. @State
Explanation: @State is appropriate for simple transient value state owned by the view itself.
2. A review session presents this design problem: A deep link should open a specific product
inside a navigation
hierarchy. What should the developer choose?
A. Hard-code destination state in a global variable
B. Use a ZStack as a navigation history
C. A navigation path or value-based destination
D. Recreate the root view for every detail selection
Correct Answer: C. A navigation path or value-based destination
Explanation: Value-driven navigation can represent and restore multi-step navigation state
explicitly.
3. Which solution best fits the following implementation need? A settings toggle for whether hints
are shown
should persist between launches and update the interface automatically.
A. @GestureState
B. @AppStorage
C. @State
D. @Binding
Correct Answer: B. @AppStorage
Explanation: @AppStorage is appropriate for small preference values backed by UserDefaults
and reflected in SwiftUI.
4. A developer preparing for a comprehensive assessment sees this requirement: A feed contains
tens of
thousands of items but users initially see only a small portion. Which option is the best
implementation choice?
A. Pagination / incremental loading
B. Download an unbounded dataset in one response
C. Store page numbers in Keychain only
D. Create a new app target per page
Correct Answer: A. Pagination / incremental loading
Explanation: Pagination limits transfer and rendering cost for large remote collections.
5. A review session presents this design problem: Each copied coordinate value should be
independent after
assignment. What should the developer choose?
A. A protocol extension only
B. A class only
C. A struct
D. A global singleton
Correct Answer: C. A struct
Explanation: Structs have value semantics and are commonly suitable for lightweight model
values in Swift.

,6. For exam preparation, consider this mobile-app situation: The app needs to fetch a list of
public articles from an
API. Which response most directly addresses the requirement?
A. DELETE
B. POST
C. PATCH always
D. GET
Correct Answer: D. GET
Explanation: GET is conventionally used to retrieve a representation without creating a new
resource.
7. For exam preparation, consider this mobile-app situation: A photo browser should show
hundreds of thumbnails
in adaptive columns. Which response most directly addresses the requirement?
A. LazyVGrid
B. Form
C. ZStack
D. VStack
Correct Answer: A. LazyVGrid
Explanation: LazyVGrid efficiently lays out many items in columns and creates child views lazily
as needed.
8. A developer preparing for a comprehensive assessment sees this requirement: A view model
waits for a network
response while keeping scrolling responsive. Which option is the best implementation choice?
A. Spin in a while loop until the response arrives
B. async/await
C. Block with a long synchronous sleep
D. Busy-wait on the main thread
Correct Answer: B. async/await
Explanation: async/await expresses asynchronous work without blocking the caller thread while
waiting for completion.
9. A review session presents this design problem: A screen should fetch its initial remote data
when it appears and
stop obsolete work if it disappears. What should the developer choose?
A. Start an unstructured global task with no lifecycle relationship
B. Run the operation synchronously inside body
C. Block the main thread until the request completes
D. Use .task for view-scoped asynchronous work
Correct Answer: D. Use .task for view-scoped asynchronous work
Explanation: The task modifier is suitable for asynchronous work tied to a view lifecycle and
supports cancellation when the view
disappears.
10. A developer preparing for a comprehensive assessment sees this requirement: The app must
perform an
HTTPS GET request to a REST endpoint. Which option is the best implementation choice?
A. URLSession
B. CoreLocation
C. AVAudioSession
D. UserDefaults
Correct Answer: A. URLSession
Explanation: URLSession is the standard networking API for HTTP requests and data tasks.

, 11. For exam preparation, consider this mobile-app situation: Several concurrent tasks read and
update an
in-memory image cache. Which response most directly addresses the requirement?
A. Store all shared values in independent views
B. Rely on random timing to avoid races
C. Expose mutable state globally with no synchronization
D. Use an actor to protect shared mutable state
Correct Answer: D. Use an actor to protect shared mutable state
Explanation: Actors serialize access to their isolated mutable state and are useful for
concurrency-safe shared resources.
12. For exam preparation, consider this mobile-app situation: A background network request
finishes and the
visible loading state must change. Which response most directly addresses the requirement?
A. Mutate UI state from an arbitrary background context
B. Update UI-observed state on the main actor
C. Store every UI value in UserDefaults
D. Disable concurrency entirely
Correct Answer: B. Update UI-observed state on the main actor
Explanation: UI-facing state should be mutated on the main actor to preserve thread-safety
expectations of the UI framework.
13. Which solution best fits the following implementation need? A badge must appear on top of a
profile image.
A. ZStack
B. List
C. HStack
D. VStack
Correct Answer: A. ZStack
Explanation: ZStack overlays children along the depth axis.
14. A developer preparing for a comprehensive assessment sees this requirement: A weather API
returns nested
JSON consumed by several views. Which option is the best implementation choice?
A. Render raw JSON strings throughout the view hierarchy
B. Decode into a typed model before updating UI state
C. Use dictionary lookups for every field forever
D. Force-cast arbitrary JSON values at render time
Correct Answer: B. Decode into a typed model before updating UI state
Explanation: Typed decoding centralizes validation and gives downstream UI code predictable
data shapes.
15. A developer preparing for a comprehensive assessment sees this requirement: A request can
be idle, loading,
loaded, or failed. Which option is the best implementation choice?
A. A floating-point value
B. A duplicated Boolean pair
C. An enum
D. A raw unstructured string everywhere
Correct Answer: C. An enum
Explanation: Enums model a finite set of related states and can attach associated data when
needed.

Document information

Uploaded on
October 10, 2026
Number of pages
22
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Favorgrades
3.8
(199)
Sold
854
Followers
377
Items
57829
Last sold
1 week ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions