Add office photos
Cult.fit logo
Engaged Employer

Cult.fit

Verified
3.7
based on 810 Reviews
Video summary
Filter interviews by
Clear (1)

10+ Cult.fit Software Developer Intern Interview Questions and Answers

Updated 5 Feb 2024

Q1. Maximum Subarray Sum Problem Statement

Given an array of numbers, the task is to find the maximum sum of any contiguous subarray of the array.

Input:

The first line of input contains the size of the array, deno...read more
Ans.

Find the maximum sum of any contiguous subarray in an array of numbers in O(N) time.

  • Use Kadane's algorithm to find the maximum subarray sum in O(N) time.

  • Initialize two variables: max_sum and current_sum to keep track of the maximum sum found so far and the current sum of the subarray being considered.

  • Iterate through the array and update current_sum by adding the current element or starting a new subarray if the current element is greater than the sum so far.

  • Update max_sum if ...read more

Add your answer
right arrow

Q2. Balanced Sequence After Replacement

Given a string of length 'N' containing only the characters: '[', '{', '(', ')', '}', ']'. At certain places, the character 'X' appears in place of any bracket. Your goal is ...read more

Ans.

Determine if a valid balanced sequence can be achieved by replacing 'X's with suitable brackets.

  • Iterate through the string and keep track of the count of opening and closing brackets.

  • If at any point the count of closing brackets exceeds the count of opening brackets, return False.

  • If all 'X's can be replaced to form a valid balanced sequence, return True.

Add your answer
right arrow
Cult.fit Software Developer Intern Interview Questions and Answers for Freshers
illustration image

Q3. Merge Intervals Problem Statement

You are provided with 'N' intervals, each containing two integers denoting the start time and end time of the interval.

Your task is to merge all overlapping intervals and retu...read more

Ans.

Merge overlapping intervals and return sorted list of merged intervals by start time.

  • Sort the intervals based on start time.

  • Iterate through intervals and merge overlapping intervals.

  • Return the list of merged intervals sorted by start time.

Add your answer
right arrow

Q4. Problem: Search In Rotated Sorted Array

Given a sorted array that has been rotated clockwise by an unknown amount, you need to answer Q queries. Each query is represented by an integer Q[i], and you must determ...read more

Ans.

Search for integers in a rotated sorted array efficiently using binary search.

  • Use binary search to efficiently find the index of each query integer in the rotated sorted array.

  • Handle the rotation of the array by finding the pivot point first.

  • Check which half of the array the query integer falls into based on the pivot point.

  • Return the index of the query integer if found, else return -1.

Add your answer
right arrow
Discover Cult.fit interview dos and don'ts from real experiences

Q5. Word Break Problem Statement

You are given a list of N strings called A. Your task is to determine whether you can form a given target string by combining one or more strings from A.

The strings from A can be u...read more

Ans.

Given a list of strings, determine if a target string can be formed by combining one or more strings from the list.

  • Iterate through all possible combinations of strings from the list to form the target string.

  • Use recursion to try different combinations of strings.

  • Check if the current combination forms the target string.

  • Return true if a valid combination is found, otherwise return false.

Add your answer
right arrow

Q6. Pair with Given Sum in a Balanced BST Problem Statement

You are given the ‘root’ of a Balanced Binary Search Tree and an integer ‘target’. Your task is to determine if there exists any pair of nodes such that t...read more

Ans.

Given a Balanced BST and a target integer, determine if there exists a pair of nodes with sum equal to the target.

  • Traverse the BST in-order to get a sorted array of values.

  • Use two pointers approach to find the pair with sum equal to target.

  • Consider edge cases like negative numbers and duplicates.

  • Time complexity can be optimized to O(n) using a HashSet to store visited nodes.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Largest Rectangle in Histogram Problem Statement

You are given an array/list HEIGHTS of length N, where each element represents the height of a histogram bar. The width of each bar is considered to be 1.

Your t...read more

Ans.

Compute the area of the largest rectangle that can be formed within the bounds of a given histogram.

  • Iterate through the histogram bars and maintain a stack to keep track of increasing heights.

  • Calculate the area of the rectangle by considering the current height and the width of the rectangle.

  • Update the maximum area found so far as you iterate through the histogram.

  • Handle edge cases like when the stack is empty or when the current height is less than the previous height.

Add your answer
right arrow

Q8. Job Scheduling Problem Statement

Given a list of ‘N’ jobs, each associated with a deadline and a profit obtainable if completed by the deadline, schedule the jobs to maximize the total profit. Each job takes on...read more

Ans.

The job scheduling problem involves maximizing profit by scheduling jobs with deadlines and profits optimally.

  • Sort the jobs in decreasing order of profit.

  • Iterate through the sorted jobs and schedule them based on their deadlines.

  • Keep track of the maximum profit achievable by scheduling jobs within their deadlines.

  • Example: For input Jobs: 'A'(profit=20, deadline=1), 'B'(profit=30, deadline=2), 'C'(profit=40, deadline=2), the maximum profit is 70 by scheduling 'C' at time 1 and...read more

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Break The Board Problem Statement

Your task is to break a board of given dimensions 'L' by 'W' into 'L' * 'W' smaller squares, ensuring the total cost of breaking is minimized.

Input:

The first line contains an...read more
Ans.

The task is to minimize the cost of breaking a board into smaller squares by making horizontal and vertical cuts.

  • Iterate through all possible horizontal and vertical cuts to find the minimum cost

  • Use dynamic programming to optimize the solution by storing intermediate results

  • Calculate the total cost by summing up the costs of all cuts

Add your answer
right arrow

Q10. Boundary Traversal of a Binary Tree

Given a binary tree of integers, your task is to return the boundary nodes of the tree in Anti-Clockwise direction starting from the root node.

Input:

The first line contains...read more
Ans.

Return the boundary nodes of a binary tree in Anti-Clockwise direction starting from the root node.

  • Traverse the left boundary nodes in top-down order

  • Traverse the leaf nodes in left-right order

  • Traverse the right boundary nodes in bottom-up order

  • Handle duplicates by including them only once

Add your answer
right arrow

Q11. Water Flow Problem Statement

Given a matrix A with dimensions 'N' x 'M', where each cell represents the height of water in that location, determine the coordinates from which water can flow to both the Pacific ...read more

Ans.

Given a matrix representing water heights, find coordinates where water can flow to both Pacific and Atlantic oceans.

  • Create a function that performs a depth-first search to find coordinates where water can flow to both oceans.

  • Keep track of visited cells and check if a cell can flow to both oceans by comparing its height with neighboring cells.

  • Return the coordinates in lexicographical order as the output.

Add your answer
right arrow

Q12. Josephus Problem Statement

Consider 'N' individuals standing in a circle, numbered consecutively from 1 to N, in a clockwise direction. Initially, the person at position 1 starts counting and will skip K-1 pers...read more

Ans.

The Josephus problem involves eliminating every Kth person in a circle until only one person remains. Determine the position of the last person standing.

  • Use a circular linked list to simulate the circle of people.

  • Iterate through the list, skipping K-1 nodes and removing the Kth node until only one node remains.

  • Return the position of the last remaining node.

  • Example: For N=5, K=2, the last person standing is at position 3.

Add your answer
right arrow
Q13. What are the different types of memory in operating systems?
Ans.

Different types of memory in operating systems include RAM, ROM, virtual memory, cache memory, and registers.

  • RAM (Random Access Memory) - volatile memory used for storing data that is actively being used by the CPU

  • ROM (Read-Only Memory) - non-volatile memory that stores firmware and boot-up instructions

  • Virtual Memory - a memory management technique that uses disk space as an extension of RAM

  • Cache Memory - high-speed memory used to store frequently accessed data for faster acc...read more

Add your answer
right arrow

More about working at Cult.fit

Back
Awards Leaf
AmbitionBox Logo
#19 Best Tech Startup - 2022
Awards Leaf
HQ - Bangalore,Karnataka, India
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Intern Interview Questions from Similar Companies

View all
Recently Viewed
INTERVIEWS
Bahwan Engineering
No Interviews
INTERVIEWS
Honda Motorcycle & Scooter
No Interviews
INTERVIEWS
Bahwan Engineering
No Interviews
INTERVIEWS
Freshworks
5.6k top interview questions
INTERVIEWS
Bahwan Engineering
10 top interview questions
INTERVIEWS
Bahwan Engineering
No Interviews
INTERVIEWS
Freshworks
No Interviews
INTERVIEWS
Bahwan Engineering
No Interviews
INTERVIEWS
Freshworks
No Interviews
INTERVIEWS
Freshworks
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
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