Add office photos
Employer?
Claim Account for FREE

MAQ Software

1.9
based on 353 Reviews
Filter interviews by

20+ Jaytech Interview Questions and Answers

Updated 25 Dec 2024
Popular Designations

Q1. Find the Duplicate Number Problem Statement

Given an integer array 'ARR' of size 'N' containing numbers from 0 to (N - 2). Each number appears at least once, and there is one number that appears twice. Your tas...read more

Ans.

Find the duplicate number in an array of integers from 0 to N-2.

  • Iterate through the array and keep track of the frequency of each number using a hashmap.

  • Return the number with a frequency greater than 1 as the duplicate number.

Add your answer

Q2. Character Frequency Problem Statement

You are given a string 'S' of length 'N'. Your task is to find the frequency of each character from 'a' to 'z' in the string.

Example:

Input:
S : abcdg
Output:
1 1 1 1 0 0 ...read more
Ans.

The task is to find the frequency of each character from 'a' to 'z' in a given string.

  • Create an array of size 26 to store the frequency of each character from 'a' to 'z'.

  • Iterate through the string and increment the count of the corresponding character in the array.

  • Print the array of frequencies as the output for each test case.

Add your answer

Q3. Sort 0 1 2 Problem Statement

Given an integer array arr of size 'N' containing only 0s, 1s, and 2s, write an algorithm to sort the array.

Input:

The first line contains an integer 'T' representing the number of...read more
Ans.

Sort an array of 0s, 1s, and 2s in linear time complexity.

  • Use three pointers to keep track of 0s, 1s, and 2s while traversing the array.

  • Swap elements based on the values encountered to sort the array in-place.

  • Time complexity should be O(N) and space complexity should be O(1).

Add your answer

Q4. N Queens Problem

Given an integer N, find all possible placements of N queens on an N x N chessboard such that no two queens threaten each other.

Explanation:

A queen can attack another queen if they are in the...read more

Ans.

The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard without threatening each other.

  • Use backtracking algorithm to explore all possible configurations.

  • Keep track of rows, columns, and diagonals to ensure queens do not threaten each other.

  • Generate all valid configurations and print them out.

Add your answer
Discover Jaytech interview dos and don'ts from real experiences

Q5. Reverse Words in a String: Problem Statement

You are given a string of length N. Your task is to reverse the string word by word. The input may contain multiple spaces between words and may have leading or trai...read more

Ans.

Reverse words in a string while handling leading, trailing, and multiple spaces.

  • Split the input string by spaces to get individual words

  • Reverse the order of the words

  • Join the reversed words with a single space in between

Add your answer

Q6. Reverse Array Elements

Given an array containing 'N' elements, the task is to reverse the order of all array elements and display the reversed array.

Explanation:

The elements of the given array need to be rear...read more

Ans.

Reverse the order of elements in an array and display the reversed array.

  • Iterate through the array from both ends and swap the elements until the middle is reached.

  • Use a temporary variable to store the element being swapped.

  • Print the reversed array after all elements have been swapped.

Add your answer
Are these interview questions helpful?

Q7. Buy and Sell Stock Problem Statement

Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more

Ans.

The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.

  • Iterate through the array of stock prices and calculate the maximum profit that can be achieved by buying and selling at different points.

  • Keep track of the maximum profit after the first transaction and the maximum profit overall by considering different combinations of buy and sell points.

  • Return the maximum profit obtained after co...read more

Add your answer

Q8. Pair Sum Problem Statement

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.

Note:

Each pa...read more

Ans.

Find pairs of elements in an array that sum up to a given value, sorted in a specific order.

  • Iterate through the array and for each element, check if the complement (S - current element) exists in a hash set.

  • Keep track of pairs in a hash set to avoid duplicates.

  • Sort the pairs based on the criteria mentioned in the question.

  • Return the sorted list of pairs.

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

Q9. Circular Linked List Detection

You are provided with the head of a linked list containing integers. Your task is to determine if the linked list is circular.

Note:
  • A linked list is considered circular if it co...read more
Ans.

Detect if a given linked list is circular by checking if it forms a closed loop.

  • Traverse the linked list using two pointers, one moving at double the speed of the other.

  • If the two pointers meet at any point, the linked list is circular.

  • If the faster pointer reaches the end of the list (NULL), the linked list is not circular.

Add your answer

Q10. Sum of Digits Problem Statement

Given an integer 'N', continue summing its digits until the result is a single-digit number. Your task is to determine the final value of 'N' after applying this operation iterat...read more

Ans.

Given an integer, find the final single-digit value after summing its digits iteratively.

  • Iteratively sum the digits of the given integer until the result is a single-digit number

  • Output the final single-digit integer for each test case

  • Handle multiple test cases efficiently

Add your answer

Q11. Pancake Sorting Problem Statement

You are given an array of integers 'ARR'. Sort this array using a series of pancake flips. In each pancake flip, you need to:

Choose an integer 'K' where 1 <= 'K' <= ARR.LENGTH...read more
Ans.

Sort an array using pancake flips and return the sequence of flips made.

  • Iterate through the array and find the position of the maximum element in each iteration.

  • Perform pancake flips to move the maximum element to the correct position.

  • Continue this process until the array is sorted.

  • Return the sequence of positions from where flips were made.

Add your answer

Q12. Fibonacci Number Verification

Identify if the provided integer 'N' is a Fibonacci number.

A number is termed as a Fibonacci number if it appears in the Fibonacci sequence, where each number is the sum of the tw...read more

Ans.

Check if a given number is a Fibonacci number or not.

  • Iterate through the Fibonacci sequence until you find a number greater than or equal to the given number.

  • Check if the given number matches the Fibonacci number found in the sequence.

  • If the number matches, output 'YES'; otherwise, output 'NO'.

Add your answer

Q13. Reverse Only Letters Problem Statement

You are given a string S. The task is to reverse the letters of the string while keeping non-alphabet characters in their original position.

Example:

Input:
S = "a-bcd"
Ou...read more
Ans.

Reverse the letters of a string while keeping non-alphabet characters in their original position.

  • Iterate through the string and store the non-alphabet characters in their original positions

  • Reverse the letters using two pointers technique

  • Combine the reversed letters with the non-alphabet characters to get the final reversed string

Add your answer

Q14. Nth Fibonacci Number Problem Statement

Calculate the Nth term in the Fibonacci sequence, where the sequence is defined as follows: F(n) = F(n-1) + F(n-2), with initial conditions F(1) = F(2) = 1.

Input:

The inp...read more
Ans.

Calculate the Nth Fibonacci number efficiently using dynamic programming.

  • Use dynamic programming to store and reuse previously calculated Fibonacci numbers.

  • Start with base cases F(1) and F(2) as 1, then calculate subsequent Fibonacci numbers.

  • Optimize the solution to avoid redundant calculations by storing intermediate results.

  • Time complexity can be reduced to O(N) using dynamic programming.

  • Example: For N = 5, the 5th Fibonacci number is 5.

Add your answer

Q15. Find Duplicates in an Array

Given an array ARR of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.

Return the duplicate elements in any order. If n...read more

Ans.

Find duplicates in an array of integers within a specified range.

  • Iterate through the array and keep track of the count of each element using a hashmap.

  • Return elements with count greater than 1 as duplicates.

  • Time complexity can be optimized to O(N) using a set to store duplicates.

  • Example: For input [0, 3, 1, 2, 3], output should be [3].

Add your answer
Q16. What is normalization and can you explain the concept of Third Normal Form (3NF)?
Ans.

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.

  • Normalization is a technique used to organize data in a database efficiently.

  • Third Normal Form (3NF) is a level of normalization that ensures that data is stored in a way that prevents certain types of data anomalies.

  • In 3NF, every non-prime attribute is fully functionally dependent on the primary key.

  • For example, if we have a table 'Employees' with columns 'EmployeeID...read more

Add your answer
Q17. Write an SQL query to find the second highest salary from a table.
Ans.

SQL query to find the second highest salary from a table

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

  • Use the NOT IN operator to exclude the highest salary from the results

  • Order the results in descending order and limit the query to return only the second row

Add your answer

Q18. find the occurrence of each element in an array

Ans.

Count the occurrence of each element in an array of strings

  • Iterate through the array and use a hashmap to store the count of each element

  • If element already exists in the hashmap, increment its count by 1

  • Return the hashmap with element counts

Add your answer

Q19. sort a vector according to other other vector ?

Ans.

Sort a vector based on another vector

  • Use std::sort with a custom comparator function

  • The comparator function should compare the indices of the elements in the second vector

  • The first vector should be sorted based on the order of the indices in the second vector

Add your answer

Q20. Minimum swaps to group all ones together

Ans.

The minimum number of swaps needed to group all ones together in an array of 0s and 1s.

  • Iterate through the array to count the total number of ones.

  • Use a sliding window of size equal to the total number of ones to find the window with the minimum number of zeros.

  • Calculate the number of swaps needed to move all ones to that window.

Add your answer

Q21. Zigzag traversal of binary tree

Ans.

Zigzag traversal of binary tree involves alternating the direction of traversal at each level.

  • Use a queue to perform level order traversal of the binary tree.

  • For each level, alternate between adding nodes to the result list from left to right and right to left.

  • Continue this process until all levels have been traversed.

Add your answer

Q22. Sort 0,1,2 array

Ans.

Sort an array of strings containing '0', '1', and '2'.

  • Use counting sort algorithm to count the occurrences of '0', '1', and '2'.

  • Create a new array with the sorted counts of '0', '1', and '2'.

  • Join the sorted array back into a single array of strings.

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

Interview Process at Jaytech

based on 12 interviews
4 Interview rounds
Coding Test Round - 1
Coding Test Round - 2
Technical Round
HR Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

4.0
 • 81 Interview Questions
3.8
 • 16 Interview Questions
3.9
 • 14 Interview Questions
3.6
 • 12 Interview Questions
3.6
 • 12 Interview Questions
3.0
 • 11 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
70 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