Informatica placement questions from Informatica placement papers will be discussed here. These will be very useful for students preparing for Informatica recruitment process.

Informatica Placement Questions with Answers

Informatica online test pattern consists of two rounds – Programming MCQs round & Coding round. Informatica placement questions for both these round are discussed below. Before you get starting with solving them, check out Informatica recruitment process.

Informatica Programming Questions

This is the first round of the Informatica recruitment process. This round consists of 30 programming MCQs which need to be solved in 45 minutes of time. Also, there is no negative marking involved. Informatica programming round syllabus is as given below.

Topic Expected number of questions
Operating System 5-8
Database Management (DBMS) 4-5
Data Structures 5-8
Algorithms 5-8

You can practice programming MCQs related to these topics here:

  • Operating System
  • Database Management
  • Data Structures
  • Algorithms

Informatica Coding Questions

Informatica coding round is the second round of Informatica recruitment process.Only students who clear the first round will be eligible for this round. This round consists of 4 coding questions which need to be solved in a duration of 90 mins.

Below are some of the sample Informatica coding questions taken from previous year Informatica placement papers.

1)Given an input island matrix, where 0 represents water and 1 represents land. Find the total number of islands that are formed by connected 1s.

2)Find the median of two sorted arrays of the same size.

3)Given an array and a value, find if there is a subset of the given set with the sum equal to the given sum.

4)Finding the non-repeating element in a given array

5)Given weights and values of n items, the task is to put these items in a knapsack of capacity W to get the maximum total value in the knapsack.In this problem, 0-1 means that we can either put the complete item in the knapsack or ignore it.

6)Find the height of a binary tree.

7)Given an input array arr = {5, 15, -30, 10, -5, 40, 10}.

The contiguous sub-array with maximum sum consists of elements 10, -5, 40, 10. Print their sum.

Output: 55

Java solution:

import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        {
            arr[i] = sc.nextInt();
        }
        System.out.println(maxSubsequenceSum(arr));        
    }
    public static int maxSubsequenceSum(int[] X) {
        int max = X[0];
        int sum = X[0];
        for (int i = 1; i < X.length; i++) {
            sum = Math.max(X[i], sum + X[i]);
            max = Math.max(max, sum);
        }
        return max;
    }
}

8)Check if a number can be written as a sum of k prime numbers.

Here, the given number is 10 and the value of k is 2. We need to check whether 10 can be represented using the sum of 2 prime numbers or not.

Yes, 10 can be represented as 5 + 5, where 5 is a prime number.Hence, the output is Yes.If not, then the output is No.

Java solution:

import java.util.*;
public class Prime{
    public static boolean isprime(int x)
    {
        for (int i = 2; i * i <= x; i++)
            if (x % i == 0)
             
                return false;
        return true;
    }
    public static boolean isSum(int N, int K)
    {
        if (N < 2 * K)
            return false;
        if (K == 1)
            return isprime(N);
             
        if (K == 2)
        {
            if (N % 2 == 0)
                return true;
            return isprime(N - 2);
        }
        return true;
    }
     public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        if (isSum(n, k))
            System.out.print("Yes");
        else
            System.out.print("No");
    }
}

9) Lexicographic rank of a string

Given a string, find its rank among all its permutations sorted lexicographically. For example, consider a string abc. Permutations of the given string after lexicographical order is:

  • abc
  • acb
  • bac
  • bca
  • cab
  • cba

From the above combinations, the rank of abc is 1, the rank of acb is 2, and rank of cba is 6.Another example, consider a string she. The rank of this string is 6.

One simple solution is to initialize rank as 1, generate all permutations in lexicographic order. After generating a permutation, check if the generated permutation is the same as a given string, if same, then return rank, if not, then increment the rank by 1.

In the input string, S is the first character. There are a total of 3 characters and 2 of them are smaller than S. So there can be 2 * 2! smaller strings where first character is smaller than S, like following

  • h x x
  • h x x
  • e x x
  • e x x

Repeat the same process for h, rank is 2 * 2! + 1 * 1! +..

Repeat the same process for e, rank is 2 * 2! + 1 * 1! + 0 * 0!

Rank = 2 * 2! + 1 * 1! + 0 * 0! = 5

Note that the above computations find count of smaller strings. Therefore rank of given string is count of smaller strings plus 1. The final rank = 1 + 5 = 6

C solution:

#include <stdio.h>#include <string.h>
int fact(int n)
{
    return (n <= 1) ? 1 : n * fact(n - 1);
}
int findSmaller(char* str, int low, int high)
{
    int countRight = 0, i;
 
    for (i = low + 1; i <= high; ++i)
        if (str[i] < str[low])
            ++countRight;
 
    return countRight;
}
int findRank(char* str)
{
    int len = strlen(str);
    int mul = fact(len);
    int rank = 1;
    int countRight;
 
    int i;
    for (i = 0; i < len; ++i) {
        mul /= len - i;
        countRight = findSmaller(str, i, len - 1);
        rank += countRight * mul;
    }
    return rank;
}
int main()
{
    char str[50];
    scanf("%s", str);
    printf("%d", findRank(str));
    return 0;
}

10)Find ceil value in a BST.

Ceil: Rounds x upward, returning the smallest integral value that is not less than x.

There are numerous applications where we need to find the floor (ceil) value of a key in a binary search tree. For example, consider designing a memory management system in which free nodes are arranged in BST.

Ceil Value Node: Node with smallest data larger than or equal to the key value.

Imagine we are moving down the tree, and assume we are at the root node. The comparison yields three possibilities,

  1. A)Root data is equal to key. We are done, root data is ceil value.
  2. B)Root data < key value, certainly the ceil value cant be in the left subtree. Proceed to search on right subtree as a reduced problem instance.
  3. C)Root data > key value, the ceil value may be in the left subtree. We may find a node with is larger data than the key value in the left subtree, if not the root itself will be ceil node.

Here is the code for cell value.

C solution:

#include <stdio.h>#include <stdlib.h>
struct node {
    int key;
    struct node* left;
    struct node* right;
};
struct node* newNode(int key)
{
    struct node* node = (struct node*)malloc(sizeof(struct node));
    node->key = key;
    node->left = NULL;
    node->right = NULL;
    return (node);
}
int Ceil(struct node* root, int input)
{
    if (root == NULL)
        return -1;
    if (root->key == input)
        return root->key;
    if (root->key < input)
        return Ceil(root->right, input);
    int ceil = Ceil(root->left, input);
    return (ceil >= input) ? ceil : root->key;
}
int main()
{
    struct node* root = newNode(8);
 
    root->left = newNode(4);
    root->right = newNode(12);
 
    root->left->left = newNode(2);
    root->left->right = newNode(6);
 
    root->right->left = newNode(10);
    root->right->right = newNode(14);
 
    for (int i = 0; i < 16; i++)
        printf("%d %d\n", i, Ceil(root, i));
 
    return 0;
}

Practice more coding questions

Get Access To Our Premium Courses
Install our application from PlayStore and get discounts on our new courses.

Pin It on Pinterest