• 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 21 pages
Exam (elaborations)

Cse 335 Exam 1 Questions With Answers And Explanations

Document preview thumbnail
Preview 3 out of 21 pages

Cse 335 Exam 1 Questions With Answers And Explanations

Content preview

CSE 335 EXAM 1 QUESTIONS WITH
ANSWERS AND EXPLANATIONS
1. An app is being revised because of this need: A form view owns a local toggle used only to
control a preview
section. Which change is the best fit?
A. @Binding
B. @Query
C. @Environment
D. @State
Correct Answer: D. @State
Explanation: @State is appropriate for simple transient value state owned by the view itself.
2. During implementation, this requirement arises: A collection transform receives behavior that
should execute for
each element. What should the developer use?
A. A build scheme
B. A module import
C. A property wrapper
D. A closure
Correct Answer: D. A closure
Explanation: Closures are executable blocks that can be passed around and invoked later,
making them useful for callbacks and
higher-order operations.
3. A decoded API record is naturally modeled as a value with no identity-sharing requirement.
Which choice is most
appropriate?
A. A protocol extension only
B. A global singleton
C. A class only
D. A struct
Correct Answer: D. A struct
Explanation: Structs have value semantics and are commonly suitable for lightweight model
values in Swift.
4. During implementation, this requirement arises: A child toggle must change a Boolean owned
by its parent
screen. What should the developer use?
A. @State
B. @Environment
C. @Binding
D. @StateObject
Correct Answer: C. @Binding
Explanation: @Binding lets a child read and write state whose source of truth is owned
elsewhere.

,5. An asynchronous helper reports completion through a callback block. Which choice is most
appropriate?
A. A property wrapper
B. A closure
C. A module import
D. A build scheme
Correct Answer: B. A closure
Explanation: Closures are executable blocks that can be passed around and invoked later,
making them useful for callbacks and
higher-order operations.
6. During implementation, this requirement arises: A preview passes an external observable
model into a reusable
view. What should the developer use?
A. @StateObject
B. @ObservedObject
C. @AppStorage
D. @State
Correct Answer: B. @ObservedObject
Explanation: @ObservedObject is appropriate when an observable object is created elsewhere
and merely observed by this view.
7. An app is being revised because of this need: A shared feature object is constructed above the
current view and
passed in for observation. Which change is the best fit?
A. @StateObject
B. @State
C. @ObservedObject
D. @AppStorage
Correct Answer: C. @ObservedObject
Explanation: @ObservedObject is appropriate when an observable object is created elsewhere
and merely observed by this view.
8. A code review focuses on this situation: A view owns a temporary search string that is
discarded when the view
is recreated. Which design decision best addresses it?
A. @Environment
B. @Query
C. @State
D. @Binding
Correct Answer: C. @State
Explanation: @State is appropriate for simple transient value state owned by the view itself.
9. During implementation, this requirement arises: A filter panel needs a single-choice control for
sort order. What
should the developer use?
A. Divider
B. ProgressView
C. Picker
D. Text
Correct Answer: C. Picker
Explanation: Picker represents selection among a known set of alternatives.

, 10. An app is being revised because of this need: A temporary settings panel should be presented
without pushing
onto the navigation stack. Which change is the best fit?
A. .overlay
B. .sheet
C. .fixedSize
D. .background
Correct Answer: B. .sheet
Explanation: A sheet presents modal content while preserving the underlying screen.
11. A code review focuses on this situation: A network response may contain an optional subtitle
that should be
used only when present. Which design decision best addresses it?
A. Compare the optional to an empty string regardless of type
B. Convert all optionals into global variables
C. Optional binding with if let or guard let
D. Force unwrap every optional
Correct Answer: C. Optional binding with if let or guard let
Explanation: Optional binding safely unwraps a value only when it is non-nil.
12. A location value can be absent until the device has produced its first fix. Which choice is most
appropriate?
A. Convert all optionals into global variables
B. Compare the optional to an empty string regardless of type
C. Optional binding with if let or guard let
D. Force unwrap every optional
Correct Answer: C. Optional binding with if let or guard let
Explanation: Optional binding safely unwraps a value only when it is non-nil.
13. A data-entry screen needs labeled controls with standard platform spacing. Which choice is
most appropriate?
A. LazyHGrid
B. Canvas
C. TimelineView
D. Form
Correct Answer: D. Form
Explanation: Form groups standard data-entry controls in a platform-appropriate
settings/data-entry presentation.
14. During implementation, this requirement arises: A search result should open a detail
destination while
preserving prior navigation history. What should the developer use?
A. NavigationStack
B. GeometryReader
C. ZStack
D. Form
Correct Answer: A. NavigationStack
Explanation: NavigationStack provides stack-based value-driven navigation in modern SwiftUI.
15. A code review focuses on this situation: A profile editor lets the user choose one value from a
defined
enumeration. Which design decision best addresses it?
A. Picker
B. Text
C. ProgressView
D. Divider
Correct Answer: A. Picker
Explanation: Picker represents selection among a known set of alternatives.

Document information

Uploaded on
October 10, 2026
Number of pages
21
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
6 days 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