ZeMoSo Technologies
80+ Dr.B.C.Roy Engineering College Interview Questions and Answers
You are given an array “ARR” of size N. Your task is to find out the sum of maximum and minimum elements in the array.
Follow Up:
Can you do the above task in a minimum number of comparisons? ...read more
Ninja is given a few numbers, and he is being asked to rearrange the numbers so that every second element is greater than its left and right element.
Suppose the given array is [1, ...read more
The task is to rearrange the given array such that every second element is greater than its left and right element.
Read the number of test cases
For each test case, read the number of elements in the array and the array elements
Iterate through the array and swap elements at odd indices with their adjacent elements if necessary
Check if the rearranged array satisfies the conditions and print 1 if it does, else print 0
You are given two strings 'A' and 'B' where string 'A' is fixed. But you can perform left shift operations on string B any number of times.
Your task is to find out the minim...read more
The question asks to find the minimum number of left shift operations required to obtain the longest common prefix of two given strings.
Perform left shift operations on string B to find the longest common prefix with string A
Count the number of left shift operations required to obtain the longest common prefix
Return the minimum number of left shift operations for each test case
You are given an integer array ‘ARR’. You have to find the length of the shortest contiguous subarray such that, if you sort this subarray in ascending order, then the whole array will be sorted in asce...read more
The question asks to find the length of the shortest contiguous subarray that needs to be sorted in order to sort the whole array.
Iterate through the array and find the first element that is out of order from the left side.
Iterate through the array and find the first element that is out of order from the right side.
Find the minimum and maximum element within the subarray from the above steps.
Expand the subarray from both sides until all elements within the subarray are in the...read more
Design a data structure that stores a mapping of a key to a given value and supports the following operations in constant time.
1. INSERT(key, value): Inserts an integer value to the data...read more
1. What is Normalization and why do we use it?
2. Write an SQL query to find the position of the alphabet (‘o’) in the first name column ‘Zemoso’ from Company table.
3. Write an SQL query to fetch du...read more
Normalization is the process of organizing data in a database to eliminate redundancy and improve data integrity.
Normalization helps in reducing data redundancy by breaking down a large table into smaller, more manageable tables.
It ensures data consistency and eliminates anomalies like update, insert, and delete anomalies.
Normalization improves database performance and simplifies data maintenance.
There are different normal forms (1NF, 2NF, 3NF, etc.) that define specific rule...read more
You have ten stacks of ten coins each and each of them weighs 10 gm. However, one of the stacks is faulty and each of the coins in it weighs only 9 gms. What is the least number of times you ha...read more
The least number of times you have to weigh to find the faulty coin is 2.
First, divide the ten stacks into two groups of five stacks each.
Weigh one group against the other group.
If the weights are equal, the faulty stack is in the remaining five stacks.
If the weights are unequal, the faulty stack is in the lighter group.
Now, divide the lighter group into two groups of two stacks each.
Weigh one group against the other group.
If the weights are equal, the faulty stack is in the ...read more
Q8. New technologies learnt in last 6 months.
React Native, GraphQL, Docker
Learned React Native for cross-platform mobile app development
Explored GraphQL for efficient data fetching and manipulation
Gained knowledge in Docker for containerization and deployment
1. What is the main purpose of an operating system?
2. What is the difference between process and program?
3. What is the use of paging in operating system?
4. What is the concept of demand paging?
Operating system is responsible for managing computer hardware and software resources.
The main purpose of an operating system is to provide an interface between the user and the computer hardware.
A process is an instance of a program in execution, while a program is a set of instructions stored on disk.
Paging is a memory management technique used by operating systems to efficiently manage memory.
Demand paging is a technique where pages are loaded into memory only when they ar...read more
Q10. Write code based on situation with proper implementation using Design patterns etc.
Implement a code scenario using design patterns
Identify the problem statement and requirements
Choose appropriate design patterns like Singleton, Factory, Observer, etc.
Implement the code following the selected design patterns
Test the code for functionality and efficiency
Q11. Default and static methods in interface?
Default and static methods in interface allow for method implementation and utility methods in Java interfaces.
Default methods provide a default implementation for a method in an interface.
Static methods in interfaces can be called directly on the interface itself.
Default and static methods were introduced in Java 8.
Default methods can be overridden by implementing classes.
Static methods cannot be overridden and are not inherited by implementing classes.
Q12. Internal working of Node.js and how node processes asynchronous requests
Node.js is a runtime environment that executes JavaScript code outside of a web browser, using an event-driven, non-blocking I/O model.
Node.js uses the V8 JavaScript engine to execute code.
It uses an event-driven architecture to handle asynchronous operations.
Node.js uses a single-threaded event loop to process multiple requests concurrently.
Callbacks are used to handle asynchronous operations in Node.js.
Node.js provides modules like 'fs' for file system operations and 'http'...read more
Q13. How many type of authentication can be implemented
There are multiple types of authentication that can be implemented, including password-based, token-based, biometric, and multi-factor authentication.
Password-based authentication: Users authenticate themselves using a password.
Token-based authentication: Users authenticate themselves using a token, such as a one-time password or a security key.
Biometric authentication: Users authenticate themselves using their unique biological characteristics, such as fingerprints or facial...read more
Q14. Design a database scheme of one of the known website.
Design a database scheme for Amazon website
Create tables for users, products, orders, reviews, and payments
Use primary and foreign keys to establish relationships between tables
Include attributes such as user_id, product_id, order_id, review_id, and payment_id
Implement indexes for faster data retrieval
Consider denormalization for performance optimization
Q15. Find the number of consecutive alphabets in a string.
The question asks to find the number of consecutive alphabets in a string.
Iterate through the string and check if each character is consecutive to the previous one.
Keep track of the count of consecutive alphabets encountered.
Return the count at the end.
Q16. Singleton pattern for thread safety .
Singleton pattern ensures only one instance of a class is created and provides a global point of access to it.
Use lazy initialization to create the instance only when needed.
Use synchronized keyword to make the getInstance() method thread-safe.
Consider using double-checked locking for better performance.
Use enum to implement singleton pattern as it is inherently thread-safe.
Q17. API to update the salary of the employee
API endpoint to update employee salary
Create a PUT request endpoint with employee ID and new salary as parameters
Verify user authentication and authorization before updating the salary
Update the salary in the database and return success message
Q18. Given an integer array , and a target k , we need to find the pair of elements from array whose sum will be equal to target k.
Find pair of elements in array whose sum is equal to target k.
Use a hashmap to store the difference between target k and each element in the array.
Iterate through the array and check if the current element's complement exists in the hashmap.
Return the indices of the pair that sums up to target k.
Q19. Develop springboot api for a given table
Develop a Spring Boot API for a given table
Create a Spring Boot project with necessary dependencies
Define entity class representing the table
Create a repository interface extending JpaRepository
Implement service layer with business logic
Create REST controller with CRUD operations
Q20. Convert a String into sub-strings based on the number of given rows in a zig-zag pattern and display as a single string P A H N I/P: "paypalishiring" ----> A P L S I. I G Y . I R O/P: "PAHNAPLSIIGYIR"
Convert a given string into sub-strings based on the number of rows in a zig-zag pattern and display as a single string.
Create an array of strings with the number of rows specified
Iterate through the input string and distribute characters in a zig-zag pattern
Concatenate the sub-strings row by row to form the final output string
Q21. Designing an API for a Product table, basically CRUD operations
Designing a RESTful API for CRUD operations on a Product table
Use HTTP methods like GET, POST, PUT, DELETE for CRUD operations
Create endpoints like /products for listing all products, /products/{id} for specific product, etc.
Use JSON format for request and response bodies
Implement authentication and authorization mechanisms for secure access
Q22. Linked list implementation
Linked list is a data structure where each element points to the next element in the sequence.
Nodes contain data and a reference to the next node
Insertion and deletion can be done efficiently in a linked list
Traversal starts from the head node and follows the next pointers
Q23. One programming question to print only unique numbers from given array.
Print unique numbers from given array of strings.
Convert array of strings to array of integers.
Use a set to store unique numbers.
Iterate through array and add numbers to set if not already present.
Print out the unique numbers from the set.
Q24. Given a Map of fruits with there price as a key value pair respectively, find the fruit whose price is maximum using Java 8 Stream API.
Using Java 8 Stream API to find the fruit with maximum price in a Map of fruits.
Use entrySet() method to get a stream of key-value pairs from the Map.
Use max() method with Comparator.comparing() to find the entry with maximum price.
Extract the key (fruit) from the entry with maximum price.
Q25. Height of the binary tree
Height of a binary tree is the maximum number of edges on the longest path from the root node to a leaf node.
The height of an empty tree is -1.
The height of a tree with only one node is 0.
The height of a binary tree can be calculated recursively by finding the height of the left and right subtrees and adding 1 to the maximum of the two heights.
Q26. Given an input string "aaabbCCaaDD" , O/p : a3b2C2a2D2 , we need to find the frequency of subsequent characters.
The task is to find the frequency of subsequent characters in a given input string.
Iterate through the input string while keeping track of the current character and its frequency.
If the current character is the same as the previous character, increment the frequency count.
If the current character is different, append the previous character and its frequency to the output string.
Repeat until the end of the input string is reached.
Q27. Actuator in spring boot and what are the actuator endpoints
Actuator in Spring Boot provides production-ready features like monitoring and metrics.
Actuator is a set of tools provided by Spring Boot to monitor and manage your application.
Actuator endpoints are URLs that provide information about your application, such as health, metrics, info, etc.
Examples of actuator endpoints include /actuator/health, /actuator/metrics, /actuator/info, etc.
Q28. Caching in Hibernate
Caching in Hibernate improves performance by storing frequently accessed data in memory.
Hibernate supports first-level cache at session level
Second-level cache can be configured at session factory level
Caching strategies include read-only, read-write, and transactional
Cache providers like Ehcache, Infinispan, and Hazelcast can be used
Q29. What are the features of Date and Time API in Java 8
Java 8 Date and Time API provides improved date and time handling capabilities.
Introduction of new classes like LocalDate, LocalTime, LocalDateTime, ZonedDateTime, OffsetTime, OffsetDateTime, and Instant for better date and time manipulation
Support for time zones and offsets
Ability to perform date and time calculations easily
Enhanced formatting and parsing capabilities
Integration with existing date and time classes like java.util.Date and java.util.Calendar
Q30. sort 0 and 1
Sort an array of 0s and 1s in linear time complexity.
Use two pointers approach - one from the start and one from the end of the array.
Swap 0s to the left side and 1s to the right side until the pointers meet.
Time complexity: O(n), Space complexity: O(1)
Q31. Implement LRU cache
LRU cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a combination of a doubly linked list and a hashmap to efficiently implement LRU cache.
Keep track of the most recently used item at the head of the linked list and the least recently used item at the tail.
When a new item is accessed, move it to the head of the linked list and update the hashmap accordingly.
If the cache is full, remove the item at the ...read more
Q32. Write a program to check whether the parenthesis are properly balanced or not, means for every opening brace these should be a closing brace present.
Program to check if parenthesis are properly balanced
Use a stack data structure to keep track of opening parenthesis
Iterate through the input string and push opening parenthesis onto the stack
When a closing parenthesis is encountered, pop from the stack and check if it matches the corresponding opening parenthesis
If stack is empty at the end and all parenthesis are matched, then the input has properly balanced parenthesis
Q33. Count the continuous unique character from given string "aaaaBbbbCDEaAb", O/P: a4 B4 C1 D1 E1 a2 b2
Count the continuous unique characters in a given string.
Iterate through the string and keep track of the current character and its count
If the current character is different from the previous one, print the count and reset it
Handle both uppercase and lowercase characters separately
Q34. Java memory management for heap and stack, what is the use of string pool, java 8 features, multi threading sample program, explain one design pattern with example
Java memory management, string pool, Java 8 features, multi threading, design patterns
Java memory management involves managing memory allocation for heap and stack. Heap is used for storing objects and is managed by garbage collector. Stack is used for method calls and local variables.
String pool is a special area in heap memory where String literals are stored to optimize memory usage. Strings with same values are stored only once in the pool.
Java 8 features include lambda e...read more
Q35. What is the difference between smoke & sanity testing?
Smoke testing is a quick and shallow test to check basic functionality, while sanity testing is a more thorough test to ensure system stability.
Smoke testing is done to check if the critical functionalities of the system are working or not.
Sanity testing is done to check if the system is stable enough to proceed with further testing.
Smoke testing is usually done after a build is deployed, while sanity testing is done after major changes are made to the system.
Smoke testing is...read more
Q36. System design of Paytm and Microservices Architecture.
Paytm uses microservices architecture for scalability and flexibility in system design.
Paytm's system design is based on microservices architecture to break down the application into smaller, independent services.
Each service in Paytm's architecture handles a specific function, such as payments, wallet, or shopping.
Microservices communicate with each other through APIs, allowing for easier scalability and maintenance.
This architecture enables Paytm to quickly add new features...read more
Q37. high level system design for a movie booking app
A movie booking app system design involves user authentication, movie selection, seat reservation, payment processing, and booking confirmation.
User authentication: Implement login/signup functionality for users.
Movie selection: Display list of movies with details like showtimes, ratings, and genres.
Seat reservation: Allow users to select seats for chosen movie showtime.
Payment processing: Integrate payment gateway for secure transactions.
Booking confirmation: Send confirmati...read more
Q38. Given a list of integer find the first non repeating integer using stream API of Java 8.
Find the first non-repeating integer in a list using Java 8 stream API.
Use Java 8 stream API to group integers by count
Filter out integers with count greater than 1
Return the first non-repeating integer
Q39. Getting number of unique elements of array with in-place modification
Use hash set to track unique elements while iterating through array and modify array in-place
Iterate through array and add elements to hash set to track unique elements
Modify array in-place by removing duplicates using hash set
Return the size of the hash set as the number of unique elements
Q40. Database optimization techniques
Database optimization techniques involve indexing, query optimization, normalization, and denormalization.
Use indexing to improve query performance by creating indexes on frequently searched columns.
Optimize queries by avoiding unnecessary joins, using proper WHERE clauses, and limiting the number of returned rows.
Normalize database tables to reduce redundancy and improve data integrity.
Consider denormalization for read-heavy applications to improve query performance at the c...read more
Q41. How the communication is happening between the microservices ?
Communication between microservices is typically done through APIs, messaging queues, or service meshes.
Microservices communicate with each other through APIs, which allow them to send and receive data over the network.
Messaging queues like RabbitMQ or Kafka can be used for asynchronous communication between microservices.
Service meshes like Istio or Linkerd can handle communication between microservices by managing traffic, security, and monitoring.
RESTful APIs are commonly ...read more
Q42. sql query to find 2nd largest salary
Use SQL query with ORDER BY and LIMIT to find 2nd largest salary.
Use ORDER BY clause to sort salaries in descending order
Use LIMIT 1,1 to get the second row after skipping the first row
Q43. Explain All sorting techniques and implement bubble sort in online compiler.
Explanation of sorting techniques and implementation of bubble sort
Sorting techniques include bubble sort, selection sort, insertion sort, merge sort, quick sort, etc.
Bubble sort compares adjacent elements and swaps them if they are in the wrong order, repeating until the array is sorted.
Example: [5, 3, 8, 2, 1] -> [3, 5, 8, 2, 1] -> [3, 5, 2, 8, 1] -> [3, 5, 2, 1, 8] -> [3, 2, 5, 1, 8] -> [3, 2, 1, 5, 8] -> [2, 3, 1, 5, 8] -> [2, 1, 3, 5, 8] -> [1, 2, 3, 5, 8]
Q44. How SQL index works internally, SQL execution order
SQL indexes are data structures that improve the speed of data retrieval operations by providing quick access to rows in a table.
SQL indexes are created on columns in a table to speed up SELECT queries.
When a query is executed, the SQL engine first checks if there is an index on the columns involved in the query.
If an index is present, the SQL engine uses it to quickly locate the rows that satisfy the query conditions.
The SQL execution order typically involves parsing, optimi...read more
Q45. Design pattern of microservices architecture
Microservices architecture is a design pattern where an application is composed of small, independent services that communicate over well-defined APIs.
Each microservice is responsible for a specific business function or capability
Services are loosely coupled and can be developed, deployed, and scaled independently
Communication between services is typically done through lightweight protocols like HTTP or messaging queues
Microservices architecture promotes flexibility, scalabil...read more
Q46. Branching strategies in Agile methodologies
Branching strategies in Agile methodologies involve creating separate branches for different features or tasks to enable parallel development.
Feature branching: Each feature or user story is developed in a separate branch, allowing for isolation and independent testing.
Release branching: A branch is created for each release, enabling bug fixes and maintenance to be done separately from ongoing development.
Task branching: Developers create branches for individual tasks or sub-...read more
Q47. What is the use of pretty in JavaScript
The pretty function in JavaScript is used to format and display data in a more visually appealing way.
Pretty function is used to format JSON data for better readability.
It can be used to display data in a structured and organized manner.
Pretty function is commonly used in debugging to make output easier to read.
Q48. create a spring boot project and implement crud operation for user table.
Implement CRUD operations for user table in a Spring Boot project.
Create a Spring Boot project using Spring Initializr
Define a User entity with necessary fields and annotations
Create a UserRepository interface extending JpaRepository
Implement methods in a UserService class for CRUD operations
Use RESTful endpoints to expose the CRUD operations
Q49. Cross questioning in solution and wireframes you made
I always cross-question my solutions and wireframes to ensure they meet the requirements and are user-friendly.
I review the wireframes and solutions multiple times to ensure they align with the product goals and user needs.
I seek feedback from stakeholders and users to identify any potential issues or areas for improvement.
I make necessary adjustments to the wireframes and solutions based on the feedback received.
I conduct usability testing to ensure the final product is intu...read more
Q50. how to sort an array and complexity
Sorting an array of strings using a sorting algorithm like quicksort or mergesort.
Use a sorting algorithm like quicksort or mergesort to sort the array of strings.
Ensure the sorting algorithm is efficient and has a time complexity of O(n log n).
Consider the space complexity of the sorting algorithm as well.
Q51. How collections works internally?
Collections in programming languages are data structures that store and organize multiple elements.
Collections can be implemented using various data structures such as arrays, linked lists, hash tables, and trees.
They provide methods for adding, removing, and accessing elements efficiently.
Examples of collections in Java include ArrayList, LinkedList, HashMap, and TreeSet.
Q52. Explain Node.js event driven architecture.
Node.js event driven architecture is a non-blocking, asynchronous model where events trigger callbacks.
Node.js uses an event loop to handle asynchronous operations.
Callbacks are registered for specific events and executed when the event occurs.
Event emitters in Node.js trigger events that are handled by listeners.
Example: Reading a file asynchronously in Node.js using fs module.
Q53. What is OO?
OO stands for Object-Oriented. It is a programming paradigm that focuses on objects and their interactions.
OO is based on the concept of classes and objects.
It emphasizes encapsulation, inheritance, and polymorphism.
OO languages include Java, C++, Python, and Ruby.
OO design patterns are used to solve common problems in software development.
Q54. Implementation of game usign ReactJS.
Implementing a game using ReactJS involves creating components for game elements, managing state, handling user interactions, and updating the UI.
Create separate components for game elements such as game board, player pieces, and score display.
Use React state to manage game state, such as player turns, scores, and game progress.
Handle user interactions, such as clicking on game pieces or buttons, to update game state.
Update the UI dynamically based on game state changes to pr...read more
Q55. Nodejs techniques.
Node.js is a popular runtime environment for executing JavaScript code outside of a browser.
Node.js allows for asynchronous programming using callbacks, promises, and async/await.
Node.js has a large ecosystem of libraries and frameworks, such as Express for building web applications.
Node.js uses the CommonJS module system for organizing code into reusable modules.
Q56. Multiple MCQ on NodeJS Internals
Multiple choice questions on NodeJS internals
Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser.
It uses the V8 JavaScript engine from Google, which compiles JavaScript directly into machine code.
Node.js has a non-blocking, event-driven architecture that makes it lightweight and efficient for handling I/O operations.
Common Node.js internals topics include event loop, modules, buffers, streams, and err...read more
Q57. What are SOLID principles?
SOLID principles are a set of five design principles that help make software designs more understandable, flexible, and maintainable.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open/Closed Principle: Software entities should be open for extension but closed for modification.
L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the functionality.
I - Interface ...read more
Q58. What is multi threading?
Multi threading is a programming concept where multiple threads within a process execute concurrently, allowing for better performance and responsiveness.
Allows for parallel execution of tasks within a single process
Improves performance by utilizing multiple CPU cores
Can lead to synchronization issues if not handled properly
Examples include web servers handling multiple client requests simultaneously
Q59. Implent Oops concept of Java through code
Java OOPs concepts can be implemented using classes, objects, inheritance, polymorphism, and encapsulation.
Create classes with attributes and methods
Instantiate objects from classes
Use inheritance to create subclasses
Implement polymorphism through method overriding
Encapsulate data using access modifiers
Q60. Code review of given java classes
Reviewing Java classes for code quality and best practices
Check for proper naming conventions and readability of code
Ensure that the code follows SOLID principles and design patterns
Look for potential bugs, performance issues, and security vulnerabilities
Verify that the code is well-documented and includes appropriate comments
Evaluate the test coverage and quality of unit tests
Q61. Binary Search Algorithm
Binary search is a divide and conquer algorithm that efficiently finds the target value within a sorted array.
Divide the array in half and compare the target value with the middle element
If the target value is smaller, search the left half. If larger, search the right half
Repeat the process until the target value is found or the subarray is empty
Q62. Valid Parenthesis String
Check if a string of parentheses is valid
Use a stack to keep track of opening parentheses
Iterate through the string and push opening parentheses onto the stack
When encountering a closing parenthesis, pop from the stack and check if it matches the corresponding opening parenthesis
If stack is empty at the end and all parentheses have been matched, the string is valid
Q63. Problem Solving subsequence longest
Find the longest subsequence in an array of strings
Iterate through the array of strings and compare each string with the next one to find the longest common subsequence
Use dynamic programming to efficiently find the longest common subsequence
Example: ['abc', 'abg', 'bdf', 'aeg', 'acefg'] - The longest subsequence is 'aeg'
Q64. Write down a code for server connection.
Code for establishing a server connection in Node JS.
Use the 'http' module to create a server
Call the 'createServer' method with a callback function to handle requests
Listen on a specific port for incoming connections
Q65. How to detect deadlock
Detecting deadlock involves analyzing the resource allocation graph and identifying circular wait conditions.
Check for circular wait conditions where processes are waiting for resources held by each other
Use resource allocation graph to visualize resource allocation and identify potential deadlocks
Implement deadlock detection algorithms like Banker's algorithm or wait-die algorithm
Monitor resource allocation and request patterns to proactively identify potential deadlocks
Q66. Brief about Java 8 with example
Java 8 introduced new features like lambda expressions, streams, and functional interfaces.
Lambda expressions allow concise syntax for defining anonymous functions.
Streams provide a way to work with collections in a functional style.
Functional interfaces have a single abstract method and can be used with lambda expressions.
Example: Lambda expression - (a, b) -> a + b
Example: Stream usage - List
names = Arrays.asList("Alice", "Bob"); names.stream().filter(name -> name.startsWi...read more
Q67. What are spring components
Spring components are reusable software building blocks managed by the Spring framework.
Spring components are Java classes annotated with @Component or its specialized annotations like @Service, @Repository, @Controller.
These components are managed by the Spring IoC container and can be injected into other components using @Autowired annotation.
Spring components promote code reusability, modularity, and maintainability in Spring-based applications.
Q68. Why choose software testing
Software testing ensures quality and reliability of software products.
Identifies defects and errors in software
Ensures software meets requirements and specifications
Improves user experience and satisfaction
Saves time and money by catching issues early
Increases confidence in software reliability
Q69. Explain Bug/defect life cycle.
Bug/defect life cycle is a process of identifying, reporting, prioritizing, fixing, and verifying software defects.
Defect identification
Defect reporting
Defect prioritization
Defect fixing
Defect verification
Q70. Explain Binary search
Binary search is a search algorithm that finds the position of a target value within a sorted array.
Divide the array into two halves and compare the target value with the middle element.
If the target value is less than the middle element, search the left half. If greater, search the right half.
Repeat the process until the target value is found or the subarray is empty.
Q71. A variant of bubble sort
Cocktail sort is a variant of bubble sort that sorts in both directions.
Also known as bidirectional bubble sort or shaker sort.
It starts with the first element and compares it with the next one, swapping if necessary.
Then it moves to the last element and compares it with the previous one, swapping if necessary.
It continues until no more swaps are needed.
It is more efficient than bubble sort for large lists with many out-of-order elements.
Q72. ode working and its functionalities
Code working and its functionalities
Code working refers to the process of writing, compiling, and executing code to achieve a desired outcome
Functionalities of code include data manipulation, logic implementation, and interaction with external systems
Examples of code working functionalities include sorting algorithms, database queries, and user interface design
Q73. Feature of Java 8
Java 8 introduced lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow you to pass functionality as an argument to a method.
Functional interfaces have a single abstract method and can be used with lambda expressions.
Streams provide a way to work with sequences of elements efficiently.
Default methods allow interfaces to have methods with implementation.
Example: List
names = Arrays.asList("Alice", "Bob", "Charlie"); names.forEach(name...read more
Q74. What is throw and throws
throw is used to explicitly throw an exception in a method, while throws is used in method signature to declare the exceptions that can be thrown by the method.
throw keyword is used to throw an exception within a method.
throws keyword is used in method signature to declare the exceptions that can be thrown by the method.
Example: throw new Exception("Error message");
Example: public void method() throws IOException, SQLException {}
Q75. What is SOLD and explain
SOLD stands for Software Object Linking and Embedding. It is a technology that allows objects to be linked or embedded in documents.
SOLD is a technology used in software development to link or embed objects in documents.
It allows for dynamic updating of linked objects in documents.
SOLD is commonly used in applications like Microsoft Office for embedding charts or tables in documents.
Q76. What is module ?
A module in Node.js is a reusable block of code that encapsulates related functionality.
Modules help in organizing code into separate files for better maintainability.
Modules can be imported and used in other files using the 'require' function.
Node.js has a built-in module system that allows developers to create and use modules.
Examples of modules in Node.js include 'fs' for file system operations and 'http' for creating web servers.
Q77. Explain SAGA design pattern
SAGA design pattern is used to manage distributed transactions in microservices architecture.
SAGA breaks down a transaction into a series of smaller, independent transactions.
Each step in the SAGA pattern is a separate transaction that can be rolled back if needed.
SAGA ensures eventual consistency by coordinating the transactions across multiple services.
Example: In an e-commerce application, SAGA can be used to handle the process of placing an order, processing payment, and ...read more
Q78. Least common ancestors tree
Finding the least common ancestor of two nodes in a tree
Use a method like Lowest Common Ancestor (LCA) to find the least common ancestor of two nodes in a tree
Traverse the tree to find the paths from the root to each node, then compare the paths to find the LCA
Consider edge cases like when one node is the ancestor of the other or when one of the nodes is not in the tree
Q79. Explain all Oops concepts briefly
Oops concepts are fundamental principles of object-oriented programming like inheritance, polymorphism, encapsulation, and abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Ability of objects to take on multiple forms based on the context.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Abstraction: Hiding the complex implementation details and showing only the necessary features to ...read more
Q80. Csv parse using node.js
Use the 'csv-parser' package in Node.js to easily parse CSV files.
Install the 'csv-parser' package using npm: npm install csv-parser
Require the 'csv-parser' module in your Node.js script: const csv = require('csv-parser')
Use the 'fs' module to read the CSV file and pipe it to the csv-parser module for parsing
Example: fs.createReadStream('data.csv').pipe(csv()).on('data', (row) => { console.log(row) })
Q81. System Design of hotel mgmt
System design for hotel management including booking, check-in/out, room allocation, and payment processing.
Use a database to store information about rooms, bookings, guests, and payments.
Implement a booking system that allows guests to search for available rooms based on dates and preferences.
Include a check-in/out process that updates room availability and guest information.
Design a room allocation algorithm to optimize room usage and guest satisfaction.
Integrate a payment ...read more
Q82. Structure in c++
Structure in C++ is a user-defined data type that allows grouping of variables of different data types under a single name.
Structures are used to create complex data types by grouping variables together.
They can contain variables of different data types.
Structures are defined using the 'struct' keyword.
Example: struct Person { string name; int age; };
Example: Person p1;
Q83. Callable vs runnable
Callable and Runnable are both interfaces in Java used for executing tasks, but Callable can return a result and throw checked exceptions.
Callable interface in Java can return a result and throw checked exceptions, while Runnable cannot.
Callable interface is a part of java.util.concurrent package, while Runnable is a part of java.lang package.
Callable interface is used with ExecutorService to submit tasks for execution and retrieve the result, while Runnable is used with Thre...read more
Q84. Node process efficiency
Q85. Features of Java8
Java 8 introduced several new features including lambda expressions, streams, functional interfaces, and default methods.
Lambda expressions allow you to write code in a more concise and readable way.
Streams provide a way to work with collections of objects in a functional style.
Functional interfaces are interfaces with a single abstract method, used for lambda expressions.
Default methods allow interfaces to have method implementations.
The new Date and Time API provides better...read more
Top HR Questions asked in Dr.B.C.Roy Engineering College
Interview Process at Dr.B.C.Roy Engineering College
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month