
Cult.fit


10+ Cult.fit Interview Questions and Answers for Freshers
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
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
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
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.
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
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.
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
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.
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
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.
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
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.
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
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.
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
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
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
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
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
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
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
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.
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
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.
Q13. How fitness brands are competing with the competitions?
Fitness brands are competing by offering unique experiences, personalized training, and innovative technology.
Brands are creating unique experiences to differentiate themselves from competitors.
Personalized training programs are becoming more popular to cater to individual needs.
Innovative technology such as wearables and fitness apps are being integrated into workouts.
Brands are also focusing on community building and social media engagement to attract and retain customers.
E...read more
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
Q15. What do you understand by people management.
People management involves leading, motivating, and developing a team of individuals to achieve organizational goals.
Effective communication and delegation
Providing feedback and recognition
Creating a positive work environment
Identifying and addressing performance issues
Developing and implementing training programs
Encouraging teamwork and collaboration
Managing conflicts and resolving disputes
Setting goals and expectations
Empowering employees to take ownership of their work
Ensu...read more
Q16. way of approach used
I approach each project by conducting thorough research, understanding the target audience, and crafting compelling and creative copy.
Research the brand, product, or service to understand its unique selling points
Identify the target audience and tailor the messaging to resonate with them
Craft compelling and creative copy that communicates the key message effectively
Ensure consistency in tone and voice throughout the copy
Iterate and refine the copy based on feedback and data a...read more
More about working at Cult.fit




Top HR Questions asked in Cult.fit for Freshers
Interview Process at Cult.fit for Freshers

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

