Docsity

PrepIQ CIW Mobile Application Developer Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
PrepIQ CIW Mobile Application
Developer Ultimate Exam
**Question 1. Which HTML5 element should be used to contain the main
navigation links of a mobile web app?**
A) <section>
B) <nav>
C) <aside>
D) <header>
Answer: B
Explanation: The <nav> element semantically defines a block of navigation links,
which is ideal for main menus on mobile sites.
**Question 2. What does the viewport meta tag `<meta name="viewport"
content="width=device-width, initial-scale=1">` accomplish?**
A) Locks the page width to 1024 px
B) Disables user scaling on mobile devices
C) Sets the layout width to match the device’s screen width and establishes a 1:1
initial scale
D) Enables only landscape orientation
Answer: C
Explanation: This tag tells browsers to size the page to the device’s width and
start with a 1:1 zoom level, essential for responsive design.
**Question 3. Which CSS property creates a flexible layout that can adapt to
different screen sizes without using floats?**
A) display: block;
B) display: inline-block;
C) display: flex;
D) position: absolute;
Answer: C
Explanation: display: flex enables the Flexbox model, allowing containers to
distribute space dynamically across various screen sizes.
**Question 4. In a CSS media query, what does the condition `(max-width:
600px)` target?**
A) Devices wider than 600 px
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download PrepIQ CIW Mobile Application Developer Ultimate Exam and more Exams Technology in PDF only on Docsity!

Developer Ultimate Exam

Question 1. Which HTML5 element should be used to contain the main navigation links of a mobile web app? A) B) C) D) Answer: B Explanation: The element semantically defines a block of navigation links, which is ideal for main menus on mobile sites. Question 2. What does the viewport meta tag `` accomplish? A) Locks the page width to 1024 px B) Disables user scaling on mobile devices C) Sets the layout width to match the device’s screen width and establishes a 1: initial scale D) Enables only landscape orientation Answer: C Explanation: This tag tells browsers to size the page to the device’s width and start with a 1:1 zoom level, essential for responsive design. Question 3. Which CSS property creates a flexible layout that can adapt to different screen sizes without using floats? A) display: block; B) display: inline-block; C) display: flex; D) position: absolute; Answer: C Explanation: display: flex enables the Flexbox model, allowing containers to distribute space dynamically across various screen sizes. Question 4. In a CSS media query, what does the condition (max-width: 600px) target? A) Devices wider than 600 px

Developer Ultimate Exam

B) Devices exactly 600 px wide C) Devices narrower than or equal to 600 px D) Only devices with a width of 600 px and a height of 800 px Answer: C Explanation: max-width applies the enclosed styles when the viewport width is ≤ 600 px, typical for smartphones. Question 5. Which JavaScript event is fired when a user begins a touch on a mobile screen? A) click B) mousedown C) touchstart D) pointerdown Answer: C Explanation: touchstart is the first event in the touch sequence, triggered when a finger contacts the screen. Question 6. Which of the following is NOT a valid HTML5 data storage API? A) localStorage B) sessionStorage C) IndexedDB D) cookieStorage Answer: D Explanation: HTML5 defines localStorage, sessionStorage, and IndexedDB. There is no cookieStorage API. Question 7. What is the primary purpose of a Service Worker in a Progressive Web App (PWA)? A) To replace the browser’s rendering engine B) To manage background synchronization and offline caching of assets C) To encrypt all network traffic D) To provide a GUI for users to edit HTML Answer: B

Developer Ultimate Exam

Question 11. Which CSS property is used to create a responsive grid that automatically fills rows with equal-width columns? A) display: table; B) display: grid; C) float: left; D) display: inline-flex; Answer: B Explanation: display: grid enables CSS Grid Layout, which can auto-place columns of equal width across rows. Question 12. Which JavaScript syntax creates a promise that resolves after 2 seconds? A) setTimeout(()=>resolve(),2000); B) await setTimeout(resolve,2000); C) new Promise(setTimeout(resolve,2000)); D) Promise.delay(2000); Answer: A Explanation: setTimeout inside a Promise executor calls resolve() after the specified delay. Question 13. What does the navigator.geolocation.getCurrentPosition() method return? A) A Promise that resolves to a latitude/longitude object B) An object containing GPS hardware details C) Calls a callback with a Position object containing coordinates D) A string with the device’s IP address Answer: C Explanation: getCurrentPosition accepts success and error callbacks; the success callback receives a Position object. Question 14. Which attribute must be added to an element to allow users to capture a photo directly from the device camera? A) capture="camera" B) accept="image/*"

Developer Ultimate Exam

C) capture="user" D) accept="camera/*" Answer: A Explanation: The capture attribute hints to the device that the file source should be the camera. Question 15. In the context of mobile web performance, what does “lazy loading” refer to? A) Downloading all assets after the page is fully rendered B) Loading images or resources only when they are about to enter the viewport C) Deferring JavaScript execution until the user clicks a button D) Compressing HTML before transmission Answer: B Explanation: Lazy loading delays loading of off-screen assets until they are needed, reducing initial page weight. Question 16. Which of the following is a valid way to register a Service Worker in JavaScript? A) navigator.serviceWorker.register('/sw.js'); B) window.registerServiceWorker('/sw.js'); C) document.serviceWorker.register('/sw.js'); D) serviceWorker.register('/sw.js'); Answer: A Explanation: The navigator.serviceWorker.register() method registers a Service Worker script. Question 17. Which CSS technique is recommended for creating high-resolution icons that scale on any device? A) Using bitmap PNG images B) Using SVG (Scalable Vector Graphics) C) Using CSS background-position sprites D) Using GIF animations Answer: B

Developer Ultimate Exam

Question 21. Which HTML5 element is used to define a group of related form controls? A) B) C) D) Answer: B Explanation: semantically groups related controls and can include a caption. Question 22. Which of the following is a correct way to declare a variable that cannot be reassigned in ES6? A) var name = "John"; B) let name = "John"; C) const name = "John"; D) immutable name = "John"; Answer: C Explanation: const creates a read-only binding; the identifier cannot be reassigned after initialization. **Question 23. What is the main advantage of using the defer attribute on a

Developer Ultimate Exam

B) word-spacing C) line-height D) text-indent Answer: C Explanation: line-height sets the vertical distance between baselines of consecutive lines of text. Question 25. Which of the following is a valid JSON value? A) {name: "Alice"} B) ["apple", "banana", 3] C) {'key': 'value'} D) Answer: B Explanation: JSON requires double-quoted keys and strings; array syntax with double-quoted strings is valid. **Question 26. Which HTTP status code indicates that a resource has been moved permanently?** A) 302 B) 301 C) 307 D) 404 Answer: B Explanation: 301 Moved Permanently tells clients to update bookmarks and caches to the new URL. **Question 27. What is the purpose of the tag?** A) Enables the web app to be added to the Android home screen B) Allows the site to run in full-screen mode when saved to an iOS home screen C) Disables all JavaScript on iOS devices D) Forces the device to use landscape orientation only Answer: B

Developer Ultimate Exam

Question 31. Which HTML5 element is designed to embed an interactive map or other external content that requires a plugin? A) B) C) D) Answer: C Explanation: creates an inline frame that can embed external pages, maps, or other interactive content. Question 32. Which JavaScript API provides access to the device’s accelerometer data? A) DeviceMotionEvent B) Geolocation API C) Battery Status API D) Screen Orientation API Answer: A Explanation: DeviceMotionEvent delivers acceleration and rotation rate information from the device’s sensors. Question 33. Which of the following HTTP headers is used to specify the MIME type of a resource? A) Content-Type B) Accept C) Authorization D) User-Agent Answer: A Explanation: Content-Type communicates the media type (e.g., text/html, application/json) of the response body. Question 34. In a PWA manifest file, which property defines the name displayed under the app icon on the home screen? A) short_name B) display

Developer Ultimate Exam

C) name D) icons Answer: C Explanation: The name property provides the full app name; short_name is used when space is limited. Question 35. Which CSS property creates a drop shadow effect for a box, often used to give depth to mobile UI elements? A) box-shadow B) text-shadow C) filter: blur() D) border-style: outset Answer: A Explanation: box-shadow adds a shadow around the element’s frame, enhancing visual hierarchy. Question 36. Which JavaScript function is used to store a key/value pair in localStorage? A) localStorage.addItem(key, value) B) localStorage.setItem(key, value) C) localStorage.store(key, value) D) localStorage.put(key, value) Answer: B Explanation: setItem() stores the value under the specified key in the browser’s local storage. Question 37. Which attribute on an element tells browsers to open the link in a new browsing context? A) target="_self" B) rel="external" C) target="_blank" D) href="_new" Answer: C

Developer Ultimate Exam

Question 41. Which CSS pseudo-class matches an element that is the first child of its parent? A) :first-of-type B) :first-child C) :only-child D) :first-line Answer: B Explanation: :first-child selects an element that is the first child within its parent element. Question 42. In the context of mobile accessibility, what does the ARIA attribute aria-label provide? A) A visual tooltip for sighted users B) A programmatic label for screen readers when there is no visible text C) A CSS class name for styling D) A data attribute for analytics Answer: B Explanation: aria-label gives an accessible name to elements lacking visible text, improving screen-reader navigation. Question 43. Which of the following is the correct way to attach a click handler to a button with id submitBtn using jQuery? A) $('#submitBtn').on('click', function(){ /.../ }); B) document.getElementById('submitBtn').click(function(){ /.../ }); C) $('#submitBtn').click = function(){ /.../ }; D) $('#submitBtn').addEventListener('click', function(){ /.../ }); Answer: A Explanation: jQuery’s on() method registers an event listener; the selector correctly targets the element by id. Question 44. Which HTML attribute enables a form to be submitted using HTTP PUT instead of the default POST? A) method="put" B) action="PUT"

Developer Ultimate Exam

C) method="PUT" D) http-method="PUT" Answer: C Explanation: The method attribute accepts GET, POST, PUT, DELETE, etc., when the server supports them. Question 45. What is the purpose of the prefetch value for the element? A) Immediately executes the linked script B) Hints the browser to download the resource with low priority for future use C) Blocks rendering until the resource is fetched D) Deletes the resource from cache after use Answer: B Explanation: prefetch tells the browser to fetch the resource in the background for anticipated navigation, without blocking current rendering. Question 46. Which JavaScript method creates a deep copy of an object, preserving nested structures? A) Object.clone(obj) B) JSON.parse(JSON.stringify(obj)) C) obj.copy() D) Object.assign({}, obj) Answer: B Explanation: Serializing to JSON and back creates a new object with copies of nested values, effectively a deep clone (limitations aside). Question 47. Which CSS property defines the space between columns in a CSS Grid layout? A) grid-gap B) column-gap C) grid-column-gap D) gap Answer: D

Developer Ultimate Exam

Question 51. What does the CSS @media (orientation: portrait) media query target? A) Devices with a width greater than height B) Devices with a height greater than width C) Only tablets in landscape mode D) Only phones in portrait mode Answer: B Explanation: orientation: portrait matches when the viewport height exceeds its width. Question 52. Which JavaScript API allows a web app to read the device’s battery level? A) BatteryStatus API (navigator.getBattery()) b) PowerManager API c) DevicePower API d) Battery API (navigator.battery) Answer: A Explanation: navigator.getBattery() returns a promise that resolves to a BatteryManager object containing level, charging status, etc. Question 53. Which CSS technique reduces the number of HTTP requests by combining multiple images into a single file? A) Data URIs B) Sprites C) Lazy loading D) Minification Answer: B Explanation: Image sprites merge several graphics into one file; CSS background-position displays the needed portion. Question 54. In a Service Worker, which event is used to intercept network requests? A) install B) activate

Developer Ultimate Exam

C) fetch D) message Answer: C Explanation: The fetch event fires for each network request, allowing the Service Worker to respond with cached or custom responses. Question 55. Which attribute on a element forces the browser to validate fields before submission? A) novalidate b) validate="true" c) required d) autocomplete="on" Answer: C (Trick question – actually each input uses required; the form itself does not have a validate attribute. The correct answer is that individual inputs use required to trigger validation.) Explanation: Adding required to input elements triggers built-in HTML5 validation; there is no validate attribute on . Question 56. Which of the following is a correct way to declare a CSS custom property (variable) for primary color? A) --primary-color: #336699; B) $primary-color: #336699; C) color-primary = #336699; D) primary-color: #336699; Answer: A Explanation: CSS variables start with two hyphens and are defined within a selector (commonly :root). Question 57. Which JavaScript method is used to convert a NodeList returned by document.querySelectorAll() into an actual Array? A) Array.from(nodeList) B) nodeList.toArray() c) [].slice.call(nodeList) d) Both A and C are valid

Developer Ultimate Exam

Question 61. Which JavaScript API provides a way to detect when a user’s network connection changes (e.g., from Wi-Fi to cellular)? A) Network Information API (navigator.connection) b) Connectivity API (navigator.connect) c) Online/Offline Events (window.ononline) d) Both A and C are usable Answer: D Explanation: navigator.connection exposes details like effective type, while the online/offline events fire on connectivity changes. Question 62. Which CSS rule will hide an element visually but keep it accessible to screen readers? A) display: none; b) visibility: hidden; c) position: absolute; left: -9999px; d) opacity: 0; Answer: C Explanation: Moving an element off-screen keeps it in the accessibility tree, whereas display:none or visibility:hidden remove it. Question 63. In the context of jQuery Mobile, what does the data- enhance="false" attribute do? A) Disables all JavaScript on the page b) Prevents jQuery Mobile from automatically enhancing the element’s markup c) Forces a page reload after navigation d) Enables a dark theme for the element Answer: B Explanation: Setting data-enhance="false" tells jQuery Mobile to leave the element untouched, useful for custom widgets. Question 64. Which of the following is a valid way to declare a function that returns a promise using async/await syntax? A) async function fetchData(){ return await fetch(url); }

Developer Ultimate Exam

b) function fetchData(){ return new Promise(); } c) async fetchData(){ await fetch(url); } d) function async fetchData(){ await fetch(url); } Answer: A Explanation: The async keyword before a function enables await inside; the function automatically returns a promise. Question 65. Which CSS property can be used to create a circular button with equal width and height? A) border-radius: 50%; b) shape-outside: circle(); c) clip-path: circle(); d) Both A and C can achieve a circular visual effect Answer: D Explanation: border-radius:50% makes a square element circular, while clip- path:circle() can also mask any shape to a circle. Question 66. Which HTML5 element is appropriate for grouping a set of related form controls and their labels? A) b) c) d) All of the above, but is the most semantic Answer: D Explanation: While any container can be used, provides semantic grouping and works with . Question 67. Which JavaScript method is used to add a new element to the end of an array? A) push() b) append() c) add() d) concat()