Velocer打开应用

Velocer › 单词卡 › University of Wisconsin–Madison › CS 571: Building User Interfaces · UW-Madison

CS 571: Building User Interfaces · UW-Madison

Building user interfaces, my notes as flashcards. · 作者:bayes_buddy · 150 张卡片

University of Wisconsin–Madison

学习这个卡组 嵌入

  1. What does UX stand for, and what does UX engineering involve?UX stands for user experience. UX engineering means building interfaces end-to-end, from design principles through implementation across platforms.
  2. What is HCI, and why is it relevant to building user interfaces?HCI is Human-Computer Interaction, the study of how people interact with computers. Its design principles guide building usable, effective interfaces.
  3. What does a11y mean?a11y is a numeronym for accessibility—the practice of designing interfaces usable by people with diverse abilities, including those using assistive technologies.
  4. What is React?A JavaScript library for building user interfaces from reusable components, commonly used for web front-end development.
  5. What is React Router used for?It handles client-side routing in React web applications, letting users navigate between views without full page reloads.
  6. What is React Native, and how does it relate to Expo?React Native is a framework for building native mobile apps using JavaScript and React. Expo is a toolchain/platform that simplifies developing and running React Native apps.
  7. What is Wit.ai used for?It is a platform for building natural-language/conversational interfaces, such as chatbots and voice assistants.
  8. What does RESTful state management refer to?Managing application data through REST APIs—using HTTP-based client-server communication to fetch and update state in the UI.
  9. What does cross-platform UI development mean?Building interfaces that run on multiple platforms (web, iOS, Android) from shared code or a unified approach, rather than separate native implementations.
  10. What is HTML/CSS/JS used for in UI development?HTML structures content, CSS styles its appearance, and JavaScript adds interactivity—together forming the foundation of web interfaces.
  11. What two disciplines does the UX Developer role bridge?Visual/Interaction Design and Frontend Software Engineering.
  12. What design-side skills does a UX Developer draw on?Understanding human perception, affordances, and wireframing.
  13. What engineering-side skills does a UX Developer draw on?DOM manipulation, state architecture, network protocols, and cross-platform rendering.
  14. What is the core purpose of the UX Developer role?To bridge visual/interaction design and frontend software engineering, connecting human-centered design thinking with technical implementation.
  15. What does 'affordances' refer to in interaction design?The perceived and actual properties of an object that suggest how it can be used.
  16. Why does a UX Developer need to understand human perception?Because design decisions about layout, contrast, and usability depend on how people visually and cognitively process interfaces.
  17. What is wireframing?A low-fidelity visual representation of an interface's structure and layout used to plan design before implementation.
  18. Why is DOM manipulation relevant to UX development?It lets developers dynamically update the interface in response to user actions and state changes.
  19. What is state architecture in frontend engineering?The way an application organizes and manages its data and UI state across components and interactions.
  20. Why do UX Developers need knowledge of network protocols?Because interface behavior and performance depend on how data is requested, transferred, and rendered over networks.
  21. What is cross-platform rendering and why does it matter to UX Developers?It is how interfaces display consistently across different devices and platforms, ensuring a reliable user experience everywhere.
  22. How does the UX Developer role differ from a pure designer?A UX Developer implements designs in code, handling DOM, state, and rendering rather than only producing design artifacts.
  23. How does the UX Developer role differ from a pure frontend engineer?A UX Developer brings design expertise like perception, affordances, and wireframing to engineering work, not just technical implementation.
  24. What is an affordance, according to Don Norman?An affordance is what actions an object allows a user to take.
  25. What is a signifier in UI design?A perceptual cue (such as shadows, cursor changes, underlines, or button borders) that communicates where and how to interact with an object.
  26. How do affordances and signifiers differ?Affordances are the possible actions an object allows; signifiers are the perceptual cues that communicate those actions to the user.
  27. What does the Gestalt principle of proximity state?Elements placed close together are perceived as a logical group, such as a form label placed directly above its input and separated from the next field.
  28. What does the Gestalt principle of similarity state?Elements sharing color, shape, or typography are perceived as having the same function.
  29. What is the Gestalt principle of enclosure (common region)?Using cards, borders, and background shading to group related content together.
  30. How can visual hierarchy and scannability be established in an interface?Through font size, weight, contrast, and whitespace such as margins and padding.
  31. How many font families should an interface typically use?Limit interfaces to 2–3 font families.
  32. What WCAG contrast ratio is required for normal text?At least 4.5:1 for normal text.
  33. What WCAG contrast ratio is required for large text?At least 3:1 for large text.
  34. What does Nielsen's 'visibility of system status' heuristic mean?The system should keep users informed about what is happening, e.g., with loading spinners or disabled states during a POST request.
  35. What does Nielsen's 'match between system and real world' heuristic mean?The system should speak the users' language, using concepts and terms familiar to them rather than system-oriented jargon.
  36. What does Nielsen's 'user control and freedom' heuristic mean?Users should be able to undo or cancel actions and escape unwanted states easily.
  37. What does Nielsen's 'consistency and standards' heuristic mean?Interface elements and behaviors should follow consistent conventions and platform standards so users aren't confused.
  38. Why is error prevention preferred over error reporting in Nielsen's heuristics?Designing to prevent errors from occurring is better than merely reporting errors after they happen.
  39. What does the array method .map(fn) do?It transforms an array of data objects into a new array of the same length (1→1), commonly used to convert data into JSX components. It does not mutate the original array.
  40. What does the array method .filter(pred) do?It returns a subset of items that match a predicate (N→M where M ≤ N), used for search criteria and subsetting without mutating state.
  41. What does the array method .reduce((acc, curr) => ..., init) do?It aggregates an array into a single summary value or lookup dictionary (N→1), starting from an initial accumulator value.
  42. What is the difference between .some(pred) and .every(pred)?.some(pred) is an existential check that returns true if any element matches; .every(pred) is a universal check that returns true only if all elements match.
  43. Why should you avoid mutating state in-place when using array higher-order functions?Declarative methods like map, filter, and reduce return new arrays, preserving immutability so React can detect changes and re-render correctly.
  44. How do you immutably append an item to an array in React state?Use spread in the updater: setItems(prev => [...prev, newItem]), which creates a new array instead of mutating the old one.
  45. How do you immutably update a single property of an object in React state?Spread the previous object and override the field: setUser(prev => ({ ...prev, name: "Bucky" })).
  46. What does the spread syntax (...) do in object and array cloning?It copies the enumerable properties or elements of an object/array into a new one, enabling immutable state updates.
  47. What is a closure in JavaScript?An inner function that retains references to variables in its outer lexical scope even after the outer function has returned.
  48. Why are closures fundamental to React hooks and event handlers?Hooks and handlers are inner functions that capture variables from their surrounding scope, letting them access and act on state and props across renders.
  49. What is lexical scoping?Scope is determined by where variables are declared in the source code, so inner functions can access variables from their enclosing scopes.
  50. Which array method would you use to build a lookup dictionary from a list?.reduce(), aggregating the array into a single object keyed by a chosen field.
  51. Which array method would you use to render a list of JSX components from data?.map(), transforming each data object into a JSX element (1→1).
  52. Which array method would you use to check whether all items satisfy a condition?.every(pred), which returns true only if every element passes the predicate.
  53. Which array method would you use to check whether at least one item satisfies a condition?.some(pred), which returns true if any element passes the predicate.
  54. What does the HTTP GET verb do in a REST API?It performs an idempotent read of a resource, such as listing chatrooms or fetching messages. It typically returns 200 OK or 304 Not Modified.
  55. Which HTTP verb is used to create a resource or trigger a state change?POST, for example on /register, /login, /logout, or /messages.
  56. Which HTTP verb removes a resource in this API?DELETE, for example /messages?id=ID.
  57. What status codes can a GET request return for a successful read?200 OK or 304 Not Modified.
  58. What are props in React?Read-only inputs passed top-down from a parent component to a child component.
  59. What is state in React (via useState)?Internal mutable data owned by a component; calling the setter schedules a re-render and virtual DOM diffing.
  60. What happens when you call a useState setter?It schedules a re-render and virtual DOM diffing for that component.
  61. Who owns and can modify a component's state?The component itself; state is internal and mutable data owned by that component.
  62. Can a child component modify the props it receives?No—props are read-only inputs passed top-down from parent to child.
  63. What direction does data flow through props?Top-down, from parent to child.
  64. Why must elements returned inside .map() have a key prop?React uses keys to identify which items changed, were added, or were removed, keeping component state correctly associated across re-renders.
  65. What kind of key should be used for list items?A stable, unique key tied to the data item's ID, such as key={msg.id}.
  66. Why should you avoid using the array index as a key?If items can be reordered, inserted, or deleted, index keys cause React to misassociate component state across re-renders.
  67. When is it acceptable to use the array index as a key?Only when the list is static—items cannot be reordered, inserted, or deleted.
  68. What is the difference between props and state?Props are read-only inputs passed from parent to child, while state is internal mutable data owned by the component itself.
  69. What causes React to misassociate component state across re-renders in lists?Using array indices as keys when items can be reordered, inserted, or deleted.
  70. What does calling the setter function from useState do?It triggers a re-render of the component. Updates are asynchronous and batched.
  71. When should you use the functional update form of a useState setter, like setVal(prev => prev + 1)?When the new state depends on the previous state. This avoids issues with asynchronous or batched updates.
  72. What is the purpose of useEffect?It synchronizes a component with external systems, such as API fetches, timers, or sessionStorage.
  73. What does an empty dependency array [] in useEffect cause?The effect runs only once, after the initial mount.
  74. What happens if you omit the dependency array in useEffect?The effect runs after every render, which can cause infinite loops (e.g., a 429 loop).
  75. How does useEffect with dependencies like [chatroom, page] behave?The effect runs whenever any of the dependencies (chatroom or page) change.
  76. What problem does useContext solve?It allows consuming shared state across deep component trees without prop drilling.
  77. What is useRef used for?It creates a mutable box (ref.current) that persists across renders without triggering re-renders. It's also used for uncontrolled DOM input access.
  78. Does changing ref.current cause a re-render?No, mutating ref.current does not trigger a re-render.
  79. What is the difference between useMemo and useCallback?useMemo memoizes a computed value, while useCallback memoizes a function reference. Both help avoid unnecessary recalculations or re-creations across renders.
  80. When would you use useMemo?To memoize expensive derived calculations so they are only recomputed when dependencies change.
  81. Why might you use useRef for an input element?To access the DOM node directly (e.g., inputRef.current.value) without causing re-renders, useful for uncontrolled components.
  82. What is prop drilling and how does useContext help?Prop drilling is passing props through many layers. useContext lets you consume shared state directly without passing props through intermediate components.
  83. What is a controlled component in React?An input whose value is driven by React state, using value={username} and onChange={e => setUsername(e.target.value)}, so React state is the single source of truth.
  84. In a controlled component, what is the single source of truth for the input's value?React state.
  85. What two props typically make an input a controlled component?The value prop bound to state and an onChange handler that updates that state.
  86. What are good use cases for controlled components?Instant validation, character counters, and dynamically disabling submit buttons.
  87. What is an uncontrolled component in React?An input where the DOM holds the input state until form submission, typically accessed via a ref such as pinRef.current.value.
  88. How do you read an uncontrolled input's value?Through a ref, for example pinRef.current.value.
  89. What React hook is commonly used for uncontrolled inputs?useRef.
  90. What is a key performance benefit of uncontrolled components?They avoid re-rendering the entire component tree on every keystroke.
  91. When does an uncontrolled component's value get read?At form submission, when you access the ref's current value.
  92. Controlled vs. uncontrolled: which one re-renders on every keystroke?A controlled component re-renders on every keystroke because each change updates React state.
  93. Controlled vs. uncontrolled: which keeps input state in the DOM until submission?An uncontrolled component.
  94. Why might you choose a controlled input for a character counter?Because React state updates on every keystroke, letting you display the live character count and enforce limits.
  95. Why might you choose an uncontrolled input for a large form?It avoids re-rendering the component tree on every keystroke, which can improve performance.
  96. What does onChange={e => setUsername(e.target.value)} do in a controlled input?It updates the state variable username with the input's current value on every change.
  97. In a controlled input, what happens if you omit the onChange handler?The input's value is controlled by state but cannot be updated by typing, effectively making it read-only.
  98. What is the purpose of client-side routing in React?It maps URL paths to component trees without triggering full-page browser reloads, keeping the app responsive.
  99. Which components from react-router are used to map URL paths to components?BrowserRouter, Routes, and Route.
  100. Why should you use <Link to="/login"> instead of <a href="/login">?<Link> preserves React state and avoids wiping in-memory state, while <a href> causes a full-page reload.
  101. What hook can you use to navigate programmatically in react-router?useNavigate().
  102. What does <Outlet /> do in react-router?It renders the child (nested) route's component inside a shared parent layout.
  103. How do you implement nested routes with a shared layout like a persistent navbar?Define nested routes under a parent route, and place <Outlet /> in the parent layout where child routes should render.
  104. What is the difference between <Link> and <a href> in a React app?<Link> performs client-side navigation preserving React state; <a href> triggers a full-page browser reload.
  105. Which package provides routing components like BrowserRouter and Routes for React web apps?react-router-dom (which re-exports from react-router).
  106. What happens to React state when you use a plain <a href> link for navigation?The full-page reload wipes React's in-memory state.
  107. What component wraps the app to enable client-side routing with the browser's history API?BrowserRouter.
  108. What is the role of <Routes> in react-router?It groups and matches <Route> definitions against the current URL to decide which component to render.
  109. What is the role of <Route> in react-router?It associates a URL path with a component to render when that path matches.
  110. In React Native, what component replaces the HTML <div>?<View> — it uses Flexbox layout, with flexDirection: 'column' as the default.
  111. What is the React Native equivalent of <p> and <span>?<Text>. All raw text strings must be wrapped in <Text>.
  112. Which React Native components replace the HTML <button>?<Pressable> or <Button>.
  113. What component replaces <input> in React Native, and how do you read its value?<TextInput>, which uses onChangeText={text => ...} instead of e.target.value.
  114. Is scrolling automatic in React Native?No. You must wrap overflowing content in <ScrollView> or a virtualized <FlatList data={...} renderItem={...} />.
  115. What is the default flexDirection for a <View> in React Native?'column' — unlike web Flexbox, which defaults to 'row'.
  116. What replaces web localStorage for persistent storage in React Native?Asynchronous options: Expo SecureStore for sensitive data like JWTs/PINs, or AsyncStorage.
  117. Which storage option should you use for sensitive data such as JWTs or PINs on a device?Expo SecureStore, because it provides secure, asynchronous persistent storage.
  118. Why can't you use HTML DOM elements like div, p, or button in React Native?Native mobile apps have no HTML DOM; React Native maps these concepts to native components like <View>, <Text>, and <Pressable>.
  119. What must you do with raw text strings in React Native?Wrap them in a <Text> component; unwrapped strings are not valid.
  120. What props does a virtualized <FlatList> require?data={...} for the list items and renderItem={...} to render each item.
  121. Which navigator would you use for push/pop screen transitions?The Stack Navigator from @react-navigation.
  122. What is an utterance in a conversational interface?The raw phrase a user says or types, such as "Create a post in Bascom Hill Hangout titled Hello."
  123. What is an intent in NLU?The high-level goal the system classifies from a user's utterance, such as create_post, get_messages, or login.
  124. What are entities (slots) in a conversational interface?The parameters extracted from an utterance that fill in an intent, such as chatroom = "Bascom Hill Hangout" and title = "Hello."
  125. How do intents and entities differ?An intent captures what the user wants to do overall, while entities are the specific details or parameters needed to carry it out.
  126. What is dialog management in a voice or chat agent?The component that tracks conversation state across turns, filling slots and deciding what to ask or do next.
  127. Why is grounding important in voice and chat interfaces?Because speech and chat lack persistent visual state, agents must explicitly confirm understood slots so users know what the system captured.
  128. What should a voice agent do when NLU confidence is low?Use graceful fallback prompts, such as asking the user to repeat or clarify, rather than guessing or failing silently.
  129. What is multi-turn slot filling?Collecting required parameters across several conversation turns before the agent executes an action.
  130. Why should destructive actions require slot filling and confirmation first?To ensure all parameters are correctly understood and the user explicitly agrees before an irreversible action is performed.
  131. Give an example of grounding in a voice interface.The agent restates what it understood, e.g., "Creating a post titled 'Hello' in Bascom Hill Hangout—is that correct?"
  132. What role does NLU play in a conversational agent?NLU classifies the user's intent and extracts entities from the utterance so the dialog manager can act on it.
  133. Why do voice interfaces need explicit confirmation more than GUI apps?Without a persistent visual screen, users cannot see the captured state, so spoken confirmation replaces visual feedback.
  134. What are the four POUR principles of WCAG?Perceivable, Operable, Understandable, and Robust.
  135. What does the P in POUR stand for?Perceivable — information and UI must be presented in ways users can perceive.
  136. What does the O in POUR stand for?Operable — UI components must be usable, including via keyboard.
  137. What does the U in POUR stand for?Understandable — content and operation of the UI must be understandable.
  138. What does the R in POUR stand for?Robust — content must work reliably with a wide range of user agents and assistive technologies.
  139. Why should you use semantic HTML elements like <nav>, <main>, and <button> instead of generic <div>s?Semantic elements convey meaning and landmarks to assistive technologies, improving navigation and accessibility.
  140. Why is <div onClick> a poor substitute for a <button>?A <div> lacks built-in semantics, keyboard focus, and activation behavior that a native <button> provides.
  141. What alt text should an informative image have?Descriptive alt text that conveys the image's meaning or content.
  142. What alt attribute value should a purely decorative image have?alt="" (empty alt) so screen readers skip it.
  143. How should every form control be labeled?With an explicit <label htmlFor="id"> association tied to the control's id.
  144. What keyboard navigation should an accessible interface support?Full keyboard tab and focus navigation, so all interactive elements are reachable and operable without a mouse.
  145. What does a11y stand for?Accessibility — the numeronym for the word (a + 11 letters + y).
  146. Which WCAG principle covers keyboard operability?Operable — all functionality must be usable via keyboard and other input methods.
  147. Why are semantic landmarks important for screen reader users?They let users jump directly between regions like navigation and main content, speeding up page navigation.
  148. Does React useState persist across a browser refresh?No, useState resets on browser refresh.
  149. How can login status be persisted across page refreshes?Mirror non-sensitive login status in sessionStorage or localStorage while keeping the actual HttpOnly JWT in the browser cookie, or query /whoami on initial mount.
  150. Where should the actual JWT be stored for security?In an HttpOnly browser cookie, not in sessionStorage or localStorage.

Velocer 免费:间隔重复,还能从任何文档创建你自己的卡片。

PDF to flashcards · Lecture to flashcards · Practice exam · Syllabus study plan · Anki import

University of Wisconsin–Madison 的更多牌组