InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How to make your React Native app feel smooth on animations ? |
|
Answer» The primary reason and an important one why well-built NATIVE apps feel so smooth are by avoiding expensive operations during interactions and animations. REACT Native has a limitation that there is only a single JS execution thread, but you can use InteractionManager to MAKE sure long-running work is scheduled to start after any interactions/animations have completed. Applications can schedule tasks to run after interactions with the following: InteractionManager.runAfterInteractions(() => { // ...long-running SYNCHRONOUS TASK...}); |
|
| 2. |
Explain setNativeProps. Does it create Performance issues and how is it used ? |
|
Answer» It is sometimes necessary to make changes directly to a component without using state/props to trigger a re-render of the entire SUBTREE. When using REACT in the browser, for example, you sometimes NEED to directly modify a DOM node, and the same is true for views in mobile apps. setNativeProps is the React Native equivalent to setting properties directly on a DOM node. |
|
| 3. |
What is Network Security and SSL Pinning? |
|
Answer» Understanding of SSL: SSL (Secure Sockets Layer) and its successor, TLS (Transport Layer Security), are protocols for establishing authenticated and encrypted links between networked computers. One of the inherent risks to the SSL ecosystem is mis-issuance. This is when an unauthorized certificate is issued for a domain/host you control. This can happen with both public and private PKIs (Public Key Infrastructure)
With SSL pinning, however, the application is configured to reject all but one or few predefined certificates, whenever the application connects to a server, it compares the server certificate with the pinned certificate(s) , if and only if they match the server is trusted and SSL connection is established. |
|
| 4. |
Is there any out of the box way storing sensitive data in React ? If yes which and if not how can this be achieved ? |
|
Answer» React Native does not come bundled with any way of storing sensitive data. However, there are pre-existing solutions for Android and iOS platforms. iOS - Keychain Services
|
|
| 5. |
Describe Memory leak Issue in React Native , how can it be detected and resolved ? |
|
Answer» In JavaScript memory is managed automatically by Garbage Collector (GC). In short, Garbage Collector is a background process that periodically traverses the graph of allocated objects and their references. If it happens to ENCOUNTER a part of the graph that is not being referenced directly or indirectly from root objects (e.g., VARIABLES on the stack or a global object like window or navigator) that WHOLE part can be deallocated from the memory.
Detecting memory leaks for IOS: |
|
| 6. |
List down some of the steps to optimize the application. |
Answer»
|
|
| 7. |
What’s the real cause behind performance issues in React Native ? |
|
Answer» The real cause behind React Native performance ISSUES is that each thread (i.e Native and JS thread) is blazingly fast. The performance bottleneck in React Native app occurs when you’re passing the components from ONE thread to another unnecessarily or more than required. A MAJOR thumb rule to avoid any kind of performance-related issue in React Native is to keep the PASSES over the bridge to a minimum.
|
|