Chapter 15: Quiz - Interactive Dashboards

Instructions

Answer all 30 questions. Each question is worth 1 point. Time limit: 45 minutes.


Section A: Interactivity Fundamentals (Questions 1-8)

Question 1: Which interaction type allows users to narrow data to specific subsets? - A) Selection - B) Filtering - C) Drilling - D) Linking

Question 2: What does "cross-filtering" mean in dashboard design? - A) Filtering data across multiple databases - B) Selection in one chart filters all other charts - C) Applying filters in a cross pattern - D) Removing data that crosses thresholds

Question 3: When is a static visualization preferable to an interactive dashboard? - A) When users need to explore data - B) When the dataset is small - C) When presenting a final report with a complete story - D) When using modern web browsers

Question 4: What is "drill-down" in dashboard navigation? - A) Filtering to lower values - B) Moving from summary views to detailed views - C) Drilling holes in the data - D) Scrolling down the page

Question 5: Which interaction type shows additional information when the cursor moves over an element? - A) Click - B) Select - C) Hover - D) Drag

Question 6: What is "progressive disclosure" in dashboard design? - A) Showing all information immediately - B) Gradually revealing complexity as users request it - C) Displaying data in order of time - D) Slowly loading the page

Question 7: Why is responsive feedback important in dashboards? - A) To make dashboards respond to voice commands - B) So users know their actions have been registered - C) To respond to user feedback surveys - D) For mobile responsiveness

Question 8: In a well-designed information hierarchy, where should key metrics appear? - A) At the bottom after detailed data - B) Hidden in expandable sections - C) At the top where they're immediately visible - D) Only on hover


Section B: Plotly (Questions 9-14)

Question 9: What is the main advantage of Plotly over matplotlib for web dashboards? - A) Plotly is faster - B) Plotly creates interactive charts by default - C) Plotly has more chart types - D) Plotly is open source

Question 10: What does px.scatter() create in Plotly Express? - A) A line chart - B) A scatter plot - C) A bar chart - D) A pie chart

Question 11: How do you customize the hover text in Plotly? - A) Using the title parameter - B) Using the hovertemplate parameter - C) Using the text parameter only - D) Hover text cannot be customized

Question 12: What does make_subplots() do in Plotly? - A) Creates animated transitions - B) Creates multiple charts in one figure - C) Makes plots smaller - D) Submits plots to a server

Question 13: In Plotly, what is the template parameter used for? - A) Creating HTML templates - B) Applying consistent styling themes - C) Templating hover text - D) Creating chart templates to reuse

Question 14: What is the purpose of hovermode='x unified'? - A) Unify all charts horizontally - B) Show hover data for all traces at the same x position - C) Hide the x-axis - D) Enable horizontal scrolling


Section C: Dash Framework (Questions 15-22)

Question 15: What are Dash callbacks used for? - A) Calling external APIs - B) Updating components based on user interactions - C) Calling Python functions at scheduled times - D) Error handling

Question 16: In a Dash callback, what does the Output decorator specify? - A) The input from the user - B) The component to be updated - C) Error output - D) Console output

Question 17: What is the purpose of State in Dash callbacks? - A) To store data persistently - B) To read component values without triggering updates - C) To manage application state globally - D) To pause callback execution

Question 18: Which library provides Bootstrap components for Dash? - A) dash-html-components - B) dash-bootstrap-components - C) bootstrap-dash - D) plotly-bootstrap

Question 19: What does prevent_initial_call=True do in a callback? - A) Prevents all calls to the callback - B) Prevents the callback from running when the page loads - C) Prevents callbacks for initial users - D) Prevents errors in the callback

Question 20: How do you share data between callbacks in Dash? - A) Global Python variables - B) dcc.Store components - C) Writing to files - D) All callbacks share data automatically

Question 21: What is a clientside callback? - A) A callback that runs on the client's computer - B) A callback that runs in the browser using JavaScript - C) A callback for client authentication - D) A callback that communicates with external clients

Question 22: In Dash, what triggers a callback to execute? - A) Timer expiration only - B) Changes to Input components - C) Server restart - D) User authentication


Section D: Streamlit (Questions 23-27)

Question 23: What is the main advantage of Streamlit over Dash? - A) More customization options - B) Faster to prototype with less code - C) Better performance - D) More chart types

Question 24: What does the @st.cache_data decorator do? - A) Deletes cached data - B) Caches function results to avoid recomputation - C) Caches user data - D) Creates data backups

Question 25: How do you create a sidebar in Streamlit? - A) st.sidebar.component() - B) st.component(sidebar=True) - C) create_sidebar() - D) sidebar.st.component()

Question 26: What does st.session_state store? - A) Server configuration - B) User session data that persists across reruns - C) Browser cookies - D) Log files

Question 27: How do you run a Streamlit app? - A) python app.py - B) streamlit run app.py - C) dash run app.py - D) flask run app.py


Section E: Performance and Deployment (Questions 28-30)

Question 28: What is the purpose of data pagination in dashboards? - A) To organize data into pages for printing - B) To load only a subset of data at a time for performance - C) To paginate error messages - D) To create page numbers in reports

Question 29: What is lazy loading in dashboard design? - A) Making the dashboard load slowly - B) Loading data only when explicitly requested - C) Loading data during idle time - D) Loading data in a lazy manner

Question 30: Which is NOT a common deployment option for Dash applications? - A) Docker containers - B) Streamlit Cloud - C) Heroku - D) AWS EC2


Answer Key

Question Answer Explanation
1 B Filtering narrows data to specific subsets based on criteria
2 B Cross-filtering means selection in one chart affects all others
3 C Static is better for final reports where the story is complete
4 B Drill-down navigates from summary to detailed views
5 C Hover interaction shows tooltips without clicking
6 B Progressive disclosure reveals complexity gradually on demand
7 B Responsive feedback confirms user actions were registered
8 C Key metrics should be at top for immediate visibility
9 B Plotly creates interactive charts with hover/zoom by default
10 B px.scatter() creates scatter plots
11 B hovertemplate customizes hover text format
12 B make_subplots() creates multiple charts in one figure
13 B template applies consistent styling themes
14 B Shows hover data for all traces at same x position
15 B Callbacks update components based on interactions
16 B Output specifies which component to update
17 B State reads values without triggering updates
18 B dash-bootstrap-components provides Bootstrap styling
19 B Prevents callback from running on page load
20 B dcc.Store components share data between callbacks
21 B Clientside callbacks run JavaScript in the browser
22 B Changes to Input components trigger callbacks
23 B Streamlit is faster to prototype with minimal code
24 B @st.cache_data caches function results
25 A st.sidebar.component() creates sidebar elements
26 B session_state stores data that persists across reruns
27 B streamlit run app.py starts a Streamlit app
28 B Pagination loads subsets for performance
29 B Lazy loading loads data only when requested
30 B Streamlit Cloud is for Streamlit apps, not Dash

Scoring Guide

Score Grade Interpretation
27-30 A Excellent understanding of interactive dashboards
24-26 B Good grasp with minor gaps
21-23 C Adequate understanding, review framework specifics
18-20 D Basic understanding, comprehensive review recommended
<18 F Significant review needed