Oneture Technologies
Haryana Police Interview Questions and Answers
Q1. How react props work
React props are used to pass data from parent to child components in React applications.
Props are read-only and cannot be modified by the child component
Props are passed down from parent to child components
Props can be accessed using this.props in class components or props in functional components
Q2. React state and their use
React state is used to store and manage data within a component.
State is used to store data that can change over time within a component
State can be initialized in the constructor using this.state
State can be updated using this.setState() method
State changes trigger re-rendering of the component
Q3. Redux working and use
Redux is a predictable state container for JavaScript apps, commonly used with React for managing application state.
Redux helps manage the state of an application in a predictable way
It uses a single immutable state tree which can only be changed by emitting actions
Reducers are pure functions that specify how the state changes in response to actions
Redux is commonly used with React to manage the state of components
Q4. Write code for reading file in node js
Reading a file in Node.js involves using the 'fs' module to open and read the contents of the file.
Use the 'fs' module's 'readFile' method to read the contents of a file asynchronously.
Pass the file path and encoding as parameters to the 'readFile' method.
Handle the file contents in the callback function provided to the 'readFile' method.
Q5. Write CRUD APIs for a sample data
Creating CRUD APIs for sample data in a MERN stack application
Create a POST API to add new data
Create a GET API to retrieve all data
Create a GET API to retrieve data by ID
Create a PUT API to update data by ID
Create a DELETE API to delete data by ID
Q6. Framework used in last project
I used React.js as the framework in my last project.
React.js is a popular JavaScript library for building user interfaces.
It allows for the creation of reusable UI components.
React.js uses a virtual DOM for efficient rendering.
Example: I used React.js to build a dynamic dashboard for tracking sales data.
Q7. Explain the framework structure
Framework structure refers to the organization of code, libraries, and tools used in automation testing.
Framework structure typically includes folders for test scripts, test data, configuration files, and reusable components.
It also involves defining the hierarchy of test cases, setting up test suites, and implementing reporting mechanisms.
Common types of frameworks include data-driven, keyword-driven, and hybrid frameworks.
Example: In a data-driven framework, test data is se...read more
Q8. Explain the basic coding standards
Basic coding standards are guidelines that help ensure code quality, readability, and maintainability.
Consistent indentation for readability
Meaningful variable and function names
Proper commenting for clarity
Use of design patterns for scalability
Adherence to naming conventions like camelCase or snake_case
Interview Process at Haryana Police
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month