Premium Employer

Persistent Systems

3.5
based on 3.6k Reviews
Filter interviews by

400+ Interview Questions and Answers

Updated 10 Dec 2024
Popular Designations
Q1. Implement indexOf()

You are given two strings A and B. Find the index of the first occurrence of A in B. If A is not present in B, then return -1.

For Example:
A = “bc”, B = “abcddbc”. String “A” is present at ...read more
View 3 more answers
Q2. LCA In A BST

You are given a binary search tree of integers with N nodes. You are also given references to two nodes P and Q from this BST.

Your task is to find the lowest common ancestor(LCA) of these two given...read more

View 3 more answers
Q3. Cycle Detection in a Singly Linked List

You have given a Singly Linked List of integers, determine if it forms a cycle or not.

A cycle occurs when a node's next points back to a previous node in the list. The li...read more

View 3 more answers
Q4. Subarray With Given Sum

Given an array ARR of N integers and an integer S. The task is to find whether there exists a subarray(positive length) of the given array such that the sum of elements of the subarray eq...read more

View 2 more answers
Discover null interview dos and don'ts from real experiences
Q5. First non repeating character

Ninja is now bored with numbers and is now playing with characters but hates when he gets repeated characters. Ninja is provided a string, and he wants to return the first unique ch...read more

View 2 more answers
Q6. K Largest Elements You are given with an integer k and an array of integers that contain numbers in random order. Write a program to find k largest numbers from given array. You need to save them in an array an...read more
Ans.

Given an unsorted array, find the K largest elements in non-decreasing order.

  • Sort the array in non-decreasing order.

  • Return the last K elements of the sorted array.

View 5 more answers
Are these interview questions helpful?
Q7. DBMS Questions

Write a query from an employee table to find the salaries of the employees having even emp -id number
Explain 2,3- tier architecture and explain vies in DBMS.
Explain serialization
Explain ACID prop...read more

Add your answer

Q8. 7. what is public and private IP. how are they different

Ans.

Public and private IP addresses are used in computer networks. Public IPs are globally unique and accessible from the internet, while private IPs are used within a local network.

  • Public IP is assigned by the Internet Service Provider (ISP) and is used to identify a device on the internet.

  • Private IP is assigned by a local network administrator and is used to identify a device within a local network.

  • Public IPs are globally unique, allowing devices to communicate with each other ...read more

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Write a program for reversing a string without using string function

Ans.

Program to reverse a string without using string function

  • Iterate through the string from end to start and append each character to a new string

  • Use a loop to swap the first and last characters, then move towards the middle until the entire string is reversed

  • Convert the string to a character array, then swap the first and last elements until the entire array is reversed

View 1 answer

Q10. what is basic difference between c and cpp. explain on memory levels

Ans.

C is a procedural programming language while C++ is an object-oriented programming language.

  • C is a procedural programming language, meaning it focuses on procedures or functions.

  • C++ is an extension of C and adds object-oriented features like classes and inheritance.

  • C++ supports polymorphism, encapsulation, and abstraction, which C lacks.

  • C++ allows the use of standard template library (STL) for data structures and algorithms.

  • C++ has exception handling mechanisms, whereas C doe...read more

Add your answer

Q11. What are keys in database and why do we use them?

Ans.

Keys in a database are unique identifiers used to establish relationships between tables and ensure data integrity.

  • Keys are used to uniquely identify records in a database table.

  • Primary keys are used to uniquely identify each record in a table.

  • Foreign keys establish relationships between tables.

  • Keys help enforce data integrity and maintain consistency in the database.

  • Examples of keys include primary keys, foreign keys, and unique keys.

Add your answer

Q12. explain what is deadloacks and ways to prevent them

Ans.

Deadlocks are situations where two or more processes are unable to proceed because each is waiting for the other to release a resource.

  • Deadlocks occur when multiple processes are stuck in a circular waiting state.

  • Prevention techniques include resource allocation strategies, deadlock detection, and avoidance algorithms.

  • Examples of prevention techniques are using a resource allocation graph, implementing a banker's algorithm, and employing timeouts and resource preemption.

Add your answer

Q13. 8. Explain how a message is transferred in OSI layer

Ans.

A message is transferred in OSI layer through a process called encapsulation and decapsulation.

  • The message is divided into smaller chunks called packets at the transport layer.

  • Each packet is then encapsulated with headers containing necessary information.

  • The encapsulated packets are then passed down to the network layer.

  • At the network layer, the packets are further encapsulated with network layer headers.

  • The encapsulated packets are then passed down to the data link layer.

  • At ...read more

Add your answer

Q14. what is Polymorphism. what are its 3 conditions

Ans.

Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.

  • Polymorphism is achieved through method overriding and method overloading.

  • It allows for code reusability and flexibility in object-oriented programming.

  • Three conditions for polymorphism are inheritance, method overriding, and a common interface or base class.

Add your answer

Q15. 2. Explain how does Prediction works

Ans.

Prediction uses data analysis and statistical models to forecast future outcomes.

  • Prediction involves collecting and analyzing data to identify patterns and trends.

  • Statistical models are then used to make predictions based on the identified patterns.

  • Predictions can be made for a wide range of applications, such as weather forecasting, stock market trends, and customer behavior.

  • Accuracy of predictions can be improved by using machine learning algorithms and incorporating new da...read more

Add your answer
Q16. OS Questions

Explain Thrashing .
Explain segmentation
State deadlock detection and prevention methods.
Explain dinning philosopher problem
Explain page fault with example.

Add your answer

Q17. Do you know about My Passion Challenge test?

Ans.

Yes, My Passion Challenge test is a coding competition for software engineers.

  • My Passion Challenge test is a coding competition that evaluates the coding skills of software engineers.

  • It is designed to test problem-solving abilities, algorithmic thinking, and coding proficiency.

  • Participants are given a set of coding challenges to solve within a specified time limit.

  • The challenges can range from simple to complex, covering various programming languages and concepts.

  • The test ass...read more

Add your answer

Q18. 3 wheels & one scooter, each wheel can travel 5km. What will be the max distance that can be travelled?

Ans.

The max distance that can be traveled is 15km.

  • Each wheel can travel 5km, so with 3 wheels, the total distance is 15km.

  • The scooter itself does not limit the distance that can be traveled, only the wheels do.

Add your answer

Q19. 3. Draw flow Chart of classification algorithms

Ans.

Classification algorithms can be represented using flow charts.

  • Classification algorithms are used to categorize data into different classes.

  • Flow charts can be used to represent the decision-making process of classification algorithms.

  • Examples of classification algorithms include decision trees, k-nearest neighbors, and support vector machines.

Add your answer

Q20. Why do we normalise our database?

Ans.

Normalisation reduces data redundancy and improves data integrity in a database.

  • Prevents data duplication and inconsistencies

  • Simplifies database maintenance and updates

  • Improves query performance

  • Enforces data integrity and consistency

  • Follows best practices for database design

  • Examples: breaking down a customer table into separate tables for orders, addresses, and payments

  • Examples: creating a separate table for product categories instead of repeating the category name in each pr...read more

Add your answer

Q21. 1. what is Machine Learning

Ans.

Machine learning is a subset of artificial intelligence that enables machines to learn from data without being explicitly programmed.

  • It involves training algorithms on large datasets to make predictions or decisions.

  • It can be supervised, unsupervised, or semi-supervised.

  • Examples include image recognition, natural language processing, and recommendation systems.

Add your answer

Q22. What is nodejs and difference between nodejs and javascript

Ans.

Node.js is a server-side JavaScript runtime environment.

  • Node.js is built on top of the V8 JavaScript engine from Google Chrome.

  • It allows developers to write server-side code in JavaScript.

  • Node.js has a non-blocking I/O model, making it efficient for handling large amounts of data.

  • Node.js has a vast library of modules available through npm (Node Package Manager).

View 1 answer

Q23. How to sort the file in the range (hint provided)

Ans.

Sorting a file within a range

  • Use a sorting algorithm like quicksort or mergesort

  • Read the file and store the data in an array or list

  • Sort the array or list within the given range

  • Write the sorted data back to the file

Add your answer

Q24. What is default values of variables?

Ans.

Default values of variables are the initial values assigned to variables if no value is explicitly provided.

  • Default value for integer variables is 0

  • Default value for floating point variables is 0.0

  • Default value for boolean variables is false

  • Default value for string variables is null

  • Default value for arrays is null

Add your answer

Q25. basic important difference between java and cpp

Ans.

Java is platform independent while C++ is not.

  • Java code is compiled into bytecode which can run on any platform with a JVM, while C++ code needs to be compiled separately for each platform.

  • Java has automatic memory management through garbage collection, while C++ requires manual memory management.

  • Java has built-in support for multithreading, while C++ requires external libraries.

  • Java has a simpler syntax and is easier to learn than C++.

  • C++ allows for low-level memory manipula...read more

Add your answer

Q26. what is the difference between function overloading and function overriding?

Ans.

Function overloading is having multiple functions with the same name but different parameters. Function overriding is having a function in a subclass with the same name and parameters as a function in the superclass.

  • Function overloading is a compile-time polymorphism concept.

  • Function overriding is a runtime polymorphism concept.

  • Function overloading is used to provide different implementations of the same function for different input parameters.

  • Function overriding is used to p...read more

Add your answer
Q27. Star Pattern

Write a program to print the follwing pattern in javascript.
*******
** **
* * * *
* ** *
* * * *
** **
*******

Ans.

The program prints a star pattern using asterisks and spaces.

  • Use nested loops to iterate through rows and columns.

  • Determine the number of asterisks and spaces to print in each row.

  • Use conditional statements to decide when to print an asterisk or a space.

View 2 more answers

Q28. What is Difference between let var const,

Ans.

let, var, and const are all used to declare variables in JavaScript, but they have different scoping rules and behaviors.

  • let and const were introduced in ES6, while var has been around since the beginning of JavaScript.

  • let and const are block-scoped, while var is function-scoped.

  • Variables declared with const cannot be reassigned, while let and var can be.

  • const variables must be initialized when they are declared, while let and var can be declared without initialization.

  • Exampl...read more

Add your answer

Q29. Find the second largest element from an integer array in a single traversal

Ans.

Find the second largest element from an integer array in a single traversal

  • Initialize two variables to store the largest and second largest elements

  • Traverse the array and update the variables accordingly

  • Return the second largest element

Add your answer

Q30. 3. Write a query to demonstrate outer join on given tables.

Ans.

Demonstrate outer join using SQL query

  • Use LEFT OUTER JOIN or RIGHT OUTER JOIN to include all records from one table and matching records from another table

  • Use the ON keyword to specify the join condition

  • Use COALESCE function to handle NULL values in the result set

Add your answer

Q31. which language was used in rocket launching software?

Ans.

The language used in rocket launching software is typically Ada.

  • Ada is a high-level programming language designed for embedded systems and real-time applications.

  • Ada is known for its strong typing and safety features, making it suitable for critical systems like rocket launching software.

Add your answer

Q32. 5. what is Banker's algorithm

Ans.

Banker's algorithm is a resource allocation and deadlock avoidance algorithm used in operating systems.

  • It is used to prevent deadlocks by ensuring that the system never enters an unsafe state.

  • It works by simulating the allocation of resources and checking if the system will remain in a safe state.

  • It requires knowledge of the maximum resource needs of each process and the currently available resources.

  • If a request for resources would result in an unsafe state, the request is d...read more

Add your answer

Q33. Interoperability in Inheritance and polymorphism

Ans.

Interoperability in inheritance and polymorphism allows objects of different classes to be used interchangeably.

  • Inheritance allows a subclass to inherit properties and methods from a superclass.

  • Polymorphism allows objects of different classes to be treated as if they are of the same class.

  • Interoperability between inheritance and polymorphism allows objects of different classes to be used interchangeably.

  • For example, a subclass can be used wherever a superclass is expected, an...read more

Add your answer

Q34. What are features of C++?

Ans.

C++ is a high-level programming language with features like object-oriented programming, templates, and memory management.

  • C++ supports object-oriented programming concepts like encapsulation, inheritance, and polymorphism.

  • Templates allow generic programming and code reusability.

  • C++ provides low-level memory manipulation through pointers.

  • Standard Template Library (STL) provides a collection of classes and functions for data structures and algorithms.

  • C++ supports operator overl...read more

Add your answer

Q35. What are issues in cloud?

Ans.

Issues in cloud include security, downtime, vendor lock-in, and data privacy.

  • Security concerns such as data breaches and unauthorized access

  • Downtime and service interruptions affecting business operations

  • Vendor lock-in and limited flexibility in choosing cloud providers

  • Data privacy and compliance with regulations such as GDPR and HIPAA

Add your answer

Q36. What data structure has implemented in a elevator.

Ans.

The data structure implemented in an elevator is a queue.

  • Elevator requests are added to the queue in the order they are received.

  • The elevator serves requests in a first-come, first-served manner.

  • Once a request is completed, it is removed from the queue.

  • Example: If someone on the 5th floor requests the elevator, their request is added to the queue and the elevator will serve it after completing any previous requests.

View 1 answer

Q37. implement binary search on linked list

Ans.

Implementing binary search on a linked list

  • Find the middle element of the linked list

  • Compare the middle element with the search key

  • If the middle element is greater than the search key, search in the left half of the linked list

  • If the middle element is less than the search key, search in the right half of the linked list

  • Repeat until the search key is found or the entire linked list is traversed

Add your answer

Q38. Explain encapsulation & abstraction difference.

Ans.

Encapsulation is bundling data and methods together, while abstraction is hiding the implementation details.

  • Encapsulation combines data and methods into a single unit (class).

  • Abstraction hides the complex implementation details and only shows the necessary features.

  • Encapsulation provides data security by restricting access to certain data members.

  • Abstraction allows for easier maintenance and modification of code.

  • Example: Encapsulation - a class with private data members and p...read more

Add your answer

Q39. Flow diagram of final year project

Ans.

The flow diagram of my final year project showcases the step-by-step process of its execution.

  • The flow diagram illustrates the sequence of activities and their dependencies.

  • It helps in understanding the overall structure and logic of the project.

  • Each step in the diagram represents a specific task or action.

  • Arrows indicate the flow of control or data between different steps.

  • Decision points are represented by diamond-shaped symbols.

  • Example: Start -> Input Data -> Process Data -...read more

Add your answer

Q40. What are the recommendation systems you worked on?

Ans.

I have worked on building recommendation systems for e-commerce websites and streaming platforms.

  • Implemented collaborative filtering algorithms to recommend products based on user behavior

  • Utilized content-based filtering to suggest movies or TV shows based on user preferences

  • Developed hybrid recommendation systems combining collaborative and content-based filtering techniques

Add your answer

Q41. what is express js and why it is used in web apps and what is body parser

Ans.

Express.js is a popular Node.js web framework used for building web applications. Body-parser is a middleware used to parse incoming request bodies.

  • Express.js is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

  • It provides a way to handle HTTP requests and responses, routing, middleware, and more.

  • Body-parser is a middleware used to parse incoming request bodies in a middleware before your handlers,...read more

Add your answer

Q42. what are the scope in javascript, describe each one.

Ans.

Scopes in JavaScript determine the accessibility of variables and functions.

  • Global scope: variables and functions declared outside any function are accessible globally

  • Local scope: variables and functions declared inside a function are only accessible within that function

  • Block scope: variables declared with let and const are only accessible within the block they are declared in

  • Function scope: variables declared with var are accessible within the function they are declared in

Add your answer

Q43. Find 2nd largest element in an array where elements can be repeated. In O(n) complexity

Ans.

Find 2nd largest element in an array with repeated elements in O(n) complexity.

  • Traverse the array once and keep track of the largest and second largest elements.

  • If the current element is greater than the largest element, update both largest and second largest elements.

  • If the current element is between the largest and second largest elements, update only the second largest element.

Add your answer

Q44. What is Big Data?

Ans.

Big Data refers to large and complex data sets that cannot be processed using traditional data processing methods.

  • Big Data is characterized by the 3Vs - Volume, Velocity, and Variety.

  • It requires specialized tools and technologies such as Hadoop, Spark, and NoSQL databases.

  • Examples of Big Data include social media data, sensor data, and financial market data.

Add your answer

Q45. What are transaction logs

Ans.

Transaction logs are records of all the changes made to a database or file system.

  • They help in recovering data in case of system failure or errors.

  • They provide a history of all the transactions made to the database or file system.

  • They are used for auditing and compliance purposes.

  • Examples include SQL Server transaction logs, file system transaction logs, etc.

Add your answer

Q46. Hands on SQL quesries to create and manipulate table and table elements.

Ans.

Hands-on experience with SQL queries for creating and manipulating tables and table elements.

  • Use CREATE TABLE statement to create a new table

  • Use ALTER TABLE statement to add, modify, or delete columns in a table

  • Use INSERT INTO statement to add new rows of data into a table

  • Use UPDATE statement to modify existing data in a table

  • Use DELETE statement to remove rows from a table

Add your answer

Q47. Java 8 features, disadvantages of microservices, difference between RDBMS and NoSQL DB, What is difference between a defect severity and priority, what is defect density and defect slippage, how will you handle...

read more
Ans.

Answering questions related to Java 8 features, microservices, RDBMS vs NoSQL DB, defect severity and priority, defect density and slippage, handling difficult clients and conflicts within the team.

  • Java 8 features include lambda expressions, streams, functional interfaces, and default methods.

  • Disadvantages of microservices include increased complexity, difficulty in testing, and potential communication issues.

  • RDBMS is a relational database management system that uses tables w...read more

View 2 more answers

Q48. Python is interpreted then why .pyc files are there?

Ans.

Python compiles source code to bytecode for faster execution, stored in .pyc files.

  • Python interpreter compiles source code to bytecode before execution

  • Bytecode is platform-independent and faster to execute than source code

  • Compiled bytecode is stored in .pyc files for future use and faster startup time

  • If source code is modified, .pyc files are automatically recompiled

Add your answer

Q49. Puzzle- You have a 3 gallon and 5 gallon jug, how would you fill a 4 gallon jug?

Ans.

Fill the 3 gallon jug, pour it into the 5 gallon jug, fill the 3 gallon jug again, pour it into the 5 gallon jug until it is full, leaving 1 gallon in the 3 gallon jug.

  • Fill the 3 gallon jug

  • Pour the 3 gallon jug into the 5 gallon jug

  • Fill the 3 gallon jug again

  • Pour the 3 gallon jug into the 5 gallon jug until it is full

  • The 4 gallon jug will have 1 gallon of water

Add your answer

Q50. What do you mean by cloud computing

Ans.

Cloud computing refers to the delivery of computing services over the internet.

  • Cloud computing allows users to access data and applications from anywhere with an internet connection

  • It eliminates the need for physical servers and hardware, reducing costs and increasing scalability

  • Examples include Amazon Web Services, Microsoft Azure, and Google Cloud Platform

Add your answer

Q51. what is precompilaion unit?

Ans.

Precompilation unit is a compiled code that can be reused by multiple source files.

  • Precompilation unit is created by the compiler from the source code.

  • It contains the compiled code of header files and other dependencies.

  • It can be reused by multiple source files, reducing compilation time.

  • It is also known as precompiled header or PCH.

  • Example: stdafx.h in Visual Studio is a precompiled header file.

Add your answer

Q52. what is thrashing

Ans.

Thrashing is a phenomenon in computer systems where excessive swapping of data between RAM and virtual memory occurs.

  • Occurs when a computer spends more time swapping data between RAM and virtual memory than executing actual tasks

  • Can be caused by insufficient RAM or poorly optimized programs

  • Can lead to a significant decrease in system performance

  • Example: A computer running multiple memory-intensive programs simultaneously may experience thrashing

Add your answer

Q53. SQL - Find duplicate, Order BY Reverse a Linked List Real-life examples for Stack and Queues

Ans.

SQL query to find duplicates, reversing a linked list, real-life examples of stacks and queues

  • To find duplicates in SQL, use GROUP BY and HAVING clauses

  • To reverse a linked list, iterate through the list and change the pointers

  • Stacks: back button in a web browser, undo feature in text editors

  • Queues: waiting in line at a grocery store, printer queue for printing documents

Add your answer

Q54. 1. What is API Testing 2. HTTP error codes 3. How to test API 4. Types of API 5. Questions on JAVA, oops concept 6. Sudo code for prime number 7. Questions on Performance Testing 8. How you are doing performanc...

read more
Ans.

Interview questions for Project Lead position covering API testing, HTTP error codes, performance testing, Java, authentication, Swagger, AWS, and project-related questions.

  • API testing involves testing the functionality, reliability, performance, and security of APIs.

  • HTTP error codes are status codes returned by a server to indicate the status of a request.

  • APIs can be tested using tools like Postman, SoapUI, and JMeter.

  • Types of APIs include REST, SOAP, and GraphQL.

  • Java and OO...read more

Add your answer

Q55. What is closure explain in detail with example

Ans.

Closure is a function that has access to variables in its outer scope, even after the outer function has returned.

  • Closure is created when a function is defined inside another function.

  • The inner function can access variables in the outer function, even after the outer function has returned.

  • Closure can be used to create private variables and functions in JavaScript.

  • Example: function outer() { var x = 10; function inner() { console.log(x); } return inner; } var closure = outer()...read more

Add your answer

Q56. implement conditional hierarchical model for java class

Ans.

Implementing a conditional hierarchical model for a Java class.

  • Create a Java class with multiple levels of hierarchy

  • Implement conditional statements to control the behavior of the class based on certain conditions

  • Use if-else or switch statements to define different actions for different conditions

  • Consider using interfaces or abstract classes for better abstraction and modularity

Add your answer

Q57. what is callback hell, what is Promises?

Ans.

Callback hell is a situation where nested callbacks make code unreadable. Promises are a solution to this problem.

  • Callback hell occurs when there are too many nested callbacks in asynchronous code

  • It makes the code difficult to read and maintain

  • Promises are a way to handle asynchronous operations without nested callbacks

  • Promises can be used to chain multiple asynchronous operations together

  • Promises have a resolve and reject function to handle success and failure respectively

Add your answer

Q58. How do you define 'many-to-many' relationship in Hibernate when there are no common columns between two tables?

Ans.

Many-to-many relationship in Hibernate without common columns

  • Create a third table with foreign keys to both tables

  • Use @ManyToMany annotation in both entity classes

  • Specify the join table name and column names in @JoinTable annotation

Add your answer

Q59. Oops concepts , difference between encapsulation and abstract and Polymorphism

Ans.

Encapsulation is bundling data and methods together, abstraction is hiding implementation details, and polymorphism allows objects to be treated as instances of their parent class.

  • Encapsulation involves bundling data and methods within a class to restrict access from outside.

  • Abstraction involves hiding the implementation details of a class and only showing the necessary features.

  • Polymorphism allows objects to be treated as instances of their parent class, enabling flexibility...read more

Add your answer

Q60. What is copy assignment operator?

Ans.

Copy assignment operator is a special member function in C++ that allows one object to be assigned the values of another object of the same class.

  • Copy assignment operator is denoted by the = operator.

  • It is used to copy the values of one object into another object of the same class.

  • It is automatically generated by the compiler if not explicitly defined.

  • Example: MyClass obj1; MyClass obj2; obj2 = obj1; // Copy assignment operator is called

Add your answer

Q61. Write a query to find the second highest salary in a table.

Ans.

Query to find the second highest salary in a table.

  • Use the MAX() function to find the highest salary.

  • Use the WHERE clause to exclude the highest salary from the result.

  • Use the MAX() function again to find the second highest salary.

View 1 answer

Q62. explain any one of data structure you know

Ans.

Binary Search Tree

  • A binary tree where each node has at most two children

  • Left child is less than parent, right child is greater

  • Allows for efficient searching, insertion, and deletion

Add your answer

Q63. What is the best approach to finding whether the data frame is empty or not?

Ans.

Use the len() function to check the length of the data frame.

  • Use len() function to get the number of rows in the data frame.

  • If the length is 0, then the data frame is empty.

  • Example: if len(df) == 0: print('Data frame is empty')

Add your answer

Q64. What is a constructor in C++?

Ans.

A constructor in C++ is a special member function that is automatically called when an object is created.

  • Constructors have the same name as the class and do not have a return type.

  • They can be used to initialize the object's data members.

  • Default constructors are automatically generated if no constructor is defined.

  • Parameterized constructors can be defined to accept arguments during object creation.

Add your answer

Q65. First 50 Prime Number

Ans.

The first 50 prime numbers are...

  • Start with 2, the first prime number

  • Check each odd number greater than 2

  • Use trial division to check if a number is prime

  • Stop when you have found 50 prime numbers

Add your answer

Q66. How do you find the second largest integer in an array without using collections or without sorting the array?

Ans.

Find second largest integer in an array without sorting or using collections.

  • Iterate through array and keep track of largest and second largest integers.

  • Compare each element with current largest and second largest integers.

  • Return second largest integer.

Add your answer

Q67. Write a code for half pyramid using numbers

Ans.

Code for half pyramid using numbers

  • Use nested loops to print the numbers in each row

  • The number of columns in each row should be equal to the row number

  • Start the loop from 1 and go up to the desired number of rows

Add your answer

Q68. 2 programming code on any language of your choice

Ans.

Two programming code examples in any language

  • Example 1: Python - print('Hello, World!')

  • Example 2: Java - System.out.println('Hello, World!')

Add your answer

Q69. what is passport.js why it is used

Ans.

Passport.js is an authentication middleware for Node.js.

  • Passport.js provides a simple way to authenticate users with various authentication strategies such as local, OAuth, OpenID, etc.

  • It is highly customizable and can be integrated with any Node.js web application framework.

  • Passport.js maintains user sessions and provides a consistent API for authentication across different strategies.

  • Example: Using Passport.js with Express.js to authenticate users with Google OAuth2.

  • Example...read more

Add your answer

Q70. What is the difference between repartition and Coelsce?

Ans.

Repartition increases or decreases the number of partitions in a DataFrame, while Coalesce only decreases the number of partitions.

  • Repartition can increase or decrease the number of partitions in a DataFrame, leading to a shuffle of data across the cluster.

  • Coalesce only decreases the number of partitions in a DataFrame without performing a full shuffle, making it more efficient than repartition.

  • Repartition is typically used when there is a need to increase the number of parti...read more

Add your answer

Q71. What is virtualization in C++?

Ans.

Virtualization in C++ is the process of creating a virtual version of a class or function to allow for polymorphism and dynamic binding.

  • Virtualization in C++ is achieved through the use of virtual functions and inheritance.

  • Virtual functions are declared in a base class and overridden in derived classes to provide different implementations.

  • Virtualization allows for polymorphism, where a pointer to a base class can point to objects of derived classes.

  • Dynamic binding is used to ...read more

Add your answer

Q72. What is smart pointers?

Ans.

Smart pointers are objects that act like pointers but provide automatic memory management.

  • Smart pointers help prevent memory leaks by automatically deallocating memory when no longer needed.

  • Examples include unique_ptr, shared_ptr, and weak_ptr in C++.

  • They provide better memory safety compared to raw pointers.

Add your answer

Q73. Implement tree or queue data structure

Ans.

A tree is a hierarchical data structure with nodes connected by edges. A queue is a linear data structure that follows the FIFO principle.

  • A tree can be implemented using linked lists or arrays.

  • A queue can be implemented using arrays or linked lists.

  • In a tree, each node can have multiple child nodes.

  • In a queue, elements are added at the rear and removed from the front.

  • Both data structures are commonly used in computer science and have various applications.

Add your answer

Q74. What is oop, Will sorting the list for finding two lowest elements in list be an optimal solution, what are ACID properties

Ans.

OOP stands for Object-Oriented Programming. Sorting the list for finding two lowest elements may not be optimal. ACID properties are atomicity, consistency, isolation, and durability.

  • OOP is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.

  • Sorting the list to find two lowest elements may not be optimal as it has a time complexity of O(n log n). A more efficient solution would be to iterate t...read more

Add your answer

Q75. Write media query for showing 3 divs in a row for desktop view and in column for mobile view

Ans.

Media query for 3 divs in row for desktop and column for mobile view

  • Use min-width and max-width to target desktop and mobile views respectively

  • Set display property to flex and flex-wrap to wrap for desktop view

  • Set display property to block for mobile view

Add your answer

Q76. How security works in apex, let's say user don't have access on Phone field and SELECT id, Name, Phone from Account WITH_SECURITY_ENFORCED how this query works?

Ans.

In Apex, security is enforced by default. If a user doesn't have access to a field, they won't be able to query it.

  • In Apex, security is enforced by default, meaning that users can only access data they have permission to see.

  • If a user doesn't have access to the Phone field in the Account object, they won't be able to query it even with WITH_SECURITY_ENFORCED.

  • The SELECT id, Name, Phone from Account WITH_SECURITY_ENFORCED query will only return the id and Name fields for users ...read more

Add your answer

Q77. what is event loops and phases

Ans.

Event loop is a mechanism that allows JavaScript to perform non-blocking I/O operations.

  • Event loop is a loop that constantly checks the message queue and executes the next message if there is any.

  • Phases are the different stages of the event loop, such as timers, I/O callbacks, idle, and poll.

  • Event loop is crucial for Node.js to handle multiple requests simultaneously without blocking the main thread.

  • Example: setTimeout() function is added to the timer phase and executed after...read more

Add your answer

Q78. Find indexes of two values in an array who's Sum is 8 or a dynamic value

Ans.

Find indexes of two values in an array whose sum is 8 or a dynamic value

  • Iterate through the array and store the indexes of each element in a dictionary with the difference between the target sum and the element as the key

  • Check if the current element exists in the dictionary, if so, return the indexes of the two elements

  • Handle cases where the target sum is dynamic by replacing 8 with a variable

Add your answer

Q79. Gave two pattern codes to solve

Ans.

I can provide solutions for pattern codes in software engineering interviews.

  • Understand the pattern and break it down into smaller components

  • Use loops and conditional statements to generate the desired pattern

  • Test the code with different inputs to ensure it works correctly

Add your answer

Q80. 1. Pattern Printing Program

Ans.

A program to print patterns using arrays of strings.

  • Create an array of strings to hold the pattern

  • Use loops to fill the array with the desired pattern

  • Print the array to display the pattern

Add your answer

Q81. How does PUT method behave when there is no data to update?

Ans.

PUT method updates data if available, else returns success with no changes.

  • PUT method updates the resource if it exists, else creates a new resource

  • If no data is provided, the server returns a success response with no changes made

  • Example: PUT /users/1 with empty body will return success with no changes if user with id 1 exists

Add your answer

Q82. Two SQL Codes and Two Python codes like reverse a string ?

Ans.

Reverse a string using SQL and Python codes.

  • In SQL, use the REVERSE function to reverse a string.

  • In Python, use slicing with a step of -1 to reverse a string.

Add your answer

Q83. Explain layers of OSI model. Which one would you use OSI or TCP/UDP and why? Explain with example.

Ans.

The OSI model has 7 layers. OSI or TCP/UDP depends on the application. OSI is used for theoretical understanding while TCP/UDP is used for practical implementation.

  • The 7 layers of OSI model are Physical, Data Link, Network, Transport, Session, Presentation, and Application.

  • OSI model is used for theoretical understanding of networking concepts.

  • TCP/UDP are used for practical implementation of networking protocols.

  • TCP is used for reliable data transfer while UDP is used for fast...read more

Add your answer

Q84. What is functional testing & how many types of functional testing

Ans.

Functional testing is a type of testing that verifies if the software meets the functional requirements.

  • It is a black-box testing technique

  • It focuses on the external behavior of the software

  • It ensures that the software functions as expected

  • Types of functional testing include unit testing, integration testing, system testing, acceptance testing, and regression testing

Add your answer

Q85. what are Microservices? How to manage load balancing in Microservices?

Ans.

Microservices are a software architecture design where applications are broken down into smaller, independent services that communicate with each other through APIs.

  • Microservices are designed to be small, focused, and independently deployable services.

  • Each microservice typically performs a single function or task within the application.

  • Microservices communicate with each other through APIs, often using lightweight protocols like HTTP or messaging queues.

  • Load balancing in micr...read more

Add your answer

Q86. Find count of each characters in string

Ans.

The task is to count the occurrences of each character in a given string.

  • Iterate through the string and use a hashmap to store the count of each character

  • Convert the string to an array of characters for easier manipulation

  • Handle edge cases like empty string or null input

  • Consider using built-in functions like HashMap in Java or Counter in Python

Add your answer

Q87. Find Freq of words in a sentence

Ans.

Use a hashmap to store word frequencies in a sentence.

  • Split the sentence into words using a space delimiter.

  • Create a hashmap to store word frequencies.

  • Iterate through the words and update the frequencies in the hashmap.

  • Return the hashmap with word frequencies.

Add your answer

Q88. difference between http and https.

Ans.

HTTP is unsecured while HTTPS is secured with SSL/TLS encryption.

  • HTTP stands for Hypertext Transfer Protocol while HTTPS stands for Hypertext Transfer Protocol Secure.

  • HTTP operates on port 80 while HTTPS operates on port 443.

  • HTTP is vulnerable to attacks while HTTPS is secure due to SSL/TLS encryption.

  • HTTPS is indicated by a padlock icon in the browser's address bar.

  • HTTPS is used for secure online transactions such as online banking, e-commerce, etc.

Add your answer

Q89. Difference between sort and sorted, dump vs dumps, load vs loads etc.

Ans.

Difference between sort and sorted, dump vs dumps, load vs loads etc.

  • sort() is a method of list object while sorted() is a built-in function

  • dump() serializes an object to a file while dumps() serializes to a string

  • load() deserializes an object from a file while loads() deserializes from a string

Add your answer

Q90. Request mapping annotation syntax and how and where we use it

Ans.

Explaining request mapping annotation syntax and usage in Java development

  • RequestMapping annotation is used to map HTTP requests to specific methods in a controller class

  • It can be used to specify the URL path, HTTP method, request parameters, headers, and more

  • Example: @RequestMapping(value = '/users', method = RequestMethod.GET)

  • This maps a GET request to the '/users' URL path

Add your answer

Q91. 2. Tell me in detail how you implement the extent report

Ans.

Extent report can be implemented by adding the extent report dependency, creating an instance of ExtentReports class, and using ExtentTest class to create test logs.

  • Add the extent report dependency in the project's pom.xml file

  • Create an instance of ExtentReports class in the @BeforeSuite method

  • Create an instance of ExtentTest class in the @BeforeMethod method

  • Use ExtentTest class to log test steps and results

  • Generate the report using the flush() method in the @AfterSuite metho...read more

Add your answer

Q92. How do you make sure some default code executes when the Spring boot applications starts up?

Ans.

Use @PostConstruct annotation or implement CommandLineRunner interface

  • Use @PostConstruct annotation on a method that needs to be executed on startup

  • Implement CommandLineRunner interface and override run() method

  • Add the code that needs to be executed on startup in the method annotated with @PostConstruct or in the run() method

  • Example: @PostConstruct public void init() { //code to be executed on startup }

  • Example: public class MyApp implements CommandLineRunner { public void run...read more

Add your answer

Q93. How do you decide on cores and worker nodes?

Ans.

Cores and worker nodes are decided based on the workload requirements and scalability needs of the data processing system.

  • Consider the size and complexity of the data being processed

  • Evaluate the processing speed and memory requirements of the tasks

  • Take into account the parallelism and concurrency needed for efficient data processing

  • Monitor the system performance and adjust cores and worker nodes as needed

Add your answer

Q94. what is Function hoisting

Ans.

Function hoisting is a JavaScript behavior where function declarations are moved to the top of their scope.

  • Function declarations are moved to the top of their scope during the compilation phase.

  • Function expressions are not hoisted.

  • Hoisting can lead to unexpected behavior and bugs if not understood properly.

Add your answer

Q95. 1) How to communicate between two micro services?

Ans.

Microservices can communicate through synchronous or asynchronous protocols like REST, gRPC, or message brokers.

  • Use RESTful APIs for synchronous communication

  • Use message brokers like Kafka or RabbitMQ for asynchronous communication

  • gRPC can be used for high-performance synchronous communication

  • API Gateway can be used to manage communication between microservices

  • Consider using service mesh like Istio or Linkerd for more advanced communication needs

Add your answer

Q96. Find top 5 countries with highest population in Spark and SQL

Ans.

Use Spark and SQL to find the top 5 countries with the highest population.

  • Use Spark to load the data and perform data processing.

  • Use SQL queries to group by country and sum the population.

  • Order the results in descending order and limit to top 5.

  • Example: SELECT country, SUM(population) AS total_population FROM table_name GROUP BY country ORDER BY total_population DESC LIMIT 5

Add your answer

Q97. how to change create date while uploading the record through data loader?

Ans.

You can change the create date while uploading records through Data Loader by enabling the 'Allow Insert' option.

  • Enable 'Allow Insert' option in Data Loader settings

  • Map the 'Created Date' field in the mapping file to the desired date/time value

  • Ensure the user has the necessary permissions to change the create date

Add your answer

Q98. how wire method works, while importing data want to add record inside wire method in Jsfile how?

Ans.

Wire method in Salesforce is used to fetch data from Apex controller to Lightning Web Component. Adding records inside wire method in JS file involves using imperative Apex to create records.

  • Use @wire decorator in Lightning Web Component JS file to call an Apex method

  • Inside the wire method, use imperative Apex to create records by calling the createRecord method from the Lightning Data Service

  • Pass the record data as parameters to the createRecord method

Add your answer

Q99. What is shuffling? How to Handle Shuffling?

Ans.

Shuffling is the process of redistributing data across partitions in a distributed computing environment.

  • Shuffling is necessary when data needs to be grouped or aggregated across different partitions.

  • It can be handled efficiently by minimizing the amount of data being shuffled and optimizing the partitioning strategy.

  • Techniques like partitioning, combiners, and reducers can help reduce the amount of shuffling in MapReduce jobs.

Add your answer

Q100. What is a catalyst optimiser? How it works?

Ans.

A catalyst optimizer is a query optimization tool used in Apache Spark to improve performance by generating an optimal query plan.

  • Catalyst optimizer is a rule-based query optimization framework in Apache Spark.

  • It leverages rules to transform the logical query plan into a more optimized physical plan.

  • The optimizer applies various optimization techniques like predicate pushdown, constant folding, and join reordering.

  • By optimizing the query plan, it reduces the overall execution...read more

Add your answer
1
2
3
4
5
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at null

based on 284 interviews in the last 1 year
Interview experience
3.9
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.8
 • 2.9k Interview Questions
3.8
 • 356 Interview Questions
4.0
 • 147 Interview Questions
3.7
 • 143 Interview Questions
3.7
 • 142 Interview Questions
3.7
 • 135 Interview Questions
View all
Top Persistent Systems Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter