Walmart
20+ Shree Laljee Prashikshan Kendra Interview Questions and Answers
Ninja is given an integer ‘N’. One day Ninja decides to do the sum of all digits and replace the ‘N’ with the sum of digits until it becomes less than 10. Ninja wants to find what will be the value...read more
You have been given a string STR and a non-empty string PTR. Your task is to find all the starting indices of PTR’s anagram in STR.
An anagram of a string is another string which contains the s...read more
Q3. How to generate an unique id for a massive parallel system?
An unique id for a massive parallel system can be generated using a combination of timestamp, machine id and a random number.
Use a timestamp to ensure uniqueness
Include a machine id to avoid collisions in a distributed system
Add a random number to further increase uniqueness
Consider using a UUID (Universally Unique Identifier) for simplicity
Ensure the id generation algorithm is thread-safe
Q4. How instagram application works. If someone tagged you how you will get notification and how those reels are showing in your profile page...etc.
Instagram uses a notification system to alert users when they are tagged and displays reels on the profile page based on user preferences and algorithms.
Instagram uses a push notification system to alert users when they are tagged in a post or story.
Reels are displayed on the profile page based on user engagement, preferences, and algorithms.
The Explore page also suggests reels to users based on their interests and interactions on the platform.
Q5. How OLA application works. How CAB moves on map?
OLA application uses GPS to track cabs on map and assign them to customers based on location and availability.
OLA application uses GPS technology to track the location of cabs in real-time.
Customers input their location and destination in the app to request a cab.
The app matches the customer with the nearest available cab and assigns it to them.
Customers can track the cab's movement on the map in real-time as it approaches their location.
Q6. Linked list implementation with second largest and second smallest
Implement a linked list with methods to find the second largest and second smallest elements.
Create a linked list class with methods to insert elements, find second largest, and find second smallest.
Traverse the linked list to find the largest and smallest elements, then find the second largest and second smallest.
Handle edge cases such as empty list or lists with less than 2 elements.
Consider using a priority queue to efficiently find the second largest and second smallest e...read more
Q7. Different method to invoke methode with using constructor or variable
You can invoke a method using a constructor by creating an instance of the class and calling the method, or by using a variable that holds a reference to the method.
Invoke method using constructor: ClassName obj = new ClassName(); obj.methodName();
Invoke method using variable: ClassName obj = new ClassName(); Runnable r = obj::methodName; r.run();
Q8. How can fragments communicate among themselves
Fragments can communicate among themselves using interfaces, shared view models, and activity callbacks.
Use interfaces to define communication contract between fragments
Implement the interface in the hosting activity and pass it to the fragments
Use shared view models to share data between fragments
Use activity callbacks like onActivityResult() to communicate between fragments
Q9. Design HLD and LLD of Zomato
Design HLD and LLD of Zomato
High-Level Design (HLD) should include the overall architecture of the system, including components and their interactions
Low-Level Design (LLD) should include detailed design of each component, including data structures, algorithms, and interfaces
HLD should consider scalability, availability, and fault tolerance
LLD should consider performance, security, and maintainability
Example components of Zomato system: user interface, search engine, recommen...read more
Q10. Design uber both rider and driver apps
Designing Uber apps for both riders and drivers
For the rider app, focus on ease of use and quick booking process
For the driver app, focus on real-time updates and navigation
Both apps should have a rating system and payment integration
Implement features like surge pricing, ride history, and in-app messaging
Q11. Max Frequency Character in a string
Find the character with the highest frequency in a given string.
Iterate through the string and count the frequency of each character using a hashmap.
Track the character with the highest frequency as you iterate.
Return the character with the highest frequency at the end.
Q12. Callback method in java and alternatives
Callback method in Java allows passing a function as an argument to another function. Alternatives include using interfaces, lambda expressions, and method references.
Callback method allows passing a function as an argument to another function
Alternatives include using interfaces, lambda expressions, and method references
Example: Using Runnable interface in Java to pass a function as a callback
Q13. System Design specific to domain
System design specific to domain
Understand the domain and its requirements
Identify the key components and their interactions
Choose appropriate technologies and architecture
Consider scalability and maintainability
Q14. System Design of Zomato
Zomato is a food delivery and restaurant discovery platform that connects users with local restaurants.
Zomato uses a microservices architecture to handle its various functionalities.
The system is designed to handle a large number of concurrent users and requests.
Zomato uses a combination of relational and NoSQL databases to store data.
The platform uses machine learning algorithms to provide personalized recommendations to users.
Zomato also integrates with various third-party ...read more
Q15. Design a parking lot system?
A parking lot system that manages parking spots and vehicles.
Create a class for parking lot with attributes like total number of spots, available spots, etc.
Create a class for vehicle with attributes like license plate number, type, etc.
Implement methods for parking a vehicle, removing a vehicle, and checking availability of spots.
Use data structures like arrays and maps to store and retrieve information.
Consider implementing a payment system for parking fees.
Q16. High level system design
High level system design involves creating an abstract representation of a system's architecture.
Identify the system's components and their interactions
Define the system's boundaries and interfaces
Consider scalability, reliability, and maintainability
Use diagrams and models to communicate the design
Q17. Longest common subsequence print
Find and print the longest common subsequence in an array of strings
Use dynamic programming to find the longest common subsequence
Iterate through the array of strings to find common characters
Print the longest common subsequence found
Q18. Find a number in consecutive array
Search for a number in a consecutive array of strings
Iterate through the array and convert each string to a number
Check if the numbers are consecutive by comparing with the next number
Return the number if found, otherwise return a message indicating not found
Q19. Detect Loop in Graph
Detect if there is a loop in a graph.
Use Depth First Search (DFS) to traverse the graph.
If a node is visited twice during DFS, then there is a loop.
Maintain a visited set to keep track of visited nodes.
If a node is already in the visited set, then there is a loop.
Q20. LRU Cache without using LinkedHashMap
Implementing LRU Cache without using LinkedHashMap
Use a doubly linked list to maintain the order of keys based on their recent usage
Use a hashmap to store key-value pairs for quick access
When a new key is accessed, move it to the front of the linked list and update the hashmap accordingly
When the cache is full, remove the least recently used key from the end of the linked list and hashmap
Q21. Solid design principles
Solid design principles are fundamental guidelines for designing software that is maintainable, scalable, and efficient.
Follow the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion)
Use design patterns like Factory, Singleton, Observer, etc. to solve common design problems
Keep code modular, reusable, and easy to understand
Separate concerns and avoid tight coupling between components
Q22. Hashmap vs concurrent hashmap
Hashmap is not thread-safe, while ConcurrentHashMap is thread-safe and allows for concurrent access.
Hashmap is not thread-safe and can lead to race conditions in a multi-threaded environment.
ConcurrentHashMap is thread-safe and allows for concurrent access by multiple threads without the need for external synchronization.
ConcurrentHashMap achieves thread-safety by dividing the map into segments, each of which can be locked independently.
ConcurrentHashMap is preferred for mult...read more
Q23. Working code with edge cases.
Working code with edge cases is code that has been tested with extreme inputs to ensure it functions correctly.
Edge cases are inputs that are unlikely to occur but can cause unexpected behavior if not handled properly.
Examples of edge cases include empty inputs, null values, and inputs at the limits of the data type's range.
Working code with edge cases should be thoroughly tested to ensure it functions correctly in all scenarios.
Q24. GCD vs Operation queue
GCD is a low-level API for managing concurrent operations, while Operation Queue is a higher-level API built on top of GCD.
GCD is a C-based API for managing queues of tasks, while Operation Queue is an Objective-C class that provides a more object-oriented way to manage tasks.
GCD is more low-level and requires manual management of queues and tasks, while Operation Queue handles many of these details for you.
Operation Queue allows you to easily cancel, suspend, and resume oper...read more
Q25. Implement infinite scroll
Implementing infinite scroll for a web application
Use a front-end framework like React or Angular to handle the scrolling functionality
Fetch additional data from the server as the user scrolls down the page
Update the UI with the new data without reloading the entire page
Q26. Design multi player game
Designing a multiplayer game involves creating a system where multiple players can interact and compete with each other in real-time.
Consider the game genre and mechanics to determine the type of multiplayer experience (e.g. turn-based, real-time, co-op, competitive).
Implement networking functionality to allow players to connect to a central server or directly with each other.
Design a matchmaking system to pair players of similar skill levels or preferences.
Include features f...read more
Top HR Questions asked in Shree Laljee Prashikshan Kendra
Interview Process at Shree Laljee Prashikshan Kendra
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month