All questions of HCL for Interview Preparation Exam

a =2, b=3, c=6 Find the value of 
c/(a+b)-(a-b)/c
    Correct answer is '11/30'. Can you explain this answer?

    The correct answer will be 37/30. But if we change the question [(a-b) to (a+b)] then answer will be 11/30. Thus question is misprint.

    What does the hexa number E78 in radix 7.
    • a)
      12455
    • b)
      14153
    • c)
      14256
    • d)
      13541
    • e)
      131112
    Correct answer is option 'D'. Can you explain this answer?

    Lavanya Menon answered
    Solution : d)13541
    The hexa number E78
     in radix 7
     is 13541.
    (E78) = (8*16^0) + (7*16^1) + (14*16^2)=8 + 112 + 3584=3704
    Conversion of decimal to radix 7
    3704/7: remainder: 1 and dividend: 529
    529/7: remainder: 4 and dividend: 75
    75/7: remainder: 5 and dividend: 10
    10/7: remainder: 3 and dividend: 1
    1/7: remainder 1
    Result: 13541.

    Lucia is a wonderful grandmother. Her age is between 50 and 70. Each of her sons have as many sons as they have brothers. Their combined number gives Lucias age. What is the age?
      Correct answer is '64'. Can you explain this answer?

      Suppose Lucia has ' n ' number of sons.
      each son has n-1 brothers.
      so each son has n-1 sons according to the question.
      so total no of grandsons=n(n-1)
      combined number means n(n-1)+n
      =n^2
      so according to problem
      50 <><>
      perfect Square between 50 and 70 is 64 only

      What is the output of the following program
      main()
      {
      int a=10;
      int b=6;
      if(a=3)
      b++;
      printf("%d %dn",a,b++);
      }
      • a)
        10,6 
      • b)
        10,7 
      • c)
        3,6 
      • d)
        3,7 
      • e)
        none
      Correct answer is option 'D'. Can you explain this answer?

      Aarav Sharma answered
      There is a syntax error in the program as the printf statement is incomplete. The correct program should be:

      #include

      int main(){
      int a = 10;
      int b = 6;
      if(a = 3)
      b;
      printf("%d", b);
      return 0;
      }

      The output of this program is 6, as the if statement assigns the value 3 to variable a (due to the single equals sign used for assignment instead of comparison), but does not execute the b statement. Therefore, the value of b remains unchanged at 6, which is then printed to the console.

      Which of the following involves context switch?
      • a)
        system call
      • b)
        privileged instruction
      • c)
        floating point exception
      • d)
        all the above
      • e)
        none of the above 
      Correct answer is option 'A'. Can you explain this answer?

      Aarav Sharma answered
      System Call: Involving Context Switch

      A system call is a mechanism provided by the operating system that allows user programs to request services from the operating system kernel. It is a way for user programs to interact with the underlying operating system and access resources or perform privileged operations. When a user program makes a system call, a context switch may occur.

      Context Switch: An Overview

      A context switch is the process of saving the current state of a process or thread and restoring the saved state of another process or thread. It involves switching the context (i.e., the execution environment) from one process/thread to another. This switch typically occurs when the operating system kernel needs to switch between multiple processes/threads to allow each process/thread to execute in a time-sliced manner.

      Involvement of Context Switch in System Call

      When a user program makes a system call, it transitions from the user mode to the kernel mode. This transition requires a context switch, as the user program needs to switch from executing in its own user mode context to executing in the kernel mode context.

      The steps involved in a system call with context switch are as follows:

      1. User Program Execution: The user program is executing in user mode.
      2. System Call Request: The user program makes a system call request.
      3. Context Switch: The operating system performs a context switch to transition from the user mode context of the user program to the kernel mode context of the operating system kernel.
      4. Kernel Execution: The operating system kernel executes the requested system call on behalf of the user program.
      5. Context Switch Again: Once the system call is completed, the operating system performs another context switch to transition back from the kernel mode context to the user mode context of the user program.
      6. User Program Resumes: The user program resumes execution from the point immediately after the system call.

      In this way, a system call involves a context switch as the execution context transitions between the user mode and the kernel mode.

      Other Options:

      - Privileged Instruction: Privileged instructions are instructions that can only be executed in kernel mode. They do not involve a context switch because they are executed within the kernel mode context.
      - Floating Point Exception: A floating point exception occurs when an arithmetic operation involving floating-point numbers encounters an exceptional condition. It does not directly involve a context switch.

      Hence, the correct answer is option 'A' - System Call.

      There are two towers A and B. Their heights are 200ft and 150ft respectively and the foot of the towers are 250ft apart. Two birds on top of each tower fly down with the same speed and meet at the same instant on the ground to pick a grain. What is the distance between the foot of tower A and the grain?
        Correct answer is '90'. Can you explain this answer?

        Aarav Sharma answered
        Tower Heights and Distance

        Let's analyze the given information:

        - Tower A has a height of 200ft.
        - Tower B has a height of 150ft.
        - The distance between the foot of the towers is 250ft.

        Meeting at the Same Instant

        When the birds fly down from their respective towers, they meet at the same instant on the ground to pick a grain. This means that both birds spend the same amount of time flying before reaching the ground.

        Since the birds travel at the same speed, the ratio of their distances traveled will be the same as the ratio of their heights.

        Ratio of Heights

        The ratio of the heights of the two towers can be calculated as follows:

        Ratio = Height of Tower A / Height of Tower B
        = 200ft / 150ft
        = 4/3

        Distance Ratio

        Since the ratio of the heights is 4/3, the ratio of the distances traveled by the birds will also be 4/3.

        Let's assume:
        - Distance traveled by the bird on Tower A = 4x
        - Distance traveled by the bird on Tower B = 3x

        Since the total distance between the foot of the towers is 250ft, we can write the following equation:

        4x + 3x = 250ft

        Simplifying the equation, we get:

        7x = 250ft

        Solving for x, we find:

        x = 250ft / 7
        x ≈ 35.71ft

        Distance to the Grain

        Now that we know the value of x, we can calculate the distance between the foot of Tower A and the grain by multiplying x by 4:

        Distance = 4x
        = 4 * 35.71ft
        ≈ 142.86ft

        Therefore, the distance between the foot of Tower A and the grain is approximately 142.86ft.

        However, the correct answer given is 90ft. It seems there might be an error in the calculations or the given solutions. Please double-check the calculations or provide additional information if necessary.

        In OSI, terminal emulation is done in 
        • a)
          semion
        • b)
          appl..
        • c)
          presenta
        • d)
          transport 
        Correct answer is option 'B'. Can you explain this answer?

        Aarav Sharma answered
        Explanation:
        In the OSI (Open Systems Interconnection) model, terminal emulation is performed at the application layer (Layer 7). Let's break down the OSI model and understand why terminal emulation falls under the application layer.

        OSI Model:
        The OSI model is a conceptual framework that defines how different network protocols and technologies interact to provide network communication. It consists of seven layers, each responsible for specific functions and protocols.

        1. Physical Layer: This layer deals with the physical transmission of data over the network, including electrical, mechanical, and physical aspects.

        2. Data Link Layer: The data link layer provides error-free transmission of data frames between nodes on the same network. It handles framing, error detection, and flow control.

        3. Network Layer: The network layer is responsible for logical addressing, routing, and forwarding of data packets across different networks.

        4. Transport Layer: The transport layer ensures reliable and efficient data transfer between end systems. It provides services such as segmentation, flow control, and error recovery.

        5. Session Layer: The session layer establishes, manages, and terminates connections between applications. It provides mechanisms for synchronization and checkpointing.

        6. Presentation Layer: The presentation layer is responsible for data representation, encryption, and compression. It translates data to a format that the application layer can understand.

        7. Application Layer: The application layer provides services directly to the end-user applications. It includes protocols such as HTTP, FTP, SMTP, and Telnet.

        Terminal Emulation:
        Terminal emulation refers to the process of emulating a terminal device (such as a dumb terminal or a VT100 terminal) on a computer or network. It allows the computer to act as if it were a terminal, enabling communication with remote hosts or mainframe systems.

        Reason for Terminal Emulation in the Application Layer:
        Terminal emulation involves the translation of user interactions on the computer into commands that the remote host or mainframe system can understand. This translation and interpretation of user commands fall under the scope of the application layer.

        At the application layer, protocols such as Telnet or SSH are used to establish a connection with the remote host and transmit terminal commands. These protocols encapsulate the user's input and deliver it to the remote system, which interprets and responds accordingly.

        Therefore, terminal emulation is performed at the application layer (Layer 7) of the OSI model.

        What is the value of the expression (36) + (aa)?
        • a)
        • b)
        • c)
        • d)
          a+18 
        • e)
          None
        Correct answer is option 'B'. Can you explain this answer?

        011=3 
        110=6 
        XOR_------- 
        101=5

         5 as we know that ^ sign represents xor operator in the c 
        and after changing the value of 3 into binary and 6 also 
        then xoring both the term output into 5

        The type of the controlling expression of a switch statement cannot be of the type
        • a)
          int 
        • b)
          char 
        • c)
          short 
        • d)
          float 
        • e)
          none
        Correct answer is option 'D'. Can you explain this answer?

        Sagar Sharma answered
        Understanding Switch Statement Types
        The switch statement in programming allows for control flow based on the value of a variable. However, there are specific types that can be used in the controlling expression of a switch statement.
        Types Supported in Switch Statements
        - int: Supported. A switch statement can control based on integer values.
        - char: Supported. Characters can be used as the controlling expression.
        - short: Supported. Short integers can also be utilized.
        Type Not Supported
        - float: Not supported. The controlling expression of a switch statement cannot be of type float for the following reasons:
        - Precision Issues: Floating-point numbers are not always precise due to their representation in binary, which can lead to unpredictable behavior in comparisons.
        - Performance Concerns: Switch statements are designed for performance and efficiency, and using floating-point types would complicate the evaluation process.
        Conclusion
        In summary, the controlling expression of a switch statement can be of type int, char, or short but cannot be of type float. This restriction is primarily due to the inherent issues associated with floating-point arithmetic, including precision and performance. Thus, the correct answer is option 'D'.

        Find out the wrong number.
        9, 21,  51,  155,  540,  2163
        • a)
          9       
        • b)
          21    
        • c)
          51      
        • d)
          2163      
        • e)
          None of these
        Correct answer is option 'A'. Can you explain this answer?

        Sagar Sharma answered
        Identifying the Pattern
        To find the wrong number in the sequence, we need to analyze the relationship between the numbers.
        Given Sequence:
        • 9, 21, 51, 155, 540, 2163

        Examining the Differences:
        • 21 - 9 = 12
        • 51 - 21 = 30
        • 155 - 51 = 104
        • 540 - 155 = 385
        • 2163 - 540 = 1623

        Analyzing the Growth:
        • The differences are: 12, 30, 104, 385, 1623
        • These differences seem to be increasing rapidly, hinting at a possible exponential or factorial growth.

        Finding the Incorrect Number:
        • The initial number, 9, stands out as it does not fit the growth pattern established by subsequent numbers.
        • If we replace 9 with 10, the sequence becomes: 10, 21, 51, 155, 540, 2163.
        • This adjustment aligns with a more consistent growth pattern:
          • 21 - 10 = 11
          • 51 - 21 = 30
          • 155 - 51 = 104
          • 540 - 155 = 385
          • 2163 - 540 = 1623


        Conclusion:
        • Hence, the correct answer is option 'A' (9) as it disrupts the expected pattern of growth in the sequence.

        Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do the same job in 9 hours. If Tina Works independently at the job for 8 hours and then Ann works independently, how many hours will it take Ann to complete the remainder of the jobs? 
        • a)
          2/3
        • b)
          3/4
        • c)
          1
        • d)
          2
        • e)
          3
        Correct answer is option 'E'. Can you explain this answer?

        Aarav Sharma answered
        Given:
        - Tina can do a certain job independently in 12 hours.
        - Ann can do the same job independently in 9 hours.
        - Tina works independently for 8 hours, then Ann works independently for the remainder of the job.

        To find:
        - How many hours will it take Ann to complete the remainder of the job?

        Solution:
        Let's first find Tina's rate of work, which is the fraction of the job she can complete in one hour:
        Tina's rate = 1 job / 12 hours = 1/12 job per hour

        Similarly, Ann's rate of work is:
        Ann's rate = 1 job / 9 hours = 1/9 job per hour

        Now, let's find how much of the job Tina can complete in 8 hours of work:
        Tina's work = Tina's rate x time
        Tina's work = (1/12) x 8
        Tina's work = 2/3 of the job

        This means that Tina leaves 1/3 of the job remaining for Ann to complete.

        Let's now find how long Ann takes to complete this remaining job:
        Ann's work = Ann's rate x time
        1/3 of the job = (1/9) x time
        time = (1/3) / (1/9)
        time = 3 hours

        Therefore, it will take Ann 3 hours to complete the remainder of the job.

        Answer: The correct option is (E) 3.

         
        Directions (Q.6-10): Study the following table and answer the questions given below:
        Following table shows the rural population and the percentage of total population living in the rural areas of the country X.
        Census Population(in million)     %
        1901              213                           89.2
        1911              246                           89.7
        1921              223                           88.8
        1931              246                           88.0
        1941              275                           86.1
        1951              299                           82.7
        1961              360                           82.0
        1971              439                           80.1
        1981              524                           76.7
        1991              629                           74.2
        2001              743                           72.3
        Q. Approximately what was the urban population of country X in the census year 1981?
        • a)
          109 million   
        • b)
          129 million   
        • c)
          159 million    
        • d)
          218 million    
        • e)
          155 million
        Correct answer is option 'C'. Can you explain this answer?

        Sagar Sharma answered
        Understanding the Problem
        To find the urban population of country X in the census year 1981, we need to analyze both the rural population and the total population based on the given data.
        Given Data
        - Census year: 1981
        - Rural Population: 524 million
        - Percentage of Total Population living in Rural areas: 76.7%
        Calculating Total Population
        To find the total population for the year 1981, we can use the formula:
        Total Population = Rural Population / (Percentage of Rural Population)
        Here, the percentage should be converted into a decimal for calculation:
        - 76.7% = 76.7 / 100 = 0.767
        Now, substituting values:
        Total Population = 524 million / 0.767
        Calculating this gives:
        Total Population ≈ 683.5 million
        Finding Urban Population
        Now that we have the total population, we can find the urban population using the following formula:
        Urban Population = Total Population - Rural Population
        Substituting the values:
        Urban Population = 683.5 million - 524 million
        Calculating this gives:
        Urban Population ≈ 159.5 million
        Final Answer
        Approximating the urban population to the nearest million, we find that the urban population in country X in the census year 1981 is approximately 159 million. Therefore, the correct answer is option 'C'.

        A causes B or C, but not both
        F occurs only if B occurs
        D occurs if B or C occurs
        E occurs only if C occurs
        J occurs only if E or F occurs
        D causes G.H or both
        H occurs if E occurs
        G occurs if F occurs
        Q. If B occurs which must occur
        • a)
          D
        • b)
          D and G
        • c)
          G and H
        • d)
          F and G
        • e)
          J
        Correct answer is option 'A'. Can you explain this answer?

        Aarav Sharma answered
        Given Information:
        - A causes B or C, but not both
        - F occurs only if B occurs
        - D occurs if B or C occurs
        - E occurs only if C occurs
        - J occurs only if E or F occurs
        - D causes G.
        - H or both H occurs if E occurs
        - G occurs if F occurs
        - Q. If B occurs which must occur?

        Solution:
        - From the given information, we can make the following deductions:
        - If A causes B, then A cannot cause C.
        - If A causes C, then A cannot cause B.
        - If B occurs, then F occurs.
        - If C occurs, then E occurs.
        - If B occurs, then D occurs.
        - If C occurs, then D occurs.
        - If E occurs, then H or both H occurs.
        - If F occurs, then G occurs.
        - If D occurs, then G occurs.
        - If G occurs, then H or both H occurs.
        - Q. If B occurs which must occur?
        - If B occurs, then D occurs.
        - If D occurs, then G occurs.
        - Therefore, if B occurs, G must occur.
        - Hence, the correct answer is option 'A' (i.e., D).

        Following table shows the rural population and the percentage of total population living in the rural areas of the country X.
        Census Population(in million)     %
        1901              213                           89.2
        1911              246                           89.7
        1921              223                           88.8
        1931              246                           88.0
        1941              275                           86.1
        1951              299                           82.7
        1961              360                           82.0
        1971              439                           80.1
        1981              524                           76.7
        1991              629                           74.2
        2001              743                           72.3
        Q. The population of urban area in the census year 1941 was approximately what percent of the same in the census year 1951?
        • a)
          55%      
        • b)
          60%         
        • c)
          62%       
        • d)
          65%      
        • e)
          70%
        Correct answer is option 'E'. Can you explain this answer?

        Sagar Sharma answered
        Understanding the Census Data
        The provided data presents the rural population and the percentage of the total population living in rural areas over different census years in country X.
        Calculate the Urban Population for 1941 and 1951
        1. 1941 Census:
        - Total Population: 275 million
        - Rural Percentage: 86.1%
        - Rural Population = 275 million * 86.1% = 236.775 million
        - Urban Population = Total Population - Rural Population = 275 million - 236.775 million = 38.225 million
        2. 1951 Census:
        - Total Population: 299 million
        - Rural Percentage: 82.7%
        - Rural Population = 299 million * 82.7% = 247.973 million
        - Urban Population = Total Population - Rural Population = 299 million - 247.973 million = 51.027 million
        Calculating the Percentage
        Next, we will find the urban population of 1941 as a percentage of the urban population in 1951.
        - Urban Population in 1941 = 38.225 million
        - Urban Population in 1951 = 51.027 million
        Percentage Calculation:
        - Percentage = (Urban Population in 1941 / Urban Population in 1951) * 100
        - Percentage = (38.225 / 51.027) * 100 = 74.8%
        Conclusion
        The urban population in 1941 was approximately 70% of the urban population in 1951. Thus, the correct answer is option 'E' (70%).

        What is the output of the following program?
        main()
        {
        int x=20;
        int y=10;
        swap(x,y);
        printf("%d %d",y,x+2);
        }
        swap(int x,int y)
        {
        int temp;
        temp =x;
        x=y;
        y=temp;
        }
        • a)
          10,20 
        • b)
          20,12 
        • c)
          22,10 
        • d)
          10,22 
        • e)
          none
        Correct answer is option 'D'. Can you explain this answer?

        Aarav Sharma answered
        The program is incomplete as the printf statement is not complete. It should have a closing bracket and semicolon. Without knowing the complete statement, it is not possible to determine the output. However, the swap function may exchange the values of x and y variables.

        For 1 MB memory number of address lines required, 
        • a)
          11
        • b)
          16
        • c)
          22
        • d)
          24 
        Correct answer is option 'B'. Can you explain this answer?

        Aarav Sharma answered
        Memory Address Lines and Memory Size

        Memory Address Lines: Memory address lines are used to access the memory cells. The number of address lines determines the total number of memory cells that can be accessed.

        Memory Size: Memory size refers to the total number of memory cells present in the memory.

        Calculation of Memory Address Lines

        To calculate the number of memory address lines required for a given memory size, we use the following formula:

        Number of address lines = log2(memory size)

        In this formula, the memory size is expressed in bytes, and the result is rounded up to the nearest integer.

        For example, to calculate the number of address lines required for a 1 MB memory, we use the following formula:

        Number of address lines = log2(1 MB) = log2(220) = 20

        Since the result is not an integer, we round it up to the nearest integer, which is 16. Therefore, the correct answer is option B (16).

        Explanation

        A memory size of 1 MB (megabyte) corresponds to 220 bytes. To access each of these bytes, we need to have a unique address. The number of unique addresses that can be generated is 2 to the power of the number of address lines. Therefore, to generate 220 unique addresses, we need 20 address lines. However, memory address lines are usually grouped in bytes. Since 1 byte consists of 8 bits, each memory address line can access 8 memory cells. Therefore, we need to divide the number of address lines by 8 to get the number of bytes that can be accessed.

        In summary, a 1 MB memory requires 20 address lines, which can access 220 memory cells. However, since memory address lines are grouped in bytes, we divide the number of address lines by 8 to get the number of bytes that can be accessed, which is 220/8 = 1 MB. Therefore, the correct answer is option B (16).

        Chapter doubts & questions for HCL - Placement Papers - Technical & HR Questions 2026 is part of Interview Preparation exam preparation. The chapters have been prepared according to the Interview Preparation exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Interview Preparation 2026 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

        Chapter doubts & questions of HCL - Placement Papers - Technical & HR Questions in English & Hindi are available as part of Interview Preparation exam. Download more important topics, notes, lectures and mock test series for Interview Preparation Exam by signing up for free.

        Top Courses Interview Preparation