TCS
100+ MikeLegal Interview Questions and Answers
Q1. Election Winner Determination
In an ongoing election between two candidates A and B, there is a queue of voters that includes supporters of A, supporters of B, and neutral voters. Neutral voters have the power ...read more
Q2. Mirror String Problem Statement
Given a string S
containing only uppercase English characters, determine if S
is identical to its reflection in the mirror.
Example:
Input:
S = "AMAMA"
Output:
YES
Explanation:
T...read more
Q3. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Q4. Twin Pairs Problem Statement
Given an array A
of size N
, find the number of twin pairs in the array. A twin pair is defined as a pair of indices x
and y
such that x < y
and A[y] - A[x] = y - x
.
Input:
The first...read more
Q5. Binary Pattern Problem Statement
Given an input integer N
, your task is to print a binary pattern as follows:
Example:
Input:
N = 4
Output:
1111
000
11
0
Explanation:
The first line contains 'N' 1s. The next line ...read more
Q6. Count Pairs with Given Sum
Given an integer array/list arr
and an integer 'Sum', determine the total number of unique pairs in the array whose elements sum up to the given 'Sum'.
Input:
The first line contains ...read more
Q7. Loot Houses Problem Statement
A thief is planning to steal from several houses along a street. Each house has a certain amount of money stashed. However, the thief cannot loot two adjacent houses. Determine the...read more
Q8. Remove Duplicates Problem Statement
You are given an array of integers. The task is to remove all duplicate elements and return the array while maintaining the order in which the elements were provided.
Example...read more
Q9. 0/1 Knapsack Problem Statement
A thief is planning to rob a store and can carry a maximum weight of 'W' in his knapsack. The store contains 'N' items where the ith item has a weight of 'wi' and a value of 'vi'....read more
Q10. Space Survival Game Challenge
Ninja is in space with unlimited fuel in his super spaceship. He starts with a health level H
and his spaceship has an armour A
. Ninja can be on only one of the three planets at a ...read more
Q11. Maximum Vehicle Registrations Problem
Bob, the mayor of a state, seeks to determine the maximum number of vehicles that can be uniquely registered. Each vehicle's registration number is structured as follows: S...read more
Q12. Minimum Cost to Connect All Points Problem Statement
Given an array COORDINATES
representing the integer coordinates of some points on a 2D plane, determine the minimum cost required to connect all points. The ...read more
Q13. Pair Sum Problem Statement
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Note:
Each pa...read more
Q14. Maximum Profit Problem Statement
Ninja has a rod of length 'N' units and wants to earn the maximum money by cutting and selling the rod into pieces. Each possible cut size has a specific cost associated with it...read more
Q15. What is the difference b/w Procedural Programming and OOP Concept? What are the problems with C in this context?
Procedural programming focuses on procedures and functions, while OOP emphasizes objects and classes.
Procedural programming uses a top-down approach, while OOP uses a bottom-up approach.
In procedural programming, data and functions are separate, while in OOP, they are encapsulated within objects.
Procedural programming is more suitable for small-scale programs, while OOP is better for large-scale projects.
C is a procedural programming language, lacking the features of OOP like...read more
Q16. Explain Difference b/w Constructor and Method also write the code which can describe the difference b/w the two?
A constructor is a special method used to initialize an object, while a method is a function that performs a specific task.
Constructors are called automatically when an object is created, while methods need to be called explicitly.
Constructors have the same name as the class, while methods can have any valid name.
Constructors do not have a return type, while methods can have a return type.
Constructors are used to set initial values of instance variables, while methods are use...read more
Q17. Model an upsetting(metal forming) operation. Explain the process parameters and how would you relate them
Modeling an upsetting operation involves understanding process parameters and their relationships.
Upsetting is a metal forming process that involves compressing a metal workpiece to reduce its length and increase its diameter.
Process parameters include temperature, pressure, and deformation rate.
Temperature affects the material's flow stress and ductility, while pressure and deformation rate affect the material's strain hardening behavior.
The relationship between these parame...read more
Q18. What do you know about Protocols? Explain Different types of Protocols?
Protocols are a set of rules that govern the communication between devices or systems.
Protocols define the format, timing, sequencing, and error checking of messages exchanged between devices.
Different types of protocols include network protocols (TCP/IP, HTTP, FTP), communication protocols (RS-232, USB, Bluetooth), and application protocols (SMTP, POP3, IMAP).
Network protocols govern the communication between devices on a network, while communication protocols govern the com...read more
Q22. What is the difference b/w assignment and initialization?
Assignment is assigning a value to a variable, while initialization is declaring and assigning a value to a variable.
Assignment changes the value of an existing variable, while initialization creates a new variable and assigns a value to it.
Initialization is done only once, while assignment can be done multiple times.
Example of initialization: int x = 5; Example of assignment: x = 10;
Initialization can also be done using constructors in object-oriented programming.
In C++, uni...read more
Q24. Write a code to describe the difference b/w normal function calling and stored procedure invocation?
A normal function is called directly in the code, while a stored procedure is invoked using a database query.
Normal function calling is done within the program code, while stored procedure invocation is done through a database query.
Normal functions are defined and called within the same programming language, while stored procedures are defined and invoked within a database management system.
Normal function calling is synchronous, while stored procedure invocation can be asyn...read more
Q25. What do you mean by experience certainty?
Experience certainty refers to the level of confidence and assurance gained through repeated exposure to a particular task or situation.
Experience certainty is achieved through repetition and familiarity.
It allows individuals to perform tasks with greater ease and efficiency.
For example, a pilot who has flown the same route multiple times will have a higher level of experience certainty compared to a pilot who is flying the route for the first time.
Experience certainty can al...read more
Q26. What is the smallest and the biggest real time project of Java according to you? What is Big Data? If you have to perform actions on 2 billion entry at a time. What would you do and which languages and technolo...
read moreThe smallest real-time project in Java could be a simple chat application, while the biggest could be a complex financial trading system.
Smallest real-time project in Java: Chat application
Biggest real-time project in Java: Financial trading system
Big Data refers to large and complex data sets that cannot be easily processed using traditional data processing applications.
For performing actions on 2 billion entries, technologies like Hadoop, Spark, and languages like Java or S...read more
Q27. What are the advantages of Stored Procedures?
Stored procedures offer advantages such as improved performance, security, and code reusability.
Stored procedures can reduce network traffic by executing multiple SQL statements at once.
They can also improve performance by pre-compiling SQL statements.
Stored procedures can enhance security by allowing access to only specific procedures rather than entire tables.
They promote code reusability by allowing multiple applications to use the same stored procedure.
Examples include pr...read more
Q28. Why did you learn PHP, if JSP is more secure?
PHP was chosen for its versatility, large community support, and ease of use.
PHP is a widely used scripting language with a large community of developers and extensive documentation.
It is known for its versatility and ability to integrate with various databases and web servers.
PHP is also relatively easy to learn and has a low learning curve compared to other languages like JSP.
While JSP may be considered more secure, PHP can still be used to build secure applications with pr...read more
Q29. What do you know about File System in C++?
File System in C++ is used for managing files and directories, providing functions for file input/output operations.
C++ provides the
library for file input/output operations. File streams can be used to read from and write to files.
Common file operations include opening, closing, reading, and writing files.
File streams can handle different file types such as text files and binary files.
File system functions like file existence check, file deletion, and file renaming are avail...read more
Q30. What is the difference b/w thread and process?
A thread is a lightweight unit of execution within a process, while a process is an instance of a program in execution.
A process has its own memory space, while threads share the same memory space within a process.
Processes are independent and isolated from each other, while threads share resources and can communicate with each other more easily.
Creating a new process is more resource-intensive than creating a new thread.
Threads are scheduled by the operating system, while pr...read more
Q31. What is operating system? Difference between compiler and interpretor? One byte is how many bit? What is Machine language? What is the function of assembler ? What are the different types of operating system? W...
read moreOperating system is a software that manages computer hardware and software resources.
Compiler translates high-level language code to machine code while interpreter executes code line by line.
One byte is equal to 8 bits.
Machine language is a low-level programming language consisting of binary code.
Assembler converts assembly language code to machine code.
Types of operating system include Windows, macOS, Linux, and Unix.
Unix is a multi-user, multi-tasking operating system devel...read more
Q32. How many annotations in TestNG and brief all the annotations.
TestNG has 8 annotations including @Test, @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeClass, @AfterClass, @BeforeMethod, @AfterMethod.
1. @Test - Marks a method as a test method.
2. @BeforeSuite - Executed before the Test Suite.
3. @AfterSuite - Executed after the Test Suite.
4. @BeforeTest - Executed before the Test.
5. @AfterTest - Executed after the Test.
6. @BeforeClass - Executed before the first test method in the current class.
7. @AfterClass - Executed after a...read more
Q34. Do you Know JSP? What is JSP? Its Advantages?
JSP is a Java-based technology used for creating dynamic web pages. It allows embedding Java code within HTML pages.
JSP stands for JavaServer Pages.
It is a technology used for developing web applications.
JSP allows embedding Java code within HTML pages.
It provides a simplified way to create dynamic web content.
JSP files are compiled into servlets and executed on the server.
Advantages of JSP include easy integration with Java code, reusable components, and separation of presen...read more
Q35. Do you know about TCS bond agreement?
TCS bond agreement is a contract signed by employees to work for a certain period of time with the company.
TCS bond agreement is a legal contract between TCS and its employees.
Employees sign the bond agreement to work for a certain period of time with the company.
The bond period can range from 1 to 2 years depending on the role and level of the employee.
If an employee wishes to leave the company before the bond period ends, they are required to pay a certain amount as compens...read more
Q36. Do you know what stored procedures are?
Stored procedures are pre-written SQL codes that can be saved and reused.
Stored procedures can improve database performance by reducing network traffic.
They can be used to enforce business rules and security measures.
They can be parameterized to accept input values and return output values.
Examples include procedures for inserting, updating, and deleting data.
They can also be used for complex operations such as data aggregation and reporting.
Q37. Explain Difference b/w Function and Stored Procedure?
Functions return a value while stored procedures do not.
Functions are used to perform a specific task and return a value to the caller.
Stored procedures are used to execute a set of statements and do not return a value.
Functions can be used in SELECT, WHERE, and HAVING clauses.
Stored procedures can be used to modify data, but functions cannot.
Functions can be called from within a stored procedure.
Q38. What is Page Object Model and page factory
Page Object Model is a design pattern in test automation that represents web pages as objects, while Page Factory is a way to initialize elements in Page Object Model.
Page Object Model is a design pattern used in test automation to represent web pages as objects
It helps in creating reusable code and reduces code duplication
Page Factory is a concept in Selenium WebDriver that helps in initializing elements in Page Object Model
It uses @FindBy annotation to locate elements on a ...read more
Q39. What do you understand by Deadlocks?
Deadlocks occur when two or more processes are unable to proceed because each is waiting for the other to finish.
Deadlocks happen when two or more processes are blocked and unable to proceed
Each process is waiting for a resource that is being held by another process
Deadlocks can be prevented by using techniques like resource allocation graphs and banker's algorithm
Examples of deadlocks include the dining philosophers problem and the traffic deadlock problem
Q40. What are types of File System in OS?
Types of file systems in OS include FAT, NTFS, HFS+, ext2/3/4, and APFS.
FAT (File Allocation Table) is a simple file system used by older versions of Windows.
NTFS (New Technology File System) is a more advanced file system used by newer versions of Windows.
HFS+ (Hierarchical File System Plus) is used by Apple's macOS.
ext2/3/4 are file systems used by Linux.
APFS (Apple File System) is a newer file system used by Apple's macOS and iOS devices.
Q41. What is python? Why we use it. Is it case sensitive?
Python is a high-level, interpreted programming language used for web development, data analysis, and artificial intelligence.
Python is easy to learn and has a simple syntax.
It has a large standard library with many pre-built modules.
Python is used for web development with frameworks like Django and Flask.
It is also used for data analysis with libraries like NumPy and Pandas.
Python is case sensitive.
It is a popular language for artificial intelligence and machine learning.
Pyt...read more
Q42. Can you learn coding, if it is needed?
Yes, I am willing to learn coding if it is needed.
I have some basic knowledge of coding and am willing to improve my skills.
I am a quick learner and can adapt to new technologies easily.
I am open to taking courses or attending training sessions to improve my coding skills.
Learning coding will also help me better understand the systems I work with.
For example, I have experience with Python and SQL, and can learn other languages as needed.
Q43. What are the properties of Constructor?
Constructor is a special method used to initialize objects in a class.
Constructors have the same name as the class they belong to.
They are called automatically when an object is created.
They can take parameters to initialize the object's properties.
They do not have a return type.
Multiple constructors can be defined with different parameters.
Example: public class Car { public Car(String make, String model) { ... } }
Q44. Write a code to allocate the memory to object?
Code to allocate memory to an object
Use the 'new' keyword in C++ to allocate memory to an object
Use 'malloc' function in C to allocate memory to an object
In Java, memory is automatically allocated to an object using 'new' keyword
In Python, memory is automatically allocated to an object when it is created
Q45. what is oop? what is difference between python and c programming? write a program on reverse a string?
OOP stands for Object-Oriented Programming. Python and C differ in syntax, memory management, and application areas. A program to reverse a string can be written using loops or slicing.
OOP is a programming paradigm that focuses on objects and their interactions.
Python is a high-level language with dynamic typing and automatic memory management, while C is a low-level language with static typing and manual memory management.
To reverse a string using loops, iterate through the ...read more
Q46. functions of basic electronic componenents like R L C
R, L, and C are basic electronic components used in circuits for resistance, inductance, and capacitance respectively.
Resistors (R) limit current flow and reduce voltage
Inductors (L) store energy in a magnetic field and resist changes in current
Capacitors (C) store energy in an electric field and pass AC signals while blocking DC signals
These components are used in various circuits such as filters, oscillators, and amplifiers
Q47. What do you mean by Paging?
Paging is a memory management technique used by operating systems to manage memory usage.
Paging divides memory into fixed-size pages.
Pages are stored in physical memory or on disk.
When a process needs a page, it is loaded into physical memory.
If there is no space in physical memory, a page is swapped out to disk.
Paging allows for efficient use of memory and prevents processes from accessing memory they shouldn't.
Examples of operating systems that use paging include Windows, L...read more
Q48. How to write Webdriver with in your code
Webdriver can be written in code using Selenium WebDriver library for automating web applications.
Import the necessary Selenium WebDriver library in your code
Create a WebDriver instance for the desired browser (e.g. Chrome, Firefox)
Use WebDriver methods to interact with elements on the web page (e.g. findElement, click, sendKeys)
Write test cases using WebDriver commands to automate testing scenarios
Q49. what is the potential diffrence acc to u
Potential difference is the difference in electric potential between two points in an electric field.
Potential difference is measured in volts (V)
It is the work done per unit charge to move a charge from one point to another
It is the driving force that causes current to flow in a circuit
Potential difference can be calculated using Ohm's law: V = IR
A battery creates a potential difference between its terminals to power a circuit
Q50. what is the function of a switch
A switch is a networking device that connects devices together on a local area network (LAN) and forwards data packets between them.
Switches operate at the data link layer of the OSI model.
They use MAC addresses to forward data to the correct destination.
Switches can improve network performance by reducing network congestion and collisions.
Examples of switches include Ethernet switches, LAN switches, and network switches.
Q51. primary key can be a null or not?
No, primary key cannot be null.
Primary key uniquely identifies a record in a table.
Null values are not unique and can cause data integrity issues.
Primary key constraint ensures that the value is not null.
However, primary key can have a default value.
Q52. What is oops ? What is ORM in python? Multiple Inheritance in java vs python?
OOPs is a programming paradigm that uses objects to represent real-world entities. ORM is a technique to map objects to relational databases.
OOPs stands for Object-Oriented Programming.
It is based on the concept of objects, which can contain data and code.
In OOPs, objects interact with each other to perform tasks.
ORM stands for Object-Relational Mapping.
It is a technique to map objects to relational databases.
ORM allows developers to work with objects instead of SQL statement...read more
Q53. Can you explain encapsulation?
Encapsulation is the process of hiding internal details and providing a public interface for accessing and manipulating data.
Encapsulation is a fundamental concept in object-oriented programming.
It allows for data abstraction and information hiding.
Encapsulation helps in achieving data integrity and security.
It promotes code reusability and modularity.
Example: A class in Java with private variables and public methods.
Q54. What is normalization?
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 that each piece of data is stored in only one place, reducing the chances of inconsistencies.
Normalization follows a set of rules called normal forms, such as First Normal Form (1NF), Second Normal Form (2NF), etc.
Normalization improves dat...read more
Q55. Do you Know Phantom Deadlocks?
Yes, phantom deadlocks are a type of deadlock that occur due to incorrect lock ordering.
Phantom deadlocks occur when multiple processes or threads attempt to acquire locks in a different order.
This can lead to a situation where each process is waiting for a lock held by another process, resulting in a deadlock.
Phantom deadlocks can be difficult to detect and reproduce as they are intermittent and depend on the timing of lock acquisitions.
To prevent phantom deadlocks, it is im...read more
Q56. What are cookies in PHP?
Cookies in PHP are small text files that are stored on the user's computer to track and store information about the user's activities on a website.
Cookies are used to remember user preferences and login information.
They can be set, retrieved, and deleted using PHP's setcookie(), $_COOKIE, and setcookie() functions respectively.
Cookies can have an expiration date and can be set to be accessible only over a secure connection.
They are commonly used for tracking user behavior, pe...read more
Q57. what is LAN MAN WAN PAN ETC
LAN, MAN, WAN, PAN are types of computer networks that differ in their geographical coverage and purpose.
LAN (Local Area Network) is a network that covers a small area like a home, office, or building.
MAN (Metropolitan Area Network) is a network that covers a larger area like a city or town.
WAN (Wide Area Network) is a network that covers a large geographical area like a country or the whole world.
PAN (Personal Area Network) is a network that connects devices within a person'...read more
Q58. write a program for division nd multiplication inn 8085 processor
Program for division and multiplication in 8085 processor.
For multiplication, use MUL instruction with 8-bit operand.
For division, use DIV instruction with 8-bit dividend and 16-bit divisor.
Store the result in appropriate registers or memory locations.
Example: To multiply two numbers in registers B and C, use MUL C instruction.
Example: To divide two numbers in registers A and B, use DIV B instruction.
Q59. explain the concepts of a router
A router is a networking device that forwards data packets between computer networks.
A router operates at the network layer of the OSI model.
It uses routing tables to determine the best path for data packets to reach their destination.
Routers can connect multiple networks together, such as LANs and WANs.
They provide network address translation (NAT) to allow multiple devices to share a single public IP address.
Routers can also provide firewall functionality to protect the net...read more
Q60. What are Constructors?
Constructors are special methods used to initialize objects in a class.
Constructors have the same name as the class they belong to.
They are called automatically when an object is created.
They can be used to set default values for object properties.
Constructors can be overloaded to accept different parameters.
Example: public class Car { public Car() { //constructor code here } }
Q61. How to reverse string, array. What is args in Java.
To reverse a string or array in Java, use StringBuilder or Collections.reverse. 'args' in Java is an array of strings passed as command line arguments.
Use StringBuilder to reverse a string: StringBuilder str = new StringBuilder('hello'); str.reverse();
Use Collections.reverse to reverse an array: List
list = Arrays.asList('apple', 'banana', 'cherry'); Collections.reverse(list); 'args' in Java is an array of strings used to pass command line arguments to a Java program.
Q62. Differences between Object Oriented and Procedure oriented programming languages
Object-oriented programming focuses on objects and their interactions, while procedure-oriented programming focuses on procedures and functions.
OOP is based on the concept of classes and objects, while POP is based on procedures and functions.
OOP supports encapsulation, inheritance, and polymorphism, while POP does not.
OOP is more suitable for large-scale projects, while POP is more suitable for small-scale projects.
Examples of OOP languages include Java, C++, and Python, whi...read more
Q63. what are static & dynamic protocols
Static protocols are fixed and do not change, while dynamic protocols can adapt to changing network conditions.
Static protocols are typically used in simple networks with predictable traffic patterns.
Dynamic protocols are used in complex networks with varying traffic patterns.
Examples of static protocols include ARP and RARP.
Examples of dynamic protocols include OSPF and BGP.
Q64. Explain characteristics of DBMS?
DBMS is a software system that manages databases, providing features like data storage, retrieval, and manipulation.
DBMS stands for Database Management System.
It provides a structured way to store and organize data.
DBMS allows multiple users to access and manipulate the data simultaneously.
It ensures data integrity and security through various mechanisms.
DBMS provides a query language to retrieve and manipulate data, such as SQL.
Examples of popular DBMS include Oracle, MySQL,...read more
Q65. 3. Find the sum of all numbers from a list except self
Sum all numbers in a list except self
Iterate through the list and add all numbers except the current one
Use a loop or built-in functions like sum() and list comprehension
Q66. What is the difference between DBMS and NoSQL?
DBMS is a traditional relational database management system, while NoSQL is a non-relational database management system.
DBMS uses structured query language (SQL) for querying and managing data, while NoSQL databases use different query languages or APIs.
DBMS is typically used for structured data with predefined schemas, while NoSQL is more flexible and can handle unstructured or semi-structured data.
DBMS is ACID-compliant (Atomicity, Consistency, Isolation, Durability), ensur...read more
Q67. Problem arrange 3 numbers in ascending order. Just write the logic
Logic to arrange 3 numbers in ascending order.
Compare first two numbers and swap if necessary
Compare second and third numbers and swap if necessary
Repeat until no more swaps are needed
Q68. What are famous oops concepts/ pillars of oops
The famous pillars of OOPs concepts are Inheritance, Encapsulation, Polymorphism, and Abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features.
Q69. diff betn passive & active components
Passive components do not require an external power source, while active components do.
Passive components include resistors, capacitors, and inductors.
Active components include transistors, diodes, and integrated circuits.
Passive components do not amplify signals, while active components do.
Passive components are used to control the flow of electricity, while active components are used to create and amplify signals.
Q70. Why did you create project in machine learning
I created a project in machine learning to improve the accuracy of a recommendation system.
To enhance the user experience by providing personalized recommendations
To optimize the efficiency of the system by automating the recommendation process
To leverage the power of data analysis and pattern recognition in making accurate predictions
To explore the potential of machine learning algorithms in solving real-world problems
To stay updated with the latest advancements in the field...read more
Q71. What is cloud computing and explain?
Cloud computing is the delivery of computing services over the internet, allowing users to access and store data and applications remotely.
Cloud computing allows users to access data and applications from any device with an internet connection.
It eliminates the need for physical hardware and on-site data centers.
Examples of cloud computing services include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform.
Q72. Do you know coding?
Yes, I know coding.
I am proficient in programming languages such as Java, Python, and C++.
I have experience in developing and maintaining software applications.
I am familiar with software development methodologies such as Agile and Waterfall.
Q73. How do you handle stack over flow?
Handle stack overflow by optimizing code, using dynamic memory allocation, and implementing error handling.
Optimize code to reduce memory usage and prevent stack overflow.
Use dynamic memory allocation for large data structures.
Implement error handling to gracefully handle stack overflow situations.
Q74. Difference between heap and stack memory?
Heap memory is used for dynamic memory allocation, while stack memory is used for static memory allocation.
Heap memory is allocated at runtime and can be accessed randomly, while stack memory is allocated at compile time and is accessed in a LIFO manner.
Heap memory is managed by the programmer, while stack memory is managed by the compiler.
Heap memory is typically used for storing objects and data structures, while stack memory is used for storing local variables and function...read more
Q75. what is differne betwwen if else and while loop
if-else is a conditional statement while while loop is a repetitive statement.
if-else statement is used to execute a block of code based on a condition
while loop is used to execute a block of code repeatedly as long as a condition is true
if-else statement is used for decision making while while loop is used for iteration
if-else statement can have multiple conditions while while loop has only one condition
Example: if(age > 18){ console.log('You are an adult'); } else { console...read more
Q76. Explain OOPS concepts. Explain projects you have done.
OOPS concepts include inheritance, encapsulation, polymorphism, and abstraction. Projects include developing a CRM system and a mobile app.
Inheritance: Allows a class to inherit properties and behavior from another class. Example: Parent class 'Vehicle' and child class 'Car'.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: Class 'Employee' with private variables and public methods.
Polymorphism: Ability to present the same interfac...read more
Q77. Circuit Diagram
A circuit diagram is a graphical representation of an electrical circuit.
It shows the components and connections in the circuit
Symbols are used to represent each component
Lines represent the wires connecting the components
It helps in understanding the circuit's function and troubleshooting
Examples include diagrams for simple circuits like a flashlight or complex circuits like a computer motherboard
Q78. What is singleton class explain with example
A singleton class is a class that can only have one instance created throughout the entire application.
Singleton classes are used when we want to restrict the number of instances of a class to one.
They are often used in scenarios where we need to maintain a single point of control or coordination.
For example, a logger class can be implemented as a singleton class to ensure that only one instance of the logger is created and used throughout the application.
Q79. what is subnetting
Subnetting is the process of dividing a network into smaller subnetworks, called subnets, to improve network efficiency and security.
Subnetting allows for better utilization of IP addresses by dividing a network into smaller segments.
It helps in improving network performance by reducing network congestion.
Subnetting enhances network security by isolating different departments or devices within a network.
It enables efficient routing and reduces broadcast traffic.
Example: A net...read more
Q80. what are protocols
Protocols are a set of rules and guidelines that govern the communication between devices or systems.
Protocols define the format and order of messages exchanged between devices.
They ensure reliable and efficient communication by specifying error detection and correction mechanisms.
Examples of protocols include TCP/IP, HTTP, SMTP, and FTP.
Protocols can operate at different layers of the network stack, such as the application layer, transport layer, or network layer.
Q81. How to connect mongoDB in python
Use pymongo library to connect mongoDB in python
Install pymongo library using pip
Import pymongo in your python script
Create a MongoClient object with the connection string
Access the database and collection using the MongoClient object
Q82. What is java and there features.
Java is a high-level programming language known for its platform independence and object-oriented features.
Java is platform-independent, meaning it can run on any device with a Java Virtual Machine (JVM)
Java is object-oriented, allowing for modular and reusable code
Java has automatic memory management through garbage collection
Java supports multithreading for concurrent programming
Java has a rich set of APIs and libraries for various functionalities
Q83. 2. What are decorators in Python
Decorators are functions that modify the behavior of other functions without changing their source code.
Decorators are denoted by the '@' symbol followed by the decorator function name
They can be used to add functionality to a function, such as logging or timing
They can also be used to modify the behavior of a function, such as adding caching or authentication
Decorators can be stacked on top of each other to apply multiple modifications to a function
Example: @staticmethod, @c...read more
Q84. write code for polymorphism?
Polymorphism is achieved through method overriding and method overloading.
Polymorphism allows objects of different classes to be treated as if they are objects of the same class.
Method overriding is when a subclass provides its own implementation of a method that is already defined in its superclass.
Method overloading is when a class has multiple methods with the same name but different parameters.
Polymorphism can be achieved through interfaces as well.
Example: Animal class w...read more
Q85. What is interfaces nad abstract ?
Interfaces and abstract are programming concepts used to achieve abstraction and modularity in code.
Interfaces define a set of methods that a class must implement.
Abstract classes are classes that cannot be instantiated and can have both abstract and non-abstract methods.
Both concepts are used to achieve abstraction and modularity in code.
Interfaces are used to define contracts between classes, while abstract classes are used to provide a base implementation for subclasses.
Ja...read more
Q86. malloc and calloc? what is union? code for factorial
malloc and calloc are memory allocation functions in C. Union is a data type that allows storing different data types in the same memory location. Factorial is a mathematical operation.
malloc() allocates a block of memory of specified size and returns a pointer to the first byte of the block.
calloc() allocates a block of memory for an array of elements, initializes them to zero, and returns a pointer to the first byte of the block.
Union is a data type that allows storing diff...read more
Q87. tell me about query optimization?
Query optimization is the process of improving the efficiency and performance of database queries.
Identifying slow queries and analyzing their execution plans
Creating appropriate indexes on tables to speed up query execution
Rewriting queries to use efficient joins and filters
Using query hints or optimizer hints to guide the query optimizer
Regularly monitoring and tuning the database for optimal performance
Q88. What are the DML commands you have used
DML commands I have used include INSERT, UPDATE, DELETE in SQL databases.
INSERT: Used to add new records to a table
UPDATE: Used to modify existing records in a table
DELETE: Used to remove records from a table
Q89. String reversal without out using any method
Reverse a string without using any built-in methods
Create a new array to store the reversed string
Iterate through the original string from end to start and add each character to the new array
Join the characters in the new array to form the reversed string
Q90. Write a paragraph on
A system engineer is responsible for designing, implementing, and maintaining computer systems and networks.
System engineers design and implement computer systems and networks
They ensure the systems are secure and reliable
They troubleshoot and resolve technical issues
They work with other IT professionals to ensure the systems meet business needs
Examples of systems they may work on include servers, databases, and cloud computing platforms
Q91. Model a milling process
A milling process involves removing material from a workpiece using a rotating cutting tool.
Select appropriate cutting tool and workpiece material
Determine the cutting speed, feed rate, and depth of cut
Set up the milling machine and secure the workpiece
Start the machine and monitor the process for any issues
Inspect the finished product for accuracy and quality
Q92. What are the OOPs 4 pillars ?
The 4 pillars of OOPs are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class.
Encapsulation restricts access to certain components within a class, protecting the data.
Abstraction hides complex implementation details and only shows the necessary features.
Polymorphism allows objects to be treated as instances of their parent class or their own class.
Q93. Convert Binary to Octal
Binary to Octal conversion involves grouping binary digits into sets of three and then converting each set to its corresponding octal digit.
Group binary digits into sets of three starting from the rightmost digit
If the leftmost set has less than three digits, add zeros to the left
Convert each set of three binary digits to its corresponding octal digit
Combine all the octal digits to get the final octal number
Q94. Explain DBMS?
DBMS stands for Database Management System. It is a software that manages and organizes data in a structured manner.
DBMS is a software system that allows users to create, retrieve, update, and manage databases.
It provides an interface for users to interact with the database and perform various operations.
DBMS ensures data integrity, security, and consistency.
It supports multiple users accessing the database simultaneously.
Examples of popular DBMS include Oracle, MySQL, SQL Se...read more
Q95. How to install os on server
To install an OS on a server, you need to boot from the installation media and follow the on-screen instructions.
Insert the installation media (such as a USB drive or DVD) into the server
Boot the server from the installation media
Follow the on-screen instructions to select the OS version, partition the disk, and complete the installation process
Q96. Types of joins?
Types of joins in SQL include inner join, left join, right join, and full outer join.
Inner join returns only the matching rows from both tables.
Left join returns all rows from the left table and the matching rows from the right table.
Right join returns all rows from the right table and the matching rows from the left table.
Full outer join returns all rows from both tables, including unmatched rows.
Q97. file handle in c?
A file handle in C is a pointer that represents a file stream, allowing operations like reading and writing.
A file handle is typically obtained by opening a file using functions like fopen()
File handles are used to perform operations like reading, writing, and closing files
They can be passed as arguments to functions like fread(), fwrite(), and fclose()
File handles can be used to check for errors during file operations
Q98. what is module.exports
module.exports is a special object in Node.js that allows you to export functions, objects, or primitive values from a module.
Used to export functions, objects, or primitive values from a module
Can be assigned directly to a function, object, or value to be exported
Commonly used in Node.js to create reusable modules
Q99. what is page object model
Page Object Model is a design pattern used in test automation to create an object repository for web elements on a web page.
It helps in creating reusable and maintainable code for automated tests.
Each web page is represented as a class, and the elements on the page are defined as variables within the class.
Methods are created to perform actions on these elements, making the tests more readable and easier to maintain.
Page Object Model promotes code reusability and reduces code...read more
Q100. 1. Find if a number belongs to a Fibonacci series
Check if a number belongs to Fibonacci series
Check if the given number is a perfect square
If yes, check if 5*n^2 + 4 or 5*n^2 - 4 is a perfect square
If yes, then the number belongs to Fibonacci series
More about working at TCS
Top HR Questions asked in MikeLegal
Interview Process at MikeLegal
Top System Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month