ZeMoSo Technologies
10+ J N Tata Technical Education Center Interview Questions and Answers
Ninja is given a few numbers, and he is being asked to rearrange the numbers so that every second element is greater than its left and right element.
Suppose the given array is [1, ...read more
The task is to rearrange the given array such that every second element is greater than its left and right element.
Read the number of test cases
For each test case, read the number of elements in the array and the array elements
Iterate through the array and swap elements at odd indices with their adjacent elements if necessary
Check if the rearranged array satisfies the conditions and print 1 if it does, else print 0
You are given two strings 'A' and 'B' where string 'A' is fixed. But you can perform left shift operations on string B any number of times.
Your task is to find out the minim...read more
The question asks to find the minimum number of left shift operations required to obtain the longest common prefix of two given strings.
Perform left shift operations on string B to find the longest common prefix with string A
Count the number of left shift operations required to obtain the longest common prefix
Return the minimum number of left shift operations for each test case
You are given an integer array ‘ARR’. You have to find the length of the shortest contiguous subarray such that, if you sort this subarray in ascending order, then the whole array will be sorted in asce...read more
The question asks to find the length of the shortest contiguous subarray that needs to be sorted in order to sort the whole array.
Iterate through the array and find the first element that is out of order from the left side.
Iterate through the array and find the first element that is out of order from the right side.
Find the minimum and maximum element within the subarray from the above steps.
Expand the subarray from both sides until all elements within the subarray are in the...read more
1. What is Normalization and why do we use it?
2. Write an SQL query to find the position of the alphabet (‘o’) in the first name column ‘Zemoso’ from Company table.
3. Write an SQL query to fetch du...read more
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 data consistency and eliminates anomalies like update, insert, and delete anomalies.
Normalization improves database performance and simplifies data maintenance.
There are different normal forms (1NF, 2NF, 3NF, etc.) that define specific rule...read more
You have ten stacks of ten coins each and each of them weighs 10 gm. However, one of the stacks is faulty and each of the coins in it weighs only 9 gms. What is the least number of times you ha...read more
The least number of times you have to weigh to find the faulty coin is 2.
First, divide the ten stacks into two groups of five stacks each.
Weigh one group against the other group.
If the weights are equal, the faulty stack is in the remaining five stacks.
If the weights are unequal, the faulty stack is in the lighter group.
Now, divide the lighter group into two groups of two stacks each.
Weigh one group against the other group.
If the weights are equal, the faulty stack is in the ...read more
1. What is the main purpose of an operating system?
2. What is the difference between process and program?
3. What is the use of paging in operating system?
4. What is the concept of demand paging?
Operating system is responsible for managing computer hardware and software resources.
The main purpose of an operating system is to provide an interface between the user and the computer hardware.
A process is an instance of a program in execution, while a program is a set of instructions stored on disk.
Paging is a memory management technique used by operating systems to efficiently manage memory.
Demand paging is a technique where pages are loaded into memory only when they ar...read more
Q7. Given a Map of fruits with there price as a key value pair respectively, find the fruit whose price is maximum using Java 8 Stream API.
Using Java 8 Stream API to find the fruit with maximum price in a Map of fruits.
Use entrySet() method to get a stream of key-value pairs from the Map.
Use max() method with Comparator.comparing() to find the entry with maximum price.
Extract the key (fruit) from the entry with maximum price.
Q8. Write a program to check whether the parenthesis are properly balanced or not, means for every opening brace these should be a closing brace present.
Program to check if parenthesis are properly balanced
Use a stack data structure to keep track of opening parenthesis
Iterate through the input string and push opening parenthesis onto the stack
When a closing parenthesis is encountered, pop from the stack and check if it matches the corresponding opening parenthesis
If stack is empty at the end and all parenthesis are matched, then the input has properly balanced parenthesis
Q9. Given a list of integer find the first non repeating integer using stream API of Java 8.
Find the first non-repeating integer in a list using Java 8 stream API.
Use Java 8 stream API to group integers by count
Filter out integers with count greater than 1
Return the first non-repeating integer
Q10. Implent Oops concept of Java through code
Java OOPs concepts can be implemented using classes, objects, inheritance, polymorphism, and encapsulation.
Create classes with attributes and methods
Instantiate objects from classes
Use inheritance to create subclasses
Implement polymorphism through method overriding
Encapsulate data using access modifiers
Q11. A variant of bubble sort
Cocktail sort is a variant of bubble sort that sorts in both directions.
Also known as bidirectional bubble sort or shaker sort.
It starts with the first element and compares it with the next one, swapping if necessary.
Then it moves to the last element and compares it with the previous one, swapping if necessary.
It continues until no more swaps are needed.
It is more efficient than bubble sort for large lists with many out-of-order elements.
Top Associate Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month