Saviynt
DHL Supply Chain Interview Questions and Answers
Q1. What is the difference between normal function and arrow function?
Arrow functions are more concise and have lexical scoping, while normal functions have their own 'this' value.
Arrow functions do not have their own 'this' value, they inherit it from the parent scope.
Arrow functions are more concise and have implicit return.
Normal functions are more flexible and can be used as constructors.
Arrow functions cannot be used as constructors.
Arrow functions do not have 'arguments' object.
Q2. Given a counter code in class component, convert it to functional component
Convert a counter code from class component to functional component
Use useState hook to manage state in functional component
Remove 'this' keyword and constructor from the code
Update event handlers to use arrow functions or useCallback hook
Q3. Write a code in react to post some data to a public url
Code snippet to post data to a public URL in React
Use the fetch API to make a POST request to the public URL
Convert the data to JSON before sending it in the request body
Handle the response from the server accordingly
Q4. Map two array of objects and display the results in lists using react
Map two arrays of objects and display results in lists using React
Use the map function to iterate over each array of objects
Render the results in separate lists using JSX
Example: array1.map(item =>
- {item.name} )
Q5. What is CORS in web development?
CORS stands for Cross-Origin Resource Sharing and is a security feature implemented by browsers to prevent unauthorized access to resources on a different domain.
CORS allows servers to specify who can access their resources by adding specific HTTP headers to their responses.
It is used to protect against cross-site request forgery (CSRF) attacks.
For example, if a frontend application on domain A tries to make a request to a backend API on domain B, CORS will block the request ...read more
Q6. Call stack and heap difference?
Call stack stores function calls and local variables, while heap stores dynamic memory allocation.
Call stack is used for function calls and local variables
Heap is used for dynamic memory allocation
Call stack is limited in size and has a fixed memory allocation, while heap is larger and can grow dynamically
Example: Call stack is used to keep track of function calls in a recursive function, while heap is used to allocate memory for objects
Interview Process at DHL Supply Chain
Top React Js Frontend Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month