Premium Employer

Info Edge

4.0
based on 1.9k Reviews
Filter interviews by

10+ Karle Infra Interview Questions and Answers

Updated 2 Jul 2024
Popular Designations
Q1. Buy and Sell Stock

You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘N’ days. You can either buy or sell a stock. Also, you can only complete at most 2-transactions. Find ...read more

View 6 more answers
Q2. Number of Flips

Ninja is learning the binary representation of the numbers. He wanted to practice the topic, so he picked a question. The problem statement says, two numbers, ‘A’ and ‘B’ are given. Find the numb...read more

View 3 more answers
Q3. Boundary Traversal

You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in Anti-Clockwise direction starting from the root node.

NOTE:
The boundary nodes of...read more
View 2 more answers
Q4. Reverse List In K Groups

You are given a linked list of 'N' nodes and an integer 'K'. You have to reverse the given linked list in groups of size K i.e if the list contains x nodes numbered from 1 to x, then you...read more

View 3 more answers
Discover Karle Infra interview dos and don'ts from real experiences

Q5. 2. From an array of integers which contains values for a particular stock . Find the value at which a person should buy and sell such that the profit is maximum.

Ans.

Find the maximum profit from buying and selling a stock given an array of its values.

  • Iterate through the array and keep track of the minimum value seen so far.

  • Calculate the profit at each index and update the maximum profit seen.

  • Return the maximum profit.

Add your answer

Q6. 1. Count the number of flips require to convert a binary string of 0 and 1 such that resultant string has alternate 0 and 1

Ans.

Count the number of flips required to convert a binary string to alternate 0 and 1.

  • Iterate through the string and count the number of flips required to make it alternate.

  • Keep track of the current character and the expected character.

  • Example: 001101 -> 010101 requires 2 flips.

  • Example: 101010 -> 010101 requires 3 flips.

Add your answer

Q7. 4. Reverse a linked list in groups of k nodes.

Ans.

Reverse a linked list in groups of k nodes.

  • Divide the linked list into groups of k nodes

  • Reverse each group of k nodes

  • Connect the reversed groups to form the final linked list

  • Use recursion or iteration to implement the solution

Add your answer

Q8. 3. Boundary traversal of a tree.

Ans.

Boundary traversal of a tree

  • Boundary traversal involves visiting the nodes on the boundary of a tree in a specific order

  • Start with the root node and traverse the left boundary, then the leaf nodes from left to right, and finally the right boundary

  • Use recursion to traverse the left and right subtrees

  • Exclude the leaf nodes that are also part of the left or right boundary

Add your answer

Q9. coding assignment for binary search

Ans.

Implement binary search algorithm to find a target string in a sorted array of strings.

  • Ensure the array of strings is sorted before performing binary search.

  • Compare the target string with the middle element of the array and adjust the search range accordingly.

  • Repeat the process until the target string is found or the search range is exhausted.

Add your answer

Q10. Build an MVC architecture

Ans.

MVC architecture separates an application into Model, View, and Controller components for better organization and scalability.

  • Model represents the data and business logic

  • View displays the data to the user

  • Controller handles user input and updates the model

  • Example: Model - User class with properties like name, email; View - HTML template to display user info; Controller - User controller to handle user actions

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 Senior Software Engineer Interview Questions from Similar Companies

3.7
 • 84 Interview Questions
3.8
 • 52 Interview Questions
3.9
 • 15 Interview Questions
4.0
 • 13 Interview Questions
4.9
 • 10 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