Amadeus
Transhill Management Services Interview Questions and Answers
Q1. Search in a Row-wise and Column-wise Sorted Matrix Problem Statement
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the position of ...read more
Given a sorted N * N matrix, find the position of a target integer X.
Iterate over each row and column to search for the target integer
Utilize the sorted nature of the matrix to optimize the search process
Return the position of the target integer if found, else return -1 -1
Q2. Sort Array of Strings Problem Statement
Given an array of strings ARRSTR[]
of size N
, and a character C
, your task is to sort the ARRSTR[]
array according to a new alphabetical order that starts with the given ...read more
Sort an array of strings based on a new alphabetical order starting with a given character.
Iterate through the array of strings and compare each string with the given character to determine the new order.
Implement a custom comparator function to sort the strings based on the new alphabetical order.
Use built-in sorting functions in programming languages like Python, Java, or C++ to efficiently sort the array.
Q3. Euler’s Totient Function Problem Statement
Given an integer N
, your task is to determine the count of integers between 1 and N
(inclusive) that are coprime to N
.
Input:
The first line contains an integer 'T' de...read more
Euler's Totient Function calculates count of integers coprime to N between 1 and N.
Implement Euler's Totient Function to calculate count of coprime integers to N.
Use the formula: phi(N) = N * (1 - 1/p1) * (1 - 1/p2) * ... * (1 - 1/pk) where p1, p2, ..., pk are prime factors of N.
Example: For N = 9, phi(9) = 9 * (1 - 1/3) = 6.
The pillars of OOP are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class.
Encapsulation restricts access to certain components of an object, protecting its integrity.
Abstraction hides complex implementation details and only shows the necessary features.
Polymorphism allows objects to be treated as instances of their parent class, enabling flexibility.
Q5. write code to print fibanocci series
Print the Fibonacci series using code.
Use a loop to generate the Fibonacci series
Start with the first two numbers (0 and 1) and then add the previous two numbers to get the next number
Continue this process until reaching the desired length of the series
Q6. write code for Anagram program
An Anagram program compares two strings to see if they are rearrangements of each other.
Create a function that takes in two strings as input
Remove any spaces and convert both strings to lowercase for accurate comparison
Sort the characters in both strings and compare them to check if they are anagrams
Return true if they are anagrams, false otherwise
Q7. What is lazy loading
Lazy loading is a design pattern where resources are loaded only when needed.
Lazy loading helps improve performance by loading resources on demand.
Commonly used in web development for images, videos, and other media content.
Example: Loading images on a webpage only when they come into view.
Interview Process at Transhill Management Services
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month