Tech Mahindra is one of the tech majors that are hiring freshers and professionals. There are several opportunities for professionals to watch out for. However, for techies, to be a part of Tech Mahindra, it is essential to crack the coding interview that includes the questions around networks, programming languages, Linux, Computer Science, IT, Java, C++, and C.
There are multiple questions that the company asks in their coding round that includes MCQ, coding round, technical MCQ, etc. We summed up the major coding questions from JobBuzz to help the techies crack the interview at Tech Mahindra.
1. You create a new user by adding the following line to the /etc/passwd filebobm::501:501:Bob Morris:/home/bobm:/bin/bashYou then create the user’s home directory and use the passwd command to set his password. However, the user calls you and says that he cannot log on. What is the problem? Choose one:
- The user did not change his password.
- bobm does not have permission to /home/bobm.
- The user did not type his username in all caps.
- You cannot leave the password field blank when creating a new user.
2. You have written a script called usrs to parse the passwd file and create a list of usernames. You want to have this run at 5 am tomorrow so you can see the results when you get to work. Which of the following commands will work? Choose one:
- at 5:00 wed usrsb.
- at 5:00 wed -b usrsc.
- at 5:00 wed -l usrsd.
- at 5:00 wed -d usrs
3. The sum of five consecutive even numbers of set x is 440. Find the sum of a different set of five consecutive integers whose second least number is 121 less than double the least number of set x?
4. In your present working directory, you have the files maryletter memo1 MyTelephoneandAddressBookWhat is the fewest number of keys you can type to open the file MyTelephoneandAddressBook with vi? Choose one
5. What is the value of comm and sal after executing the following query if the initial value of ?sal? is 10000UPDATE EMP SET SAL = SAL + 1000, COMM = SAL*0.1;
6. You boot your system using LILO. Although you have four different boot images on your system, you cannot remember what you named them and you do not want to boot your default image. What should you do? Choose one:
- At the boot: prompt, press the Alt key.
- Hold the shift key down when booting until you get a prompt.
- At the boot: prompt, press the Tab key.
- You have to boot your default image and then look at the configuration file.
7. When a process is created using fork(). What is shared between the parent process and child process?
- Shared memory segments
- I/O handles
8. Can anyone tell me when we need a COLLECTION? I know the concept of PLAN and PACKAGE, but I am unable to understand COLLECTION.
Read more –
Compensation paid by Tech Mahindra
9. Which of the following statements drawn from the given statements are correct? Given: All watches sold in that shop are of a high standard. Some of the HMT watches are sold in that shop.
- All watches of high standard were manufactured by HMT.
- Some of the HMT watches are of a high standard.
- None of the HMT watches is of a high standard.
- Some of the HMT watches of a high standard are sold in that shop.
10. What would you type to send the last 20 lines of a text file to STDIN?
- end -n 20 filename
- last -n 20 filename
- head -20 filename
- end -20 filename
- tail -20 filename