HCL Coding Questions and Answers

HCL Practice Coding Questions

As coding turns out to be the most crucial section of HCL recruitment examination, we believe that having a mindset for HCL Coding  Questions & Answers is important. As the number of questions is only 2 but the time allotted is only 20 mins so it becomes very hard to pass all the test cases. Hence, this makes it obvious to understand the pattern of questions asked in HCL Placement Paper. This page will help you to know the solution of some coding questions.

HCL Coding Questions and Answers 2024

About HCL Exam Pattern 2024

Topics Number of Questions Time Difficulty
Numerical Ability 15 15 mins Medium
Verbal Ability 15 15 mins Medium
Reasoning Ability 15 15 mins Medium
Computer Programming 30 30 mins High
Coding 2 20 mins High

HCL Coding Questions : Detailed Analysis

Find the complete analysis for HCL Coding Section below in the tabular format for better understanding.

HCL Section No. of questions Total Time
MCQ 30 30 mins
Coding Challenge 2 20 mins

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Some facts about Eligibility Criteria:-

The eligibility criteria for HCL is given below in the tabulated format.
HCLRequirements
QualificationB.Tech
Eligible stream(CSE,IT,ECE,EN,EI, ME)
Percentage Criteria75% throughout academics (10th, 12th / Diploma & UG)
BacklogNo Active Backlog
Service AgreementProbation period for selected SE/GET will be of 12 Months.

Practice Coding Question for HCL

Question 1 :

PrepInsta Name : Move Hash to Front

Problem Statement : You have write a function that accepts, a string which length is “len”, the string has some “#”, in it you have to move all the hashes to the front of the string and return the whole string back and
print it.

char* moveHash(char str[],int n);

  • Example :

    Sample Test Case

  • Input:
    Move#Hash#to#Front
  • Output:
    ###MoveHashtoFront

Question 2 :

PrepInsta Name : Borrow Number

Problem statement : You have two numbers number1 and number2, your job is to check the number of borrow operations needed for subtraction of number1 from number2. If the subtraction is not possible
then return the string not possible.

Example :

  • 754
    658
  • Answer :
    2
    654
    666
  • Answer:
    Not possible

Question 3 :

PrepInsta Name : Capitalize/Decapitalize

Problem statement : You’re given a function that accepts the following, a string1, its length and a character c. Your job is to replace all the occurrences of character c in string1 and capitalize it or decapitalize it based on the character c.

Question 4 :

Problem statement : You’re given a string where multiple characters are repeated consecutively. You’re supposed to reduce the size of this string using mathematical logic given as in the example below :

Question 5 :

PrepInsta Name : Spiral Matrix

Problem statement : You will be given a 2d matrix. Write the code to traverse the matrix in a spiral format. Check the input and output for better understanding.

Example :

Input :

5 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20

Output :

1 2 3 4 8 12 16 20 19 18 17 13 9 5 6 7 11 15 12 14 10

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others