Add office photos
Employer?
Claim Account for FREE

Rovi

3.0
based on 2 Reviews
Filter interviews by

SJ Jaiswal and Associates Interview Questions and Answers

Updated 5 Feb 2024

Q1. Given a big string and words from dictionary as query, find number of times each word occur in big string in efficient way

Ans.

The task is to count the occurrences of words from a dictionary in a big string efficiently.

  • Create a hash map to store the count of each word from the dictionary.

  • Split the big string into words and iterate through each word.

  • Check if the word exists in the dictionary and update its count in the hash map.

  • Return the hash map with word counts.

Add your answer

Q2. Given a directed dependency graph find sequence to install packages if each node has a structure of package name and dependency list

Ans.

Given a directed dependency graph, find sequence to install packages if each node has a structure of package name and dependency list.

  • Use topological sorting algorithm to find the installation sequence

  • Start with nodes that have no dependencies and gradually remove dependencies as packages are installed

  • If there is a cycle in the graph, it is not possible to find a valid installation sequence

Add your answer

Q3. Find peak in increasing and decreasing sequence

Ans.

Find peak in increasing and decreasing sequence

  • Use binary search to find the peak element

  • Compare the middle element with its neighbors to determine if it's a peak

  • If the middle element is smaller than its left neighbor, search in the left half of the array

  • If the middle element is smaller than its right neighbor, search in the right half of the array

Add your answer

Q4. Concatenation of two strings in c

Ans.

Concatenation of two strings in C

  • Use the strcat() function to concatenate two strings in C

  • Make sure the destination string has enough space to hold the concatenated result

  • The destination string should be null-terminated before concatenation

Add your answer
Discover SJ Jaiswal and Associates interview dos and don'ts from real experiences

Q5. Inorder traversal of a binary tree

Ans.

Inorder traversal is a depth-first traversal algorithm that visits the left subtree, then the root, and finally the right subtree.

  • Start at the root node

  • Traverse the left subtree recursively

  • Visit the root node

  • Traverse the right subtree recursively

Add your answer

Q6. Is BST or not?

Ans.

BST stands for Binary Search Tree.

  • BST is a type of binary tree where each node has at most two children.

  • In a BST, the left child of a node is always smaller than the node, and the right child is always greater.

  • BSTs are commonly used for efficient searching, insertion, and deletion operations.

  • Example: [5, 3, 7, 2, 4, 6, 8] is a BST.

Add your answer

Q7. Construct BST using preorder traversal

Ans.

Construct a Binary Search Tree (BST) using preorder traversal.

  • Preorder traversal visits the root node first, then the left subtree, and finally the right subtree.

  • To construct a BST from preorder traversal, we can use a recursive approach.

  • The first element in the preorder traversal is the root of the BST.

  • All elements smaller than the root will be in the left subtree, and all elements greater than the root will be in the right subtree.

  • Recursively apply the above steps to constr...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Associate Software Engineer Interview Questions from Similar Companies

4.0
 • 67 Interview Questions
4.0
 • 18 Interview Questions
4.0
 • 15 Interview Questions
4.3
 • 14 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
Get AmbitionBox app

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