This is the kind of question that sounds easy until you're actually mid-explanation and realize you're not sure where to stop.
Start by explaining the core problem React Native solves—running JavaScript logic while rendering native UI—then contrast the old and new architectures in terms of threading, bridge, and rendering. Emphasize how the new architecture (Fabric, TurboModules, JSI) addresses performance bottlenecks and enables synchronous, more direct communication.
Pro tip: Mention that the new architecture is already the default in recent React Native versions (0.76+), and that Kotak’s mobile apps likely benefit from faster startup and smoother interactions—showing you understand real-world impact.
Describe React Native as a framework that uses JavaScript to control native UI components, with a bridge historically connecting JS and native threads.
Cover the three threads (JS, Native/UI, Shadow), the asynchronous bridge, and the JSON serialization bottleneck that caused performance issues.
Explain JSI (JavaScript Interface) as a replacement for the bridge, enabling direct C++ communication and synchronous calls.
Fabric is the new rendering system that uses C++ and allows synchronous layout; TurboModules enable lazy loading and direct native module access via JSI.
Highlight improved performance, startup time, and concurrency, but note migration complexity and the need for native code updates.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
They opened a shared online editor and just...
Start by clarifying requirements and constraints, then outline a component-based architecture with a controlled search input and a filtered list. Discuss state management, performance optimizations like debouncing and memoization, and trade-offs between client-side and server-side filtering. Finally, walk through the implementation in the live editor, explaining your choices as you code.
Pro tip: Mention that you would debounce the search input to avoid excessive re-renders or API calls, and use a case-insensitive filter with a clear empty state. This shows you think about both performance and user experience.
Ask about data size, whether filtering should be client-side or server-side, and any UI/UX expectations. This ensures you build the right solution and demonstrates thoroughness.
Outline a parent component holding the search term and item list state, with a controlled input and a child list component. Explain how state flows and updates.
Write a filter function that matches items against the search term (case-insensitive, possibly using includes or startsWith). Discuss whether to filter on every keystroke or debounce.
Apply debouncing to the search input, memoize the filtered list, and consider virtualization for long lists. Explain the trade-offs of each optimization.
Mention testing with empty search, no results, special characters, and large datasets. Ensure the UI provides feedback for loading and empty states.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
Start by clarifying the requirements: what constitutes a valid URL, how to handle query parameters, and what graceful handling means (e.g., return error, log, or throw exception). Then outline a solution using a URL parsing library (like Python's urllib.parse or JavaScript's URL API) to validate and manipulate the URL, with try-catch for invalid cases. Finally, discuss edge cases and testing strategy.
Pro tip: Mention that you would use a well-tested library rather than writing a regex from scratch, as regex for URL validation is error-prone and hard to maintain. Also, emphasize the importance of not leaking sensitive information in error messages when handling invalid URLs.
Ask questions to understand what defines a valid URL (e.g., must have scheme and host, allow relative URLs?), what query parameters to append, and what 'gracefully' means (return null, throw custom exception, log error?).
Decide whether to use built-in URL parsers (e.g., Python's urllib.parse, JavaScript's URL) or a library. Explain why this is more reliable than regex.
Write a function that attempts to parse the URL; if successful, append query parameters using the parser's API; if parsing fails, handle the error gracefully (e.g., return a default value or log).
Consider cases like missing scheme, malformed query strings, duplicate parameters, and ensure the function doesn't crash. Discuss how to handle them.
Outline test cases: valid URL with/without existing query, invalid URL, empty string, etc. Mention unit testing and possibly property-based testing.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.