Comcast
30+ Tatvic 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
Q13. What is dependency injection and how to achieve that? and what is Inversion of control?
Dependency injection is a design pattern that allows objects to receive dependencies rather than creating them.
Dependency injection is a way to achieve loose coupling between objects.
It allows for easier testing and maintenance of code.
There are three types of dependency injection: constructor injection, setter injection, and interface injection.
Inversion of control is a principle that states that the control of object creation and lifecycle should be handed over to a contain...read more
Q14. When to use horizontal scaling and vertical scaling
Horizontal scaling is adding more machines to your pool of resources, while vertical scaling is adding more power (CPU, RAM) to an existing machine.
Use horizontal scaling when you need to increase capacity by adding more machines to distribute the load.
Use vertical scaling when you need to handle increased load on a single machine by adding more resources like CPU or RAM.
Horizontal scaling is more cost-effective and provides better fault tolerance.
Vertical scaling is easier t...read more
Q15. what is git stash ? and scenario when conflicts occurs
Git stash is a command in Git that temporarily shelves changes so you can work on something else.
Git stash is used to save changes that are not ready to be committed yet.
It allows you to switch branches without committing changes.
Conflicts can occur when stashed changes conflict with changes in the current branch.
You can resolve conflicts by applying the stash, resolving conflicts, and then committing the changes.
Q16. What is unit testing and who will be doing it?
Unit testing is a software testing method where individual units or components of a software are tested in isolation.
Unit testing is typically done by developers to ensure that each unit of code functions correctly on its own.
It helps in identifying bugs early in the development process.
Unit tests are automated and focus on testing small, specific parts of the code.
Examples of unit testing frameworks include JUnit for Java, NUnit for .NET, and pytest for Python.
Q17. How to get random mobile for 10 user using python in robot framework
Use Python in Robot Framework to generate random mobile numbers for 10 users.
Use the Faker library in Python to generate random mobile numbers
Create a loop to generate mobile numbers for 10 users
Implement the logic in a Robot Framework test case
Q18. How is your efficiency for GitHub and for command tools?
Efficient in using GitHub and command line tools for version control and automation.
Proficient in using Git commands for version control and collaboration.
Familiar with creating branches, merging code, resolving conflicts, and managing repositories on GitHub.
Experienced in using command line tools for automation tasks like scripting and deployment.
Comfortable with tools like Git Bash, Git GUI, and command line interfaces for various operating systems.
Q19. How did you handle backlog grooming sessiond.
I prioritize items based on business value and work with the team to refine and estimate them.
Collaborate with team to ensure understanding of user stories
Prioritize backlog items based on business value and user needs
Refine backlog items to ensure they are clear, concise, and actionable
Estimate backlog items with the team to ensure feasibility and accuracy
Q20. How to check the system status in OS level
To check system status in OS level, use commands like top, ps, vmstat, sar, etc.
Use 'top' command to display real-time system information like CPU and memory usage
Use 'ps' command to display currently running processes
Use 'vmstat' command to display virtual memory statistics
Use 'sar' command to display system activity reports
Q21. What is inheritance and implementation
Inheritance is a mechanism in object-oriented programming where a class inherits properties and behaviors from another class. Implementation is the process of defining the methods and behaviors of a class.
Inheritance allows a class to inherit attributes and methods from another class, promoting code reusability.
Implementation involves writing the actual code for the methods and behaviors defined in a class.
Example: Class 'Animal' can be a base class with attributes like 'name...read more
Q22. Different response codes in API testing
Response codes in API testing indicate the status of the request made to the API.
200 - OK: Request was successful
400 - Bad Request: Invalid input or missing parameters
401 - Unauthorized: Authentication required
404 - Not Found: Resource not found
500 - Internal Server Error: Server-side issue
Q23. Different metrics used in HR BP team
HR BP team uses various metrics to measure employee performance and engagement.
Employee turnover rate
Absenteeism rate
Time to fill vacancies
Training and development metrics
Employee satisfaction surveys
Diversity and inclusion metrics
Q24. Write program of sum of digits
Program to calculate the sum of digits in a number
Iterate through each digit of the number and add them together
Use modulus operator to extract each digit
Convert the number to a string to easily access individual digits
Q25. Where the windows logs will be stored
Windows logs are stored in the Event Viewer application on Windows operating systems.
Windows logs are stored in the Event Viewer application.
Event Viewer can be accessed by searching for 'Event Viewer' in the Windows search bar.
Logs are categorized into different sections such as Application, Security, System, etc.
Q26. A c++ program to write a input stream to a file.
Use C++ to write an input stream to a file.
Open the input stream and output file streams in C++.
Read from the input stream and write to the output file stream.
Close both streams after writing is complete.
Q27. Difference between Severity and priority
Severity is the impact of a bug on the system, while priority is the urgency of fixing it.
Severity is the measure of how much a bug affects the system's functionality.
Priority is the order in which bugs should be fixed based on urgency.
Severity is usually categorized as low, medium, or high.
Priority is usually categorized as low, medium, or high.
For example, a bug that causes the system to crash would have high severity and high priority.
Q28. Smallest number in array
Find the smallest number in an array of strings
Convert the strings to numbers before comparing
Use a loop to iterate through the array and keep track of the smallest number
Handle cases where the array is empty or contains non-numeric strings
Example: ['5', '10', '2', '8'] should return '2'
Q29. Post call vs Patch call
Post call is made after a transaction is completed, while patch call is used to update specific parts of a resource.
Post call creates a new resource, while patch call updates an existing resource.
Post call is used for creating new records in a database, while patch call is used for updating existing records.
Post call is idempotent, meaning multiple identical requests will have the same effect, while patch call is not necessarily idempotent.
Q30. count of repetition in a string
Count the number of times a specific substring appears in a given string.
Use a loop to iterate through the string and check for the substring at each position.
Use a counter variable to keep track of the number of times the substring is found.
Consider using built-in string functions or regular expressions for efficient counting.
Example: Given string 'hellohellohello' and substring 'hello', the count would be 3.
Q31. what is data warehouse
A data warehouse is a centralized repository that stores structured and unstructured data from various sources for analysis and reporting.
Data warehouses are used for decision-making and business intelligence purposes.
They typically involve extracting, transforming, and loading data from different sources into a single, unified database.
Data warehouses often use dimensional modeling and OLAP (Online Analytical Processing) techniques.
Examples of data warehouse tools include Sn...read more
Q32. what is fact and dimensions
Facts are measurable data points, while dimensions provide context to the facts.
Facts are quantitative data that can be measured or counted.
Dimensions are qualitative data that provide context to the facts.
Examples: In a sales database, sales amount is a fact, while product category is a dimension.
Q33. Explain the project structure
The project structure includes folders for source code, test scripts, configuration files, and documentation.
Main folders: src (source code), test (test scripts), config (configuration files), docs (documentation)
Subfolders: src/main/java (Java source code), src/test/java (test scripts), config/env (environment configurations)
Build tools: Maven, Gradle
Version control: Git
Continuous integration: Jenkins, Travis CI
Q34. Explain about ur framework
Our framework is a hybrid framework that uses both data-driven and keyword-driven approaches.
Our framework is built using Selenium WebDriver and TestNG.
It uses Excel sheets to store test data and Apache POI library to read/write data from/to Excel.
We have created custom keywords for common actions like clicking, entering text, etc.
We have also implemented page object model for better organization and maintenance of code.
Our framework generates detailed HTML reports using Exte...read more
Q35. Explain about TLS handshake.
TLS handshake is a process of establishing a secure connection between a client and a server.
TLS handshake involves a series of steps such as client hello, server hello, certificate exchange, key exchange, and session establishment.
During the handshake, the client and server negotiate the encryption algorithm and exchange keys to encrypt and decrypt data.
TLS handshake ensures the authenticity, confidentiality, and integrity of the communication between the client and server.
I...read more
Q36. explain oracle Archit
Oracle architecture is a multi-tiered system with components like client, server, and database.
Oracle architecture consists of client, server, and database components.
The client communicates with the server to access the database.
The server processes the client's requests and interacts with the database.
The database stores and manages the data.
Oracle architecture is designed to be scalable and secure.
Q37. WHAT IS DRM ?
DRM stands for Digital Rights Management, a technology used to protect digital content from unauthorized access and distribution.
DRM is used to control access to digital content and prevent piracy.
It can restrict the number of devices a user can access the content on.
DRM can also limit the ability to copy, print, or share digital content.
Examples of DRM include encrypted eBooks, streaming services like Netflix, and software with license keys.
Q38. advantages of using golang
Efficiency, simplicity, concurrency support, strong typing, easy to learn and use
Efficiency: Golang compiles to machine code, resulting in fast execution
Simplicity: Golang has a clean and simple syntax, making it easy to read and write
Concurrency support: Golang has built-in support for concurrent programming with goroutines and channels
Strong typing: Golang's static typing helps catch errors at compile time
Easy to learn and use: Golang's minimalistic design and comprehensive...read more
Top HR Questions asked in Tatvic
Interview Process at Tatvic
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month