Intel
10+ TCS Interview Questions and Answers
Q1. How would you clear the 7th bit in a 32 bit register
To clear the 7th bit in a 32-bit register, perform a bitwise AND operation with a mask that has all bits set to 1 except the 7th bit.
Create a mask with the 7th bit set to 0 and all other bits set to 1
Perform a bitwise AND operation between the register and the mask
Store the result back in the register
Q2. given a blackbox with arithmetic circuits , design the logical circuits
Design logical circuits for arithmetic circuits in a blackbox.
Understand the functionality of the arithmetic circuits in the blackbox.
Identify the inputs and outputs of the blackbox.
Design logical circuits using logic gates to replicate the arithmetic operations.
Test the logical circuits to ensure they produce the same outputs as the arithmetic circuits.
Q3. classes and structure and memory allocation for them
Classes are blueprints for creating objects, while structures are similar but with different default access levels.
Classes and structures are used to define the structure and behavior of objects in object-oriented programming.
Classes are reference types and are allocated on the heap, while structures are value types and are allocated on the stack.
Memory allocation for classes is managed by garbage collection, while memory allocation for structures is automatic.
Classes can hav...read more
Q4. Why UDP and not TCP in project
UDP is preferred over TCP in this project due to its low latency and lightweight nature.
UDP is a connectionless protocol, which means it does not establish a direct connection between the sender and receiver.
UDP is faster than TCP as it does not have the overhead of establishing and maintaining a connection.
UDP is suitable for applications where real-time data transmission is crucial, such as video streaming or online gaming.
UDP is more lightweight as it does not include feat...read more
Q5. phases of compiler
Phases of compiler include lexical analysis, syntax analysis, semantic analysis, code generation, and optimization.
Lexical analysis: breaking down input into tokens
Syntax analysis: checking if tokens form valid syntax
Semantic analysis: checking if syntax is semantically correct
Code generation: generating machine code from input
Optimization: improving generated code performance
Q6. why to c over cpp
C is preferred over C++ for certain applications due to its simplicity and efficiency.
C is a simpler language compared to C++ and has a smaller runtime footprint.
C is often used for low-level programming, embedded systems, and operating systems.
C allows for more control over memory management and can be faster in certain scenarios.
C++ introduces additional features like object-oriented programming and templates, which may not be necessary for all projects.
Q7. Design algorithm for sorting and searching.
Sorting and searching algorithms are essential in software development for organizing and retrieving data efficiently.
Use popular sorting algorithms like Bubble Sort, Merge Sort, Quick Sort, etc. for sorting arrays of strings.
For searching, consider algorithms like Linear Search, Binary Search, etc. to find specific strings in the array.
Optimize algorithms based on the size of the data and the frequency of operations needed.
Q8. Write how semaphore works
Semaphore is a synchronization tool used to control access to a shared resource.
Semaphore maintains a count of available resources.
A process can request access to a resource by decrementing the semaphore count.
If the count is zero, the process is blocked until a resource becomes available.
When a process is done with a resource, it increments the semaphore count.
If there are blocked processes waiting for a resource, one of them is unblocked.
Q9. embedded c-code for recursion
Recursion in embedded C-code allows a function to call itself, useful for repetitive tasks or complex algorithms.
Ensure proper base case to avoid infinite recursion
Use stack space efficiently as embedded systems have limited resources
Avoid recursive functions with deep call stacks to prevent stack overflow
Example: Recursive function to calculate factorial of a number
Q10. Convolution of 2 signals
Convolution is a mathematical operation that combines two functions to produce a third function.
Convolution is used in signal processing to analyze and filter signals.
It involves multiplying two signals and integrating the product over time.
The resulting signal represents the amount of overlap between the two original signals at each point in time.
Convolution can be performed using a variety of algorithms, including the fast Fourier transform (FFT).
Q11. Design a URL-shortening service
Design a URL-shortening service
Generate a unique short code for each URL
Store the mapping of short code to original URL in a database
Redirect users from short URL to original URL
Consider implementing custom short links for users
Track analytics for shortened URLs
More about working at Intel
Interview Process at TCS
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month