Trantor
10+ Hero MotoCorp Interview Questions and Answers
Q1. What is difference between permission set and profile
Permission sets are used to extend user permissions beyond what is granted by their profile.
Profiles control overall access to objects, fields, and records for a user
Permission sets grant additional permissions or access to specific objects, fields, or records
Users can have multiple permission sets but only one profile
Q2. What memoization techniques are you familiar with?
Memoization techniques involve storing the results of expensive function calls and returning the cached result when the same inputs occur again.
Using a hash table to store previously computed results
Implementing memoization with dynamic programming
Memoizing recursive functions to avoid redundant calculations
Q3. What are HOC in react? Implement a HOC from scratch.
HOC (Higher Order Components) in React are functions that take a component and return a new component with additional functionality.
HOCs are a common pattern in React for code reuse, logic abstraction, and separation of concerns.
They are used to enhance components with additional props, state, or lifecycle methods.
Example: Creating a HOC that adds a loading spinner while data is being fetched from an API.
Q4. Write a generic button component for React?
A generic button component for React
Create a Button component with props for text, onClick function, and optional styles
Use React's useState hook to manage button state if needed
Implement onClick handler to trigger a function when button is clicked
Allow for customization of button styles using props
Q5. Write a program using recursion.
Program using recursion
Recursion is a technique where a function calls itself
It is useful for solving problems that can be broken down into smaller subproblems
Base case is important to avoid infinite recursion
Examples: factorial, fibonacci, binary search
Q6. Difference between NACL and security group
NACL is a stateless firewall at the subnet level, while security groups are stateful firewalls at the instance level.
NACL operates at the subnet level, controlling inbound and outbound traffic based on rules.
Security groups operate at the instance level, controlling inbound and outbound traffic based on rules.
NACL is stateless, meaning it does not keep track of the state of connections.
Security groups are stateful, meaning they keep track of the state of connections.
NACL rule...read more
Q7. Permission set vs profile
Permission set vs profile
Profiles control overall access to objects, fields, and records for a user
Permission sets grant additional permissions or access to specific objects or fields
Profiles are assigned to users at the user level, while permission sets can be assigned to multiple users
Q8. Given Kotlin extension function what could be the output.
Kotlin extension functions allow adding new functions to existing classes without modifying their source code.
Extension functions are defined outside the class they extend.
They can be called on the object of the class they extend.
They can access the properties and functions of the class they extend.
Q9. What is higher order function.
A higher order function is a function that can take other functions as parameters or return functions as results.
Higher order functions can be used to create more flexible and reusable code.
They can be used to implement callbacks, event handling, and functional programming concepts.
Example: map, filter, and reduce functions in JavaScript are higher order functions.
Q10. What is fragment and uses.
Fragments are modular sections of an activity's user interface, allowing for more flexible and dynamic UI designs.
Fragments can be reused across multiple activities
They help in creating responsive UIs for different screen sizes
Fragments can be added or removed dynamically during runtime
They are useful for implementing multi-pane layouts on tablets
Q11. Explain Activity lifecycle methods.
Activity lifecycle methods are a set of methods that are called at different stages of an activity's life cycle.
onCreate() - called when the activity is first created
onStart() - called when the activity is becoming visible to the user
onResume() - called when the activity will start interacting with the user
onPause() - called when the activity is going into the background, but still visible
onStop() - called when the activity is no longer visible to the user
onDestroy() - called...read more
Top HR Questions asked in Hero MotoCorp
Interview Process at Hero MotoCorp
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month