National Infotech
Tech Mahindra Interview Questions and Answers
Q1. What is the difference between a while loop and a do while loop?
A while loop checks the condition before executing the code block, while a do while loop executes the code block once before checking the condition.
While loop: Condition is checked before entering the loop.
Do while loop: Code block is executed at least once before checking the condition.
Example: while (condition) { // code block } vs. do { // code block } while (condition);
Q2. What do you know about embedded c programming?
Embedded C programming is a specialized skill used in developing software for embedded systems.
Embedded C is a variant of the C programming language specifically designed for embedded systems.
It is used to write code for microcontrollers, sensors, and other hardware devices.
Embedded C programming requires knowledge of low-level hardware interactions and memory management.
Example: Writing code to control a robotic arm using a microcontroller.
Q3. How the boost converter will work?
Boost converter is a type of DC-DC converter that steps up the input voltage to a higher output voltage.
Boost converter uses an inductor, a diode, a capacitor, and a switch to increase the voltage level.
During the switch on-time, energy is stored in the inductor. During the switch off-time, the energy is transferred to the output.
The output voltage is higher than the input voltage due to the energy transfer process.
Boost converters are commonly used in applications where a hi...read more
Q4. Why do we use timers and counters?
Timers and counters are essential in embedded systems for tasks like scheduling, measuring time intervals, generating waveforms, and counting events.
Timers are used for scheduling tasks at specific intervals, generating PWM signals, and measuring time durations.
Counters are used for counting external events like pulses, frequency measurement, and capturing input signals.
Timers and counters are crucial for real-time applications, communication protocols, and controlling hardwa...read more
Q5. Explain the difference between loops in C.
Different types of loops in C include for, while, and do-while loops.
For loop: Used when the number of iterations is known. Example: for(int i=0; i<5; i++) {}
While loop: Used when the number of iterations is unknown. Example: while(condition) {}
Do-while loop: Similar to while loop but guarantees at least one execution. Example: do {} while(condition);
Q6. Explain Timers and counters
Timers and counters are essential components in embedded systems used for measuring time intervals and counting events.
Timers are used to measure time intervals by counting clock cycles or external events.
Counters are used to count external events or pulses.
Timers can be used for generating delays, PWM signals, or triggering events.
Counters can be used for frequency measurement, event counting, or pulse width measurement.
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month