Posts

Showing posts from February, 2020

Basic algebra formulas that you can revise anytime and anywhere

FORMULAS FOR BEGINNER (a+b) ^2= a^2+b^2+2ab (a+b) ^2= (a-b) ^2+4ab (a-b) ^2= a^2+b^2-2ab (a-b) ^2= (a+b) ^2-4ab a^2+b^2= (a+b) ^2-2ab a^2+b^2= (a-b) ^2+ 2ab a^2-b^2= (a+b) (a-b) (a+b+c) ^2= a^2+b^2+c^2+2(ab+bc+ac) (a-b-c) ^2= a^2+b^2+c^2-2(ab-bc+ac) (a+b) ^3= a^3+b^3+3ab(a+b) (a-b) ^3= a^3-b^3+3ab(a-b) a^3+b^3= (a+b) (a^2-ab+b^2) a^3-b^3= (a-b) (a^2+ab+b^2) a^4-b^4= (a^2-b^2) (a^2+b^2) = (a^2+b^2) (a+b) (a-b) a^5+b^5= (a+b) (a^4-a^3b+a^2b^2-ab^3+b^4) a^5-b^5= (a-b) (a^4+a^3b+a^2b^2+ab^3+b^4)

How to answer "Why should I hire you? " (HR INTERVIEW)

1. As this is Interview conversation I would like to say If you hire me, I will be reaching your expectations in your organization. Without hiring me how you come to know that I am suitable for this position or not. So if you are hiring me, I will be an asset for your company that you feel not to loose 2. As I am a quick learner and I feel I have all the abilities and skill which you need for this post and I would like to prove your decision correct of selecting me for this post. So I think this reasons are enough for hiring me. 3. I have all the qualification required for this post. 4. You may have many options, and why do you have to choose me? 1. I never stop to improve myself, I never give up for hard work and I try my best. 2. I love to take responsibility and I like challenges. 5. This is prestigious job & I am inclined more to core sector job & my interest lies onto it, so this is best environment to explore my knowledge & utilize my technical skill

Miscellaneous interview questions

→How is a bubble sort algorithm implemented? →How is an iterative quicksort algorithm implemented? →How do you implement an insertion sort algorithm? →How is a merge sort algorithm implemented? →How do you implement a bucket sort algorithm? →How do you implement a counting sort algorithm? →How is a radix sort algorithm implemented? →How do you swap two numbers without using the third variable? →How do you check if two rectangles overlap with each other? →How do you design a vending machine?

Binary Tree Coding Questions

→How is a binary search tree implemented? →How do you perform preorder traversal in a given binary tree? →How do you traverse a given binary tree in preorder without recursion? →How do you perform an inorder traversal in a given binary tree? →How do you print all nodes of a given binary tree using inorder traversal without recursion? →How do you implement a postorder traversal algorithm? →How do you traverse a binary tree in postorder traversal without recursion? →How are all leaves of a binary search tree printed? →How do you count a number of leaf nodes in a given binary tree? →How do you perform a binary search in a given array?

String related interview questions

→How do you print duplicate characters from a string? →How do you check if two strings are anagrams of each other? →How do you print the first non-repeated character from a string? →How can a given string be reversed using recursion? →How do you check if a string contains only digits? →How are duplicate characters found in a string? →How do you count a number of vowels and consonants in a given string? →How do you count the occurrence of a given character in a string? →How do you find all permutations of a string? →How do you reverse words in a given sentence without using any library method? →How do you check if two strings are a rotation of each other? →How do you check if a given string is a palindrome?

Linked List Interview Questions

→How do you find the middle element of a singly linked list in one pass? →How do you check if a given linked list contains a cycle? How do you find the starting node of the cycle? →How do you reverse a linked list? →How do you reverse a singly linked list without recursion? →How are duplicate nodes removed in an unsorted linked list? →How do you find the length of a singly linked list? →How do you find the third node from the end in a singly linked list? →How do you find the sum of two linked lists using Stack?

Array coding Interview Questions

→How do you find the missing number in a given integer array of 1 to 100? →How do you find the duplicate number on a given integer array? →How do you find the largest and smallest number in an unsorted integer array? →How do you find all pairs of an integer array whose sum is equal to a given number? →How do you find duplicate numbers in an array if it contains multiple duplicates? →How are duplicates removed from a given array in Java? →How is an integer array sorted in place using the quicksort algorithm? →How do you remove duplicates from an array in place? →How do you reverse an array in place in Java? →How are duplicates removed from an array without using any library?

Common Interview Questions

Q.1-If you have ever dealt with difficult people, how did you manage conflict? Q.2-What are your proven coping mechanisms in challenging times? Q.3-If creative, where you do get your inspiration? Q.4-Convince me you are the perfect match for our opening. Q.4-What sort of pay do you expect to receive? Q.5-How does your previous experience relate to the job we have open? Q.6-How did you get along with your last boss? Q.7-What is the hardest job you‟ve ever held? Do you Q.8-Do you have any questions for us ? Q.9-How does your previous experience relate to the job we have open?

Common Interview Questions

Q.1-Please tell me about yourself. Q.2-What makes you interested in this position? Q.3-What do you know about our organization? Q.4-What do you consider your greatest strengths? Q.5-What would former coworkers/professors/supervisors say about you if we called them as a reference? Q.6-Why did you choose this field? Q.7-How did your college experience prepare you for a career in this field Q.8-Describe the work environment that makes you thrive.

What questions can I expect from a IT jobs company?? (HR ROUND)

What questions can I expect from a IT jobs company?? (HR ROUND)  Q.1-Tell us a little about yourself. Q.2-How do you anticipate using the skills/knowledge you’ve acquired in your internship in your classes next year? Q.3-Software Engineering is a rigorous major. What has been your most challenging course so far? Q.4-What insights would you share with your classmates about the SWE major? Q.5-Give two examples of things you’ve done on the job or in school that demonstrate your willingness to work hard. Q.6-What sorts of things have you done to become better qualified for your career? Q.6-It is very important to build good relationships at work but sometimes it doesn’t always work out. If you can, tell me about a time when you were not able to build a successful relationship with a difficult person. Q.7-Describe how your position on a group project contributed to your team’s goals. What are the team’s goals/mission? Q.8-Some people consider themselves to be “big pic

How to answer "Tell me about yourself"

1. Good morning, Thank you so much for giving me the opportunity to introduce myself. My name is Rohan Majumdar , I am from Westbengal , I born & brought up in Westbengal . Coming to my qualification, I have completed my graduation from MAKAUT University. There I secured 78% in B.Tech degree.  Coming to my family, Including me we are 5 members. Father, mother, brother & my wife. She is a house maker. Coming to my hobby, Watching TV, learning new things, Practicing martial arts etc. Coming to My strength, hard working and good listening. Coming to my goal, My Goal is I would like to become a successful in my profession. This is all about me. Thank you Sir/Madam. 2. I am xyz from Kerala and currently staying in Bangalore. Coming to my education qualification, I have completed my graduation in the stream of electronics and communication from xyz collage with an aggregate of and I did my schooling at xyz school. I am quite good in C and Java. If I talk about my family, we a

Preprocessor Directives

Image
Before a C program is compiled in a compiler, source code is processed by a program called preprocessor. This process is called preprocessing. Commands used in preprocessor are called preprocessor directives and they begin with ''#'' symbol. Below is the list of preprocessor directives that C language offers. 1 Macro syntax: #define This macro defines constant value and can be any of the basic data types. 2 Header file inclusion syntax: #include <file_name> The source code of the file ''file_name'' is included in the main program at the specified place 3 Conditional compilation syntax: #ifdef, #endif, #if, #else, #ifndef Set of commands are included or excluded in source program before compilation with respect to the condition 4 Other directives syntax: #undef, #pragma #undef is used to undefine a defined macro variable. #Pragma is used to call a function before and after main function in a C program These are th

File Operations and Functions

Image
File Pointers It is not enough to just display the data on the screen. We need to save it because memory is volatile and its contents would be lost once program terminated, so if we need some data again there are two ways one is retype via keyboard to assign it to particular variable, and other is regenerate it via pro-grammatically both options are tedious. At such time it becomes necessary to store the data in a manner that can be later retrieved and displayed either in part or in whole. This medium is usually a ''file'' on the disk. Introduction to file Until now we have been using the functions such as scanf,printf, getch, putch etc to read and write data on the variable and arrays for storing data inside the programs. But this approach poses the following programs. 1. The data is lost when program terminated or variable goes out of scope. 2. Difficulty to use large volume of data. We can overcome these problems by storing data on secondary devi

Union

Image
C Union is also like structure, i.e. collection of different data types which are grouped together. Each element in a union is called member. Union and structure both are same, except allocating memory for their members. Structure allocates storage space for each member separately. Whereas, Union allocates one common storage space for all its members. Syntax union tag_name { data type var_name1; data type var_name2; data type var_name3; }; Example union student { int id; char name[10]; char address[50]; }; Initializing and Declaring union variable union student data; union student data = {001,''AKKI'', ''mumbai''}; These are the Concept of C programming .We'll be glad if you share your valuable information with us regarding this topic, then it will be a golden opportunity for all of us to improve ourselves and know more. Comment below!!

Structure

Image
In Array we can store data of one type only, but structure is a variable that gives facility of storing data of different data type in one variable. Structures are variables that have several parts; each part of the object can have different types. Each part of the structure is called a member of the structure. # Declaration Consider basic data of student : roll_no, class, name, age, address. A structure data type called student can hold all this information: struct student { int roll_no char class char name[25]; int age; char address[50]; }; before the final semicolon, At the end of the structure's definition, we can specify one or more structure variables. There is also another way of declaring variables given below, struct student s1; # Initialization Structure members can be initialized at declaration. This is same as the initialization of arrays; the values are listed inside braces. The structure declaration is preceded by the keyword static

String

Image
A string is simply an array of characters which is terminated by a null character '\0' which shows the end of the string. Strings are always enclosed by double quotes. Whereas, character is enclosed by single quotes in C. This declaration and initialization create a string with the word "AKKI". To hold the \0 (null character) at the end of the array, the size of array is one more than the number of characters in the word "AKKI". char my_name[5] = {'A', 'K', 'K', 'I','\0'}; we can also write the above statement as follows: char my_name[] = "AKKI"; C String functions: To use string functions programmer must import String.h header file. String.h header file supports all the string functions in C language. All the string functions are given below. 1 strcat ( ) Concatenates str2 at the end of str1. 2 strncat ( ) appends a portion of string to another 3 strcpy ( ) Copies str2 into

Pointer

Image
Pointer is a variable that stores the address of another variable. They can make some things much easier, help improve your program's efficiency, and even allow you to handle unlimited amounts of data. C Pointer is used to allocate memory dynamically i.e. at run time. The variable might be any of the data type such as int, float, char, double, short etc. Syntax : Pointers require a bit of new syntax because when you have a pointer, you need the ability to both request the memory location it stores and the value stored at that memory location. data_type *ptr_name; Example : int *a; char *a; Where, * is used to denote that ''a'' is pointer variable and not a normal variable. Key points to remember about pointers in C: # Normal variable stores the value whereas pointer variable stores the address of the variable. # The content of the C pointer always be a whole number i.e. address. # Always C pointer is initialized to null, i.e. int *p = null.

Arrays

Image
Array is a collection of similar data type items. Arrays are used to store group of data of same datatype. Arrays can of any datatype. Arrays must have constant size. Continuous memory locations are used to store array. Array index always starts with 0. Example for Arrays: int a[5]; // integer array char a[5]; // character(string) array Types of Arrays: # One Dimensional Array # Two Dimensional Array # Multi Dimensional Array  One Dimensional Array Array declaration int age [5]; Array initialization int age[5]={0, 1, 2, 3, 4, 5}; Accessing array age[0]; /*0_is_accessed*/ age[1]; /*1_is_accessed*/ age[2]; /*2_is_accessed*/  Two Dimensional Array Two dimensional array is combination of rows n columns. Array declaration int arr[2][2]; Array initialization int arr[2][2] = {{1,2}, {3,4}}; Accessing array arr [0][0] = 1; arr [0][1] = 2; arr [1][0] = 3; arr [1][1] = 4; Multi Dimensional Array C programming language allows programmer to cre

Initialisation of Variables

Image
Initialization means assigning a value to the variable. If variables are not explicitly initialized, then external and static variables are initialized to zero; pointers are initialized to NULL ; auto and register variables have undefined values. int x = 1; char quote = '\''; long day = 60 * 24; int len = strlen(s); external and static initialization done once only. auto and register initialization done each time block is entered. external and static variables cannot be initialized with a value that is not known until run-time; the initialiser must be a constant expression. These are the Concept of C programming . We'll be glad if you share your valuable information with us regarding this topic, then it will be a golden opportunity for all of us to improve ourselves and know more. Comment below!!

definition and Declaration

Image
Definition is the place where variable is created (allocated storage). Declaration is a place where nature (type) of variable is stated, but no storage is allocated. Initialization means assigning a value to the variable. Variables can be declared many times, but defined only once. Memory space is not allocated for a variable while declaration. It happens only on variable definition. Variable declaration syntax data_type variable_name; example int a, b, c; char flag; Variable initialization syntax data_type variable_name = value; example: int a = 50; char flag = 't'; These are the Concept of C programming . We'll be glad if you share your valuable information with us regarding this topic, then it will be a golden opportunity for all of us to improve ourselves and know more. Comment below!!

Variable Storage Classes

auto: The default class. Automatic variables are local to their block. Their storage space is reclaimed on exit from the block. register : If possible, the variable will be stored in a processor register. May give faster access to the variable. If register storage is not possible, then the variable will be of automatic class. Use of the register class is not recommended, as the compiler should be able to make better judgement about which variables to hold in registers, in fact injudicious use of register variables may slow down the program. static : On exit from block, static variables are not reclaimed. They keep their value. On re-entry to the block the variable will have its old value. extern : Allows access to external variables. An external variable is either a global variable or a variable defined in another source file. External variables are defined outside of any function. (Note: Variables passed to a function and modified by way of a pointer are not extern

Blocks and Scope

C is a block structured language. Blocks are enclosed by { and }. Blocks can be defined wherever a C statement could be used. No semi-colon is required after the closing brace of a block. Variable Scope refers to where variables is declared. Global variable are declared outside any functions, usually at top of program. they can be used by later blocks of code: int g; int main(void) { g = 0; } Variables that are declared inside a function or block are local variables. The scope of local variables will be within the function only. These variables are declared within the function and can't be accessed outside the function. void main() { int g; g=2; printf(''g= %d'',&g); }

Standard Header Files

Standard header files contains Prototypes of the library functions. For example, math.h contains prototypes for mathematical operations. some standard header files are: stdio.h printf, scanf, getchar, putchat etc. stdlib.h utility functions; number conversions, memory allocation, exit and system , Quick Sort float.h system limits for floating point types math.h mathematical functions string.h string functions assert.h assertions ctype.h character class tests time.h date and time functions limits.h system limits for integral types setjmp.h non-local jumps signal.h signals and error handling stdarg.h variable length parameter lists Use the #include (preprocessor directive) and give angle brackets around the name of the file to include these standard header files in your program 

Definition and Declaration

A function definition contains function name, parameters, its code and return type and A function declaration contains only name and return type. User can define a function only once but it can be declared several times. declaration of function Syntax : < return_type> < function_name>(arguments... ); /* Declaration of area() */ int area(int x, int y); int main() { int x=10, y=25;   printf(''%d\n'',area(x,y)));   return 0; } Definition of function syntax < return_type> < function_name>(arguments) { Body of function; } /* Definition of area() */ int area(int x, int y) {   int z;   z = x*y;   retrun z; }

Function basics

Image
Building Blocks of Programs Functions like main, printf and scanf, We have already come through. All C programs made up of one or more functions. There must be one and only one main function. All functions are at the same level - there is no nesting.  Return Value Including main All functions can return a value,. Void Return type is specified if function is returning no value. Functions can return arithmetic values (int, float etc.), pointers structures, unions, or will not return anything (void) But they cannot return an array or a function. Function Parameters Any function (as well as main) can receive some values called parameters. While calling a function we must pass values of parameters. Format of Function :- < return_type> < function_name>(parameters...) { } Only Values of the parameters to the function at the time of calling it If, In definition of function contains void as parameter then function will not accept any parameter. Callin

Break and Continue

 Break statement Break statement is usually used to terminate a case in the switch statement. Break statement in loops to instantly terminates the loop and program control goes to the next statement after the loop. If break statement is used in nested loops (i.e., loop within another loop), the break statement will end the execution of the inner loop and Program control goes back to outer loop. Syntax : break; Continue statement In C programming language the continue statement works slightly similar to the break statement. The continue restarts the loop with the next value of item. All the line code below continue statement is skips. Syntax : continue; In the for loop, continue statement skips the test condition and increment value of the variable to execute again and In the while and do...while loops, continue skips all the statements and program control goes to at the end of loop for tests condition.

Local jumps - Goto

We can jump to any statement inside the same function using goto. To spot the end point of the jump a label is used. goto statement is not to ideal to choose in any programming language because it makes difficult to trace the flow of a program, makes the program hard to understand, and to guess the output. void any_function(void) {     for( ... )       if (problem) goto error; error: solve problem } But in the example above, remember that the code could be rewritten as: void function1(void) {     for( ... )       if (problem)       {         solve problem         return;       } }

Loops-while & for

while loop The while loop calculates the expression before every loop. If the expression is true then block of statements is executed, so it will not execute If the condition is initially false. It needs the parenthesis like the if statement. while ( expression ) /* while expression is true do following*/   statements... ; Do While loop This is equivalent to a while loop, but it have test condition at the end of the loop. The Do while loop will always execute at least once. do   statements ; while ( expression ); /* while expression is true do...*/ For loop This is very widely held loop. For loops work like the corresponding while loop shown in the above example. The first expression is treated as a statement and executed, then the second expression is test or condition which is evaluated to see if the body of the loop should be executed. The third expression is increment or decrement which is performed at the end of every iteration/repetition of the loop. for

Conditional selection Switch

switch() A switch statement is used instead of nested if...else statements. It is multiple branch decision statement of C. A switch statement tests a variable with list of values for equivalence. Each value is called a case. The case value must be a constant integer. Structure of switch() statement : switch (expression) {   case value: statements...   case value: statements...   default : statements... } Individual case keyword and a semi-colon (:) is used for each constant. Switch tool is used for skipping to particular case, after jumping to that case it will execute all statements from cases beneath that case this is called as ''Fall Through''. In the example below, for example, if the value 2 is entered, then the program will print two one something else! int main() {   int i;   printf(''Enter an integer: '');   scanf(''%d'',&i);   switch(i)   {     case 4: printf(''four ''); break;    

Conditional branching -if statement

An if statement contains a Boolean expression and block of statements enclosed within braces. Structure of if statement : if (boolean expression ) /* if expression is true */   statements... ; /* Execute statements */ If the Boolean expression is true then statement block is executed otherwise (if false) program directly goes to next statement without executing Statement block.  if...else statement If statement block with else statement is known as as if...else statement. Else portion is non-compulsory. Structure of if...else if(condition) {   statements... } else {   statements... } If the condition is true, then compiler will execute the if block of statements, if false then else block of statements will be executed. We can use multiple if-else for one inside other this is called as Nested if-else.

getchar and putchar

getchar and putchar are used for the input or output only one character. getchar() It returns an int which is either EOF(indicating end-of-file) or the next character in the standard input stream. putchar(c) puts the character on the output stream. int main() { int a; a = getchar(); /* read and assign character to c */ putchar(a); /* print c on the screen */ return 0; }

Printf, scanf and Character escape sequences

Formatted Output - printf It takes text and values from within the program and sends it out onto the screen. printf(''%f is your weight\n'', w); In the above program statement: ''%f is your weight\n'' is the control string w   is the variable to be printed %f   meaning that a floating point value is to be printed. The number of conversion specifications and the number of variables following the control string must be same, and that the conversion character is correct for the type of the parameter. Formatted Input - scanf scanf is used to get input from user and to store it in the specified variable(s). scanf(''%d'', &x); read a decimal integer from the keyboard and store the value in the memory address of the variable x. Character Escape Sequences   There are several character escape sequences which can be used in place of a character constant or within a string. \a alert (bell) \b backspace \f formfeed \