Skip to main content

Top most basic question for coding interview for freshers

 Hello everyone I am Raushan Ranjan

ow are you?

Let's jump into the topic.

Here you will have bunch of important question that you will need to understand the programming syntax and logic. These questions will let you completely understand the syntax of coding language.

Always remember these question seems easy but you might forget while solving in front of interviewer.

These questions are the most basic one. All you need to just understand the basic of programming logic and implement it.

Why you need to focus on these simple question

 Interviewer will throw these question to you at first, just to check is it worth to take your interview. They don't want to waste their time in that kind of student who don't even know single thing. They will analyze you by this way. Through this they can easily know if you have syntax knowledge of particular language or not. They are not going to ask you if you know coding or not instead they will throw these question to you.



In a simpe manner they are checking that  : -

Are you good in Coding?

 

Here are the list of questions with Hint given:

  1. Program to check the largest among three numbers:

    • Compare the first number with the second and third numbers.
    • Use conditional statements (if-else) to determine the largest number.
  2. Program to find the factorial of a number:

    • Use a loop to iterate from 1 to the given number.
    • Multiply the numbers in each iteration to calculate the factorial.
  3. Program to swap two numbers:

    • Use a temporary variable to store the value of one number.
    • Assign the value of the second number to the first number.
    • Assign the value of the temporary variable to the second number.
  4. Program to swap two numbers without an extra variable:

    • Use addition and subtraction operations to swap the numbers.
    • Perform arithmetic operations on the given numbers to exchange their values.
  5. Program to find even or odd numbers:

    • Use the modulus operator (%) to find the remainder when dividing the number by 2.
    • If the remainder is 0, the number is even. Otherwise, it is odd.
  6. Program to implement the ternary operator:

    • Use the syntax "condition ? expression1 : expression2" to implement the ternary operator.
    • The expression1 is executed if the condition is true, otherwise expression2 is executed.
  7. Program to find if a number is prime or not:

    • Use a loop to iterate from 2 to the square root of the given number.
    • Check if the number is divisible by any of the numbers in the iteration.
    • If it is divisible, it is not prime. Otherwise, it is prime.
  8. Program to find if a number is Armstrong or not:

    • Break down the given number into its individual digits.
    • Calculate the sum of the cubes of the digits.
    • If the sum is equal to the original number, it is an Armstrong number.
  9. Program to check if a string is palindrome or not:

    • Use two pointers, one starting from the beginning and the other from the end of the string.
    • Compare the characters at the corresponding positions of the pointers.
    • If all the characters match, the string is a palindrome.
  10. Program to find the first ten Fibonacci digits:

    • Use a loop to generate Fibonacci numbers.
    • Start with two variables initialized to 0 and 1.
    • Calculate the next number by adding the previous two numbers.
  11. Program to find the power of a number:

    • Use a loop to multiply the base number repeatedly.
    • The number of iterations will be equal to the exponent.
  12. Program to make a calculator:

    • Display a menu of operations to the user (e.g., addition, subtraction, multiplication, division).
    • Take input from the user for the chosen operation and the numbers on which the operation is to be performed.
    • Use conditional statements to perform the selected operation and display the result.
Try these question in your early phase of coding but keep in your mind to understand the logic. There is an alternate solution of just copy paste that is easy way to detroy your thinking logic. 


But if you solve by your own you can be better in these things:
  • Sytax understanding
  • Programming logic
  • End of fear of coding
  • Confidant on coding 
Hope this will help you out in your journey of cracking  a placement in good company with better package.I have tried to keep this post simple and effective by not adding spicy words. I have just give you the thing that you only need. 
If you like my post drop a comment and grab the link to share with your friends.
Have a good time.

Comments

Post a Comment

Popular posts from this blog

                              INCOME IDEAS                                                                          by RAUSHAN RANJAN PROBLEMS: ➨Don't have better life? ➨ Are u broke? ➨ Mentally tensed? ➨ Feeling useless? MONEY IS SOLUTION. World  is growing at faster rate. Some get aware of this growing rate at early age. Some get aware late.Getting aware means come to know that we have  to do lot of hard work to give ourself a better life. The question is why we need to work hard. And the answer is very simple  "TO EARN MONEY".Because money is attracted towards hardworking people. Hardworking is an act of respect towards money. ELON MUSK We can't neglect the fact that money can't bu...

Important Concept of OOPs

Hello Everyone I am Raushan Ranjan In this post we are going to cover the important concept of  OOPs. OOPs is an important key of programming language. We have to make our mind clear towards OOPs by understanding the each and every point given in this post. Let's jump into the main part OOP, or Object-Oriented Programming, is a way of writing code that helps us organize and manage our programs more effectively.  In OOP, we work with two main things: objects and classes. An object is something that represents a specific thing or concept in our program. For example, if we have a program about cars, an object could be a specific car like "Toyota Camry." Objects have characteristics or properties (like color, size, or speed) and can perform actions or behaviors (like accelerating or braking). A class , on the other hand, is like a blueprint or template for creating objects. It describes what properties an object will have and what actions it can perform. It defines the commo...

Understanding Array In Detail

Hello everyone I am Raushan Ranjan In this post we are going to get the details of Array. We will discuss everything about array. Let's understand in detail An array is a data structure that allows you to store multiple values of the same type under a single variable name. It provides a way to organize and access a collection of elements using a contiguous block of memory. In most programming languages, arrays are zero-indexed, which means the first element is accessed with an index of 0, the second with an index of 1, and so on. The size or length of an array determines the number of elements it can store. Here's an example of declaring and initializing an array in different programming languages: C++ : int numbers[5]; // Declaration of an integer array of size 5 int numbers[] = {1, 2, 3, 4, 5}; // Declaration and initialization of an integer array with values numbers[0] = 10; // Assigning a value to the first element int x = numbers[2]; // Accessing the third element and sto...