Skip to main content

Posts

Showing posts with the label Java interview questions

40 Redis interview questions for 2021 - 2022

  Redis interview questions 1.What is Redis?. 2. What is the data type of Redis? 3. What are the benefits of using Redis? 4. What are the advantages of Redis over Memcached? 5. What are the differences between Memcache and Redis? 6. Is Redis single-process and single-threaded? 7. What is the maximum storage capacity of a string type value? 8. What is the persistence mechanism of Redis? Their advantages and disadvantages? 9. Redis common performance problems and solutions: 10. What is the deletion strategy of redis expired keys? 11. Redis recycling strategy (elimination strategy)? 12. Why does edis need to put all data in memory? 13. Do you understand the synchronization mechanism of Redis? 14. What are the benefits of Pipeline? Why use pipeline? 15. Have you used Redis cluster? What is the principle of cluster? 16. Under what circumstances will the Redis cluster solution cause the entire cluster to be unavailable? 17. What are the Java clients supp...

100 latest Java interview questions and answers. What are most common interview question in java ?

 100 latest Java interview questions, a summary of common interview questions and answers  

What are the differences between react and vue? What is mvvm and what is the difference principle of mvc ? What is a closure, how to use it, and why to use it? What is margin overlap problem and the solution ?

 What are the differences between react and vue?  Similarities between react and vue ·  Both support server-side rendering All  have Virtual DOM, component development, pass the parent and child component data through props parameters, and all implement the webComponent specification ·  Data Driven View ·  Have native support for the program, React's React native, Vue's weex   Differences between react and vue   ·  React strictly only for the MVC view layer, Vue is the MVVM pattern The  virtual DOM is different. Vue will track the dependencies of each component and does not need to re-render the entire component tree. For React, every time the state of the application is changed, all components will be re-rendered, so it will be required in React. shouldComponentUpdate is a life cycle function method to control The  component writing method is different. The recommended method of React is JSX + inline style, whic...

What are concept of physical address, logical address, and virtual memory in Java ? What are the page replacement algorithms in Java? What are dynamic link libraries and static link libraries in Java?

 What are concept of physical address, logical address, and virtual memory in Java ? 1. Physical address: It is the final address of the address conversion. When the process executes instructions and accesses data when it is running, it must be accessed from the main memory through the physical address. It is the real address of the memory unit. 2. Logical address: refers to the address seen by computer users. For example: when creating an integer array with a length of 100, the operating system returns a logically continuous space: the pointer points to the memory address of the first element of the array. Since the size of the integer element is 4 bytes, the address of the second element is the starting address plus 4, and so on. In fact, the logical address is not necessarily the real address where the element is stored, that is, the physical address of the array element (the location in the memory bar). It is not continuous, but the operating system maps the logical address int...

What is a deadlock?The reason for the deadlock? What are the necessary conditions for deadlock? How to remove the deadlock? What is the difference between paging and segmentation?

 What is a deadlock? Deadlock refers to a stalemate caused by multiple processes competing for resources during operation. When the processes are in this stalemate, if there is no external force, they will not be able to move forward.   The reason for the deadlock? Because there are some inalienable resources in the system, and when two or more processes occupy their own resources and request each other's resources, each process will not be able to move forward, which is a deadlock.  A.  Competing resources For example: there is only one printer in the system that can be used by process A. Assuming that A has occupied the printer, if B continues to request the printer to print, it will be blocked.  The resources in the system can be divided into two categories: Deprivable resources: After a process obtains such resources, the resources can be deprived by other processes or systems. Both CPU and main memory are deprived resources; Inalienable reso...

What is Lock splitting technique in Java? Which technique is used in ReadWriteLock class for reducing Lock contention in Java? Java interview

  What is Lock splitting technique? Lock splitting is a technique to reduce Lock contention in multithreading.  It is applicable in scenario when one lock is used to synchronize access to different aspects of the same application. Sometimes we put one lock to protect the whole array. There can be multiple threads trying to get the lock for same array.  This single lock on array can cause Lock contention among threads.  To resolve this we can give one lock to each element of the array. Or we can use modulus function to assign different locks to a small group of array elements.  In this way we can reduced the chance of Lock contention. This is Lock splitting technique. Which technique is used in ReadWriteLock class for reducing Lock contention? ReadWriteLock uses two locks. One lock for read-only operations, another lock for write operations. Its implementation is based on the premise that concurrent threads do not need a lock when they want to read a value while ...