Add office photos
Engaged Employer

Indiamart Intermesh

3.6
based on 5k Reviews
Video summary
Filter interviews by

10+ India Power Corporation Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Prime Numbers within a Range

Given an integer N, determine and print all the prime numbers between 2 and N, inclusive.

Input:

Integer N

Output:

Prime numbers printed on separate lines

Example:

Input:
N = 10
Out...read more
Ans.

Generate and print all prime numbers between 2 and N, inclusive.

  • Iterate from 2 to N and check if each number is prime

  • A prime number is only divisible by 1 and itself

  • Print each prime number on a new line

View 1 answer

Q2. Find All Pairs Adding Up to Target

Given an array of integers ARR of length N and an integer Target, your task is to return all pairs of elements such that they add up to the Target.

Input:

The first line conta...read more
Ans.

Given an array of integers and a target, find all pairs of elements that add up to the target.

  • Iterate through the array and for each element, check if the difference between the target and the element exists in a hashmap.

  • If it exists, add the pair to the result. If not, add the element to the hashmap.

  • Handle cases where the same element is used twice in a pair.

  • Return the pairs found or (-1, -1) if no pair is found.

Add your answer

Q3. Queue Using Stacks Implementation

Design a queue data structure following the FIFO (First In First Out) principle using only stack instances.

Explanation:

Your task is to complete predefined functions to suppor...read more

Ans.

Implement a queue using stacks with enQueue, deQueue, peek, and isEmpty operations.

  • Use two stacks to simulate a queue - one for enqueueing and one for dequeueing.

  • For enQueue operation, push elements onto the enqueue stack.

  • For deQueue operation, if the dequeue stack is empty, transfer elements from enqueue stack to dequeue stack.

  • For peek operation, return the top element of the dequeue stack.

  • For isEmpty operation, check if both stacks are empty.

  • Example: enQueue(5), enQueue(10)...read more

Add your answer

Q4. Print All Permutations of a String

Given an input string STR, generate and print all possible permutations of the string.

Input:

str

Output:

All permutations of the input string, each on a new line.

Example:

In...read more
Ans.

Generate and print all possible permutations of a given input string.

  • Use recursion to generate all permutations by swapping characters in the string.

  • Maintain a visited array to keep track of characters already used in a particular permutation.

  • Print each permutation as it is generated.

  • Handle duplicate characters by skipping swapping if the character is already in the current position.

Add your answer
Discover India Power Corporation interview dos and don'ts from real experiences

Q5. Swap Kth Elements in an Array

Given an array ARR of size N, perform the operation to swap the Kth element from the beginning with the Kth element from the end of the array.

Example:

Input:
N = 5, K = 2
ARR = [1,...read more
Ans.

Swap Kth elements in an array with given constraints.

  • Create a temporary variable to store the Kth element from the start

  • Swap the Kth element from the start with the Kth element from the end

  • Return the modified array

Add your answer

Q6. Find Duplicates in an Array Problem Statement

You are provided with an array/list ARR of size 'N', containing integers ranging from 0 to N - 1. Some elements in this array might be repeating. Your task is to id...read more

Ans.

Identify duplicate elements in an array of integers ranging from 0 to N-1.

  • Iterate through the array and keep track of seen elements using a hash set.

  • If an element is already in the set, it is a duplicate and can be added to the result.

  • Return the list of duplicate elements found in the array.

Add your answer
Are these interview questions helpful?

Q7. Why java is known as platform independent language?

Ans.

Java is platform independent because it uses the concept of bytecode and virtual machine.

  • Java code is compiled into bytecode, which is a platform-independent representation of the code.

  • The bytecode is then executed by the Java Virtual Machine (JVM), which is specific to each platform.

  • This allows Java programs to run on any platform that has a compatible JVM.

  • The JVM acts as an interpreter, translating the bytecode into machine code that can be executed by the underlying hardwa...read more

View 1 answer

Q8. What are fundamental pillars of OOPS programming. Explain each of them in detail.

Ans.

The fundamental pillars of OOPS programming are encapsulation, inheritance, and polymorphism.

  • Encapsulation: It is the process of hiding the internal details of an object and providing a public interface for interacting with it.

  • Inheritance: It allows creating new classes by inheriting properties and behaviors from existing classes, promoting code reuse.

  • Polymorphism: It enables objects of different classes to be treated as objects of a common superclass, providing flexibility a...read more

View 1 answer
Share interview questions and help millions of jobseekers 🌟

Q9. Given a list of custom class objects. Write a program to sort that list based on one of its properties.

Ans.

Sort a list of custom class objects based on one of its properties.

  • Use a sorting algorithm like bubble sort, insertion sort, or merge sort.

  • Implement a comparison function to compare the desired property of the objects.

  • Apply the sorting algorithm to the list of objects using the comparison function.

View 1 answer

Q10. Write a SQL query to print number of rows in a table.

Ans.

A SQL query to count the number of rows in a table.

  • Use the COUNT() function in SQL to count the number of rows in a table.

  • Specify the table name in the FROM clause.

  • Use the result of the COUNT() function to print the number of rows.

View 1 answer

Q11. What is exception handling. How to implement it?

Ans.

Exception handling is a mechanism to handle runtime errors and prevent program crashes.

  • Exception handling is used to catch and handle errors that occur during program execution.

  • It involves the use of try-catch blocks to catch exceptions and handle them gracefully.

  • The try block contains the code that might throw an exception, and the catch block handles the exception.

  • Multiple catch blocks can be used to handle different types of exceptions.

  • Finally block can be used to execute ...read more

View 1 answer
Q12. What is compile-time polymorphism, and how does it differ from runtime polymorphism?
Ans.

Compile-time polymorphism is achieved through function overloading and operator overloading, while runtime polymorphism is achieved through virtual functions and inheritance.

  • Compile-time polymorphism is resolved during compile-time based on the number and types of arguments passed to a function.

  • Examples of compile-time polymorphism include function overloading, where multiple functions with the same name but different parameters can be defined.

  • Runtime polymorphism is resolved...read more

Add your answer
Q13. What are the various types of inheritance in Object-Oriented Programming?
Ans.

The various types of inheritance in Object-Oriented Programming include single inheritance, multiple inheritance, multilevel inheritance, hierarchical inheritance, and hybrid inheritance.

  • Single inheritance: A class inherits from only one base class.

  • Multiple inheritance: A class inherits from more than one base class.

  • Multilevel inheritance: A class inherits from a class, which in turn inherits from another class.

  • Hierarchical inheritance: Multiple classes inherit from a single ...read more

Add your answer
Q14. What are the ACID properties in DBMS?
Ans.

ACID properties in DBMS ensure data integrity and consistency.

  • Atomicity: All transactions are either completed in full or not at all.

  • Consistency: Data must be in a valid state before and after a transaction.

  • Isolation: Transactions should be isolated from each other until they are completed.

  • Durability: Once a transaction is committed, changes are permanent and cannot be lost.

  • Example: If a bank transfer fails midway, the entire transaction is rolled back to maintain atomicity.

Add your answer

Q15. Difference between i++ and ++i through implementation.

Ans.

i++ and ++i are both increment operators in C++ but have different behaviors.

  • i++ is a post-increment operator which increments the value of i after using it in an expression.

  • ++i is a pre-increment operator which increments the value of i before using it in an expression.

  • Example: int i = 5; int a = i++; // a = 5, i = 6; int b = ++i; // b = 7, i = 7;

Add your answer

Q16. Application of stack in real life.

Ans.

Stacks are used in real life for managing undo operations in text editors, backtracking in maze solving, and managing function calls in programming.

  • Undo operations in text editors - allows users to go back to previous states of a document

  • Backtracking in maze solving - helps in keeping track of visited paths and backtracking when necessary

  • Managing function calls in programming - helps in keeping track of function calls and returning to previous functions

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at India Power Corporation

based on 1 interviews
Interview experience
5.0
Excellent
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Associate Software Engineer Interview Questions from Similar Companies

4.0
 • 61 Interview Questions
3.7
 • 60 Interview Questions
3.7
 • 27 Interview Questions
3.7
 • 13 Interview Questions
4.0
 • 10 Interview Questions
View all
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
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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