Comcast
10+ Efacec Interview Questions and Answers
Q1. You are given an array of integers, arr, of size n, which is analogous to a continuous stream of integers input. Your task is to find K largest elements from a given stream of numbers.
Use a max heap to keep track of the K largest elements in a continuous stream of integers.
Create a max heap of size K to store the K largest elements.
For each new element in the stream, compare it with the root of the max heap. If it is larger, replace the root with the new element and heapify.
At any point, the root of the max heap will be the Kth largest element in the stream.
Q2. You are given alphanumeric strings s and t. Find the minimum window (substring) in s, which contains all the characters of t.
Use sliding window technique to find minimum window in s containing all characters of t.
Use two pointers to create a window in s
Move the right pointer to expand the window until all characters of t are found
Move the left pointer to shrink the window while maintaining all characters of t
Update minimum window size as you iterate through s
Q3. Given a variety of coin types defining a currency system, find the minimum number of coins required to express a given amount of money. Assume an infinite supply of coins of every type. (Solution)
The minimum number of coins required to express a given amount of money is calculated using a dynamic programming approach.
Use dynamic programming to calculate the minimum number of coins required for each amount from 1 to the given amount.
Start with the base case of 0 coins required for amount 0, then iterate through each coin type to calculate the minimum coins required for each amount.
Choose the minimum of the current minimum coins required and the minimum coins required f...read more
Q4. Given a binary tree “B” with unique values, write a program to find: 1. The longest consecutive sequence. 2. The length of the longest path comprising connected nodes with consecutive values.
Program to find longest consecutive sequence and length of longest path in a binary tree.
Traverse the binary tree using depth-first search (DFS)
Keep track of the current consecutive sequence length and the longest consecutive sequence found so far
Update the length of the longest path as you traverse the tree
Q5. Write a program to find the lowest common ancestor of two nodes of a given binary tree “B” with unique values.
Program to find lowest common ancestor of two nodes in a binary tree with unique values.
Start from the root and traverse the tree to find the paths from root to the two nodes.
Compare the paths to find the lowest common ancestor node.
Use recursion to traverse the tree efficiently.
Handle edge cases like if one of the nodes is the ancestor of the other.
Q6. Given a sequence, return its next lexicographically greater permutation. If such a permutation does not exist, then return it in ascending order.
Return the next lexicographically greater permutation of a given sequence or return it in ascending order if not possible.
Use the concept of lexicographic ordering to find the next permutation.
If the sequence is already in descending order, return it in ascending order.
Examples: ['a', 'b', 'c'] -> ['a', 'c', 'b'], ['3', '2', '1'] -> ['1', '2', '3']
Q7. Write a code to convert a given set of integers into their Roman number equivalents.
Convert a set of integers to Roman numerals
Create a function that takes an integer array as input
Use a loop to iterate through each integer and convert it to Roman numeral
Implement a mapping of integers to Roman numerals for conversion
Return an array of strings containing the Roman numeral equivalents
Q8. Find all palindromic decompositions of a given string s. (Solution)
Find all palindromic decompositions of a given string s.
Iterate through all possible substrings and check if they are palindromes.
Use backtracking to generate all possible decompositions.
Return the list of palindromic decompositions.
Q9. Design an autocomplete feature for a search engine.
Autocomplete feature for a search engine
1. Display suggestions as user types in the search bar
2. Suggestions should be based on popular searches or previous searches
3. Allow users to select a suggestion to complete their search
4. Update suggestions in real-time as the user continues typing
Q10. Design a customer relationship management platform for Comcast.
A customer relationship management platform for Comcast would focus on personalized customer interactions and efficient issue resolution.
Implement a centralized database to store customer information and interaction history.
Integrate communication channels such as phone, email, and chat for seamless customer support.
Utilize data analytics to track customer behavior and preferences for targeted marketing campaigns.
Automate processes for issue resolution and follow-up to improv...read more
Q11. Design a ticketing management system for a theatre.
A ticketing management system for a theatre to streamline ticket sales and seat allocation.
Create an online platform for customers to purchase tickets
Implement a seating chart to allow customers to select their seats
Include options for different ticket types (e.g. VIP, standard, student)
Generate electronic tickets for customers to present at the theatre entrance
Integrate payment processing for secure transactions
Q12. Design a home monitoring system for Comcast.
Design a home monitoring system for Comcast.
Include smart sensors for monitoring temperature, humidity, and motion
Integrate with smart devices like thermostats, cameras, and door locks
Provide real-time alerts and notifications to homeowners via mobile app
Allow remote access and control of home devices
Offer optional professional monitoring services for added security
Top Accountant Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month