Sample questions
Question 1Easy
In modern React Native projects, which JavaScript engine is enabled by default?
- Hermes
- V8
- SpiderMonkey
- Chakra
Answer: A. Hermes
Explanation
Hermes is the default engine for new React Native projects. JavaScriptCore was the earlier default.
Step-by-step solution
- New React Native projects enable Hermes by default.
- JavaScriptCore was the earlier default engine.
- Option A is the correct answer.
Why the other options are wrong
- B. V8 is not the default engine for React Native projects.
- C. SpiderMonkey is not the default engine for React Native projects.
- D. Chakra is not the default engine for React Native projects.
Tip: Hermes is the default engine for new projects; check the engine setting if behaviour differs.
Question 2Easy
- A navigation library made for React Native
- A JS engine optimised for React Native
- A CSS framework for styling mobile screens
- A build server that compiles iOS apps
Answer: B. A JS engine optimised for React Native
Explanation
Hermes is an open-source JS engine built for running React Native apps efficiently on mobile devices.
Step-by-step solution
- Hermes is a JavaScript engine.
- It is built to run React Native apps efficiently on mobile devices.
- Option B is the correct answer.
Why the other options are wrong
- A. A navigation library is a different kind of package; Hermes runs JavaScript.
- C. Hermes is not a CSS framework.
- D. Hermes is not a build server.
Tip: Hermes runs the JavaScript of a React Native app; it does not handle navigation or styling.
Question 3Easy
Can Hermes be used on both Android and iOS?
- Yes, it runs on both platforms
- No, it is Android-only
- No, it is iOS-only
- Only inside Expo Go
Answer: A. Yes, it runs on both platforms
Explanation
Hermes started on Android but has supported iOS as well for a long time, so both platforms can share the same engine.
Step-by-step solution
- Hermes runs on both Android and iOS.
- Both platforms can share the same engine.
- Option A is the correct answer.
Why the other options are wrong
- B. Hermes is not Android-only.
- C. Hermes is not iOS-only.
- D. Hermes is not limited to Expo Go; it is an engine setting of the project.
Tip: Hermes is the same engine on both platforms, so it does not need a per-platform choice.
Question 4Easy
Which benefits is Hermes mainly designed to bring to React Native apps?
- Built-in navigation and state management
- Faster startup and lower memory use
- Automatic native UI for every web page
- Unlimited threads for running JavaScript
Answer: B. Faster startup and lower memory use
Explanation
Hermes targets time-to-interactive, memory use and app size, which matter most on mid- and low-end phones.
Step-by-step solution
- Hermes is designed to improve startup time, memory use and app size.
- These gains matter most on mid-range and low-end phones.
- Option B, faster startup and lower memory use, is the correct answer.
Why the other options are wrong
- A. Navigation and state management come from JavaScript libraries, not the engine.
- C. Hermes does not create native UI for web pages.
- D. Unlimited threads is not a Hermes feature.
Tip: Think of Hermes as a performance gain: faster start, less memory and a smaller app.
Question 5Medium
How does Hermes speed up app startup?
- It downloads the JS bundle lazily from a server
- It compiles JS to bytecode at build time
- It runs JavaScript inside the GPU at launch
- It skips running JavaScript until the first tap
Answer: B. It compiles JS to bytecode at build time
Explanation
With Hermes, parsing and compiling happen during the build. At launch the engine loads ready bytecode instead of parsing source code.
Step-by-step solution
- With Hermes, JavaScript is compiled to bytecode during the build.
- At launch the engine loads ready bytecode instead of parsing source code.
- Option B is the correct answer.
Why the other options are wrong
- A. Lazy download from a server is not how Hermes speeds up startup.
- C. JavaScript does not run on the GPU at launch.
- D. JavaScript still runs at launch; it is not skipped until a tap.
Tip: Hermes moves parsing and compiling from app launch to build time.
Question 6Medium
Which tool lets you debug JavaScript running in Hermes with breakpoints and a console?
- Android Studio's layout inspector only
- Xcode's Interface Builder
- Metro's bundle visualizer
- A Chrome DevTools-based debugger
Answer: D. A Chrome DevTools-based debugger
Explanation
Hermes speaks the Chrome DevTools Protocol, so DevTools-based debuggers (such as React Native DevTools) can attach to it.
Step-by-step solution
- Hermes speaks the Chrome DevTools Protocol.
- A DevTools-based debugger, such as React Native DevTools, can set breakpoints and show a console.
- Option D is the correct answer.
Why the other options are wrong
- A. Layout Inspector shows Android views, not JavaScript breakpoints.
- B. Interface Builder designs iOS layouts; it does not debug JavaScript.
- C. Metro is the bundler and does not provide breakpoints.
Tip: Use a DevTools-based debugger for breakpoints and the console when running Hermes.
Question 7Medium
What does a Hermes release build ship instead of plain JavaScript source?
- Hermes bytecode (.hbc)
- WebAssembly modules
- Native ARM machine code
- Minified TypeScript
Answer: A. Hermes bytecode (.hbc)
Explanation
The bundle is compiled to Hermes bytecode, which the engine loads directly and can memory-map.
Step-by-step solution
- Hermes precompiles JavaScript at build time.
- Release builds ship the bytecode as a .hbc bundle.
- This speeds up app start.
Why the other options are wrong
- B. Hermes does not use WebAssembly modules.
- C. It does not produce native machine code.
- D. TypeScript is compiled away before bundling.
Tip: Hermes = bytecode, fast start.
Question 8Medium
Which runtime check is commonly used to detect that an app is running on Hermes?
- typeof HermesInternal === 'object'
- Platform.engine === 'hermes'
- process.env.ENGINE === 'hermes'
- navigator.hermes === true
Answer: A. typeof HermesInternal === 'object'
Explanation
Hermes defines a global HermesInternal object. Checking for it is a common way to confirm the engine at runtime.
Step-by-step solution
- Hermes defines a global HermesInternal object.
- A typeof check on HermesInternal confirms the engine at runtime.
- So option A is the correct answer.
Why the other options are wrong
- B. Platform.engine is not a React Native API.
- C. process.env.ENGINE is not set by Hermes.
- D. navigator.hermes is not a flag that Hermes sets.
Tip: A typeof check on a global is a safe way to detect the engine at runtime.
Question 9Hard
Why is memory use often lower with Hermes than with engines that parse JS source at runtime?
- Hermes does not keep any objects on the heap
- Hermes stores all JS variables on the GPU
- Bytecode can be memory-mapped and loaded on demand
- Hermes deletes unused functions from the bundle at runtime
Answer: C. Bytecode can be memory-mapped and loaded on demand
Explanation
Precompiled bytecode can be mapped from the file and paged in as needed, rather than keeping parsed source and compiled code in RAM.
Step-by-step solution
- Engines that parse source at runtime keep parsed source and compiled code in RAM.
- Hermes bytecode can be memory-mapped from the file and loaded on demand.
- So option C is the correct answer.
Why the other options are wrong
- A. Hermes does keep objects on the heap, as any JavaScript engine does.
- B. JavaScript variables are not stored on the GPU.
- D. Hermes does not delete unused functions from the bundle at runtime.
Tip: Less parsed code held in memory means lower RAM use, which matters on low-end devices.
Question 10Hard
A crash report from a Hermes release build shows bytecode offsets instead of file and line numbers. What is needed to read it?
- A debug build, because release crashes cannot be read
- The source maps from that build, to symbolicate the trace
- The Swift compiler, to decompile the bytecode back
- Nothing; offsets already equal line numbers in the source
Answer: B. The source maps from that build, to symbolicate the trace
Explanation
Hermes stack traces refer to bytecode positions. Source maps generated with the build map them back to the original files and lines.
Step-by-step solution
- Hermes release crashes report bytecode offsets instead of file and line numbers.
- Source maps from the same build map those offsets back to files and lines.
- Use them to symbolicate the trace; option B is the correct answer.
Why the other options are wrong
- A. Release crashes can be read with the matching source maps.
- C. The Swift compiler does not decompile Hermes bytecode.
- D. Offsets are not line numbers, so a map is needed.
Tip: Keep the source maps from every release build so crashes can be read later.
Practise all 13 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →