Add office photos
Employer?
Claim Account for FREE

Bharti Airtel

3.9
based on 14.2k Reviews
Video summary
Filter interviews by

Jagdamba Trailers Interview Questions and Answers

Updated 15 Jan 2025
Popular Designations

Q1. Longest Common Prefix After Rotation

You are given two strings 'A' and 'B'. While string 'A' is constant, you may apply any number of left shift operations to string 'B'.

Explanation:

Your task is to calculate ...read more

Ans.

Calculate the minimum number of left shift operations needed to achieve the longest common prefix between two strings.

  • Apply left shift operations to string B to find the longest common prefix with string A

  • Count the number of left shifts needed to achieve the longest common prefix

  • Return the minimum number of left shift operations for each test case

View 1 answer

Q2. Longest Subarray with Zero Sum

Ninja enjoys working with numbers, and as a birthday challenge, his friend provides him with an array consisting of both positive and negative integers. Ninja is curious to identi...read more

Ans.

Find the length of the longest subarray with zero sum in an array of integers.

  • Iterate through the array and keep track of the running sum using a hashmap.

  • If the running sum is seen before, the subarray between the current index and the previous index with the same sum is a subarray with zero sum.

  • Update the length of the longest subarray with zero sum as you iterate through the array.

  • Example: For arr1 = [1, -1, 3, 2, -2, -3, 3], the longest subarray with zero sum is [3, 2, -2,...read more

View 1 answer

Q3. 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.

Given a string, find the frequency of each character from 'a' to 'z' in the 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

Q4. Stack using Two Queues Problem Statement

Develop a Stack Data Structure to store integer values using two Queues internally.

Your stack implementation should provide these public functions:

Explanation:

1. Cons...read more
Ans.

Implement a stack using two queues to store integer values with specified functions.

  • Create a stack using two queues internally

  • Implement functions for push, pop, top, size, and isEmpty

  • Handle edge cases such as empty stack or invalid data

  • Ensure the stack functions work correctly and efficiently

  • Test the implementation with sample inputs and outputs

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

Q5. Longest Consecutive Sequence Problem Statement

You are provided with an unsorted array/list ARR of N integers. Your task is to determine the length of the longest consecutive sequence present in the array.

Expl...read more

Ans.

Find the length of the longest consecutive sequence in an unsorted array of integers.

  • Iterate through the array and store each element in a set for constant time lookup.

  • For each element, check if it is the start of a sequence by looking for its previous number in the set.

  • Update the length of the current consecutive sequence and track the longest sequence found so far.

  • Return the length of the longest consecutive sequence.

  • Example: Input [9,5,4,9,10,10,6], Output: 3 (Longest cons...read more

Add your answer

Q6. Trapping Rain Water Problem Statement

You are given a long type array/list ARR of size N, representing an elevation map. The value ARR[i] denotes the elevation of the ith bar. Your task is to determine the tota...read more

Ans.

Calculate the total amount of rainwater that can be trapped between given elevations in an elevation map.

  • Iterate through the array to find the maximum height on the left and right of each bar.

  • Calculate the amount of water that can be trapped above each bar by taking the minimum of the maximum heights on the left and right.

  • Sum up the trapped water above each bar to get the total trapped water for the elevation map.

Add your answer

Q7. Left View of a Binary Tree

Given a binary tree, your task is to print the left view of the tree. The left view of a binary tree contains the nodes visible when the tree is viewed from the left side.

Input:

The ...read more
Ans.

Print the left view of a binary tree, containing nodes visible from the left side.

  • Traverse the tree in a level order manner and print the first node at each level.

  • Use a queue to keep track of nodes at each level.

  • Handle null nodes represented by -1 in the input.

Add your answer
Q8. Write an SQL query to find the second highest salary.
Ans.

SQL query to find the second highest salary

  • Use the ORDER BY clause to sort the salaries in descending order

  • Use the LIMIT clause to limit the result to the second row

  • Use a subquery to exclude the highest salary from the result

Add your answer

Q9. How to optimise fetching 1 lakh entries from db

Ans.

Use pagination, indexing, caching, and query optimization to fetch 1 lakh entries efficiently from the database.

  • Implement pagination to fetch data in smaller chunks

  • Create indexes on columns frequently used in queries

  • Use caching to store frequently accessed data

  • Optimize queries by avoiding unnecessary joins and using appropriate indexes

  • Consider using database-specific optimizations like query hints or stored procedures

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

Interview Process at Jagdamba Trailers

based on 3 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.6
 • 124 Interview Questions
3.7
 • 73 Interview Questions
3.7
 • 29 Interview Questions
3.5
 • 15 Interview Questions
3.8
 • 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
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