Visa
20+ Nirman Consultants Interview Questions and Answers
Q1. Given a grid containing 0s and 1s and source row and column, in how many ways, could we reach form source to target. ( 1's represents a blockade and 0's represent accessable points)
Count the number of ways to reach target from source in a grid with 0s and 1s.
Use dynamic programming to solve the problem efficiently.
Traverse the grid using DFS or BFS to count the number of ways.
Consider edge cases like when source and target are the same or when there is no path.
Example: Given grid = [[0,0,0],[0,1,0],[0,0,0]], source = (0,0), target = (2,2), answer is 2.
Example: Given grid = [[0,1],[0,0]], source = (0,0), target = (1,1), answer is 1.
Q2. how does ajax call work
Ajax calls allow for asynchronous communication between client and server without reloading the page.
Ajax stands for Asynchronous JavaScript and XML
Uses XMLHttpRequest object to send and receive data
Allows for partial page updates without reloading the entire page
Can handle data in various formats such as JSON, XML, HTML, and plain text
Example: $.ajax({url: 'example.com', success: function(data){console.log(data)}});
Q3. 1. High Level System Design -> Design Uber like Service. Follow up -> What would be your tech stack for designing such a service to make sure it could scale when needed.
Tech stack for designing a scalable Uber-like service.
Use microservices architecture for scalability and fault tolerance.
Choose a cloud provider with auto-scaling capabilities.
Use a load balancer to distribute traffic across multiple instances.
Use a NoSQL database for high availability and scalability.
Use message queues for asynchronous communication between services.
Use containerization for easy deployment and management.
Use caching to improve performance.
Use monitoring and ...read more
Q4. how do you create immutable in java
Creating immutable in Java
Use final keyword to make variables immutable
Use private constructor to prevent object modification
Use defensive copying to prevent modification of mutable objects
Use enum to create immutable objects
Use String class to create immutable strings
Q5. where have you used immutable in java
Immutable is used in Java to create objects whose state cannot be changed after creation.
Immutable objects are thread-safe and can be shared without the risk of data corruption.
Examples of immutable classes in Java include String, Integer, and LocalDate.
Immutable objects can be created using the final keyword, constructor initialization, and static factory methods.
Q6. (HLD) -> Design a service which combines multiple sources of data/documentation and aggregates it such that all info is available centrally.
Design a service to aggregate multiple sources of data/documentation centrally.
Identify sources of data/documentation
Determine data aggregation method
Design a centralized database to store aggregated data
Develop a user-friendly interface to access the data
Ensure data security and privacy
Q7. what is observer pattern
Observer pattern is a design pattern in which an object maintains a list of its dependents and notifies them automatically of any state changes.
Also known as publish-subscribe pattern
Used in event-driven systems
Allows loose coupling between objects
Example: A weather station broadcasts weather updates to multiple displays
Example: A stock market ticker notifies multiple investors of stock price changes
Q8. difference between REST and SOAP
REST is lightweight and uses HTTP while SOAP is XML-based and has more features.
REST uses HTTP methods like GET, POST, PUT, DELETE while SOAP uses XML messaging.
REST is stateless while SOAP can maintain state.
REST is faster and easier to use while SOAP is more secure and reliable.
REST is used for web services while SOAP is used for enterprise-level services.
Example of REST: Twitter API. Example of SOAP: Amazon Web Services.
Q9. what is immutable in java
Immutable in Java refers to objects whose state cannot be changed after creation.
String, Integer, and other wrapper classes are immutable in Java.
Immutable objects are thread-safe and can be shared without synchronization.
To create an immutable class, make all fields final and private, and don't provide setters.
Examples of immutable classes in Java include LocalDate, LocalTime, and LocalDateTime.
Q10. what is dependency injection
Dependency injection is a design pattern that allows objects to receive dependencies rather than creating them internally.
It helps to decouple the code and makes it more testable and maintainable.
It allows for easier swapping of dependencies without changing the code.
There are three types of dependency injection: constructor injection, setter injection, and interface injection.
Example: Instead of creating a database connection object inside a class, the object is passed as a ...read more
Q11. what is GET and POST
GET and POST are HTTP methods used for sending data to a server.
GET is used to retrieve data from a server
POST is used to submit data to a server
GET requests can be cached and bookmarked
POST requests are not cached and cannot be bookmarked
GET requests have length restrictions
POST requests have no length restrictions
GET requests are less secure than POST requests
Q12. what is CORS
CORS stands for Cross-Origin Resource Sharing. It is a security feature implemented in web browsers to restrict access to resources from different origins.
CORS allows web servers to specify which origins are allowed to access its resources
It is implemented using HTTP headers
CORS prevents malicious websites from accessing sensitive data from other websites
Examples of resources that may be restricted by CORS include cookies, scripts, and APIs
Q13. what is singleton
Singleton is a design pattern that restricts the instantiation of a class to a single object.
Singleton ensures that only one instance of a class exists in the entire application.
It provides a global point of access to the instance.
Commonly used in scenarios where a single instance needs to coordinate actions across the system.
Example: Database connection manager, logger, configuration manager.
Q14. Given a monolith architecture, how would you scale it to handle 3x the traffic and also improve response time on API's during peak hours by using cache
To scale a monolith architecture and improve response time, use horizontal scaling and implement caching.
Implement horizontal scaling by adding more instances of the monolith application behind a load balancer
Use a distributed cache to store frequently accessed data and reduce database queries
Implement caching at different levels such as application-level caching, database query caching, and HTTP response caching
Use a caching strategy based on the data access patterns and exp...read more
Q15. Given two sorted arrays, a (m elements, size m+n) and b (n elements, size n) merge both the arrays into the first array a.
Merge two sorted arrays into the first array
Start from the end of both arrays and compare elements
Place the larger element at the end of the first array
Continue this process until all elements are merged
Q16. Class design for a cache implementation, implement get(), put(), initialization methods
Design a cache class with get(), put(), and initialization methods.
Define a class with a data structure to store key-value pairs.
Implement a get() method to retrieve a value from the cache based on a given key.
Implement a put() method to add or update a key-value pair in the cache.
Implement an initialization method to set the initial capacity and eviction policy of the cache.
Consider using a hash map or a linked list to store the key-value pairs efficiently.
Handle cache size ...read more
Q17. how to implement timer
A timer can be implemented using a combination of system time and a loop that checks for elapsed time.
Get the current system time at the start of the timer
Enter a loop that continuously checks the difference between the current system time and the start time
When the desired time has elapsed, perform the desired action or trigger an event
Q18. how to implement useEffect
useEffect is a hook in React that allows you to perform side effects in functional components.
useEffect is used to handle side effects in React components.
It takes two arguments: a function and an optional array of dependencies.
The function inside useEffect is executed after the component renders.
The optional array of dependencies determines when the effect should run.
If the array of dependencies is empty, the effect runs only once after the initial render.
If the array of dep...read more
Q19. Built a react feature
Built a react feature
Identify the specific feature to be built
Design the component hierarchy and state management
Implement the feature using React components and hooks
Test the feature for functionality and user experience
Refactor and optimize the code for performance
Q20. Do you know telecalling?
Yes, telecalling involves making phone calls to potential clients or customers to promote products or services.
Telecalling involves making outbound calls to potential customers or clients.
The goal of telecalling is to promote products or services, generate leads, or set up appointments.
Telecallers need to have good communication skills, be persuasive, and have a clear understanding of the product or service they are promoting.
Q21. Describe the VXLAN fabricand understand the under/overlay principles
VXLAN fabric is a virtualized network overlay technology that enables the extension of Layer 2 networks over Layer 3 networks.
VXLAN stands for Virtual Extensible LAN
It uses a 24-bit VNID (VXLAN Network Identifier) to uniquely identify each virtual network
VXLAN encapsulates Layer 2 Ethernet frames within Layer 3 UDP packets for transmission across the network
Underlay network provides the physical connectivity between VXLAN tunnel endpoints (VTEPs)
Overlay network is the logical...read more
Q22. Any plan for Post-graduation(M.S)
Yes, I plan to pursue a Master's degree after graduation.
I am currently researching different programs and universities for my post-graduation studies.
I plan to specialize in a specific field related to my undergraduate degree.
I am preparing for standardized tests required for admission, such as the GRE or GMAT.
I am also working on my personal statement and gathering letters of recommendation.
I am considering potential research topics or thesis ideas for my Master's program.
Q23. What is ip and Mac address.
IP address is a unique numerical label assigned to each device connected to a computer network, while MAC address is a unique identifier assigned to network interfaces for communications at the data link layer.
IP address stands for Internet Protocol address and is used for identifying devices on a network.
MAC address stands for Media Access Control address and is a unique identifier assigned to network interfaces.
IP address is a logical address, while MAC address is a physica...read more
More about working at Visa
Top HR Questions asked in Nirman Consultants
Interview Process at Nirman Consultants
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month