Add office photos
Employer?
Claim Account for FREE

Ittiam Systems

3.4
based on 20 Reviews
Filter interviews by

10+ British Airways Interview Questions and Answers

Updated 5 Feb 2024

Q1. reverse an array inplace. -4 input AND gate using 2 input AND gates.give 2 ways and compare both.how will you identify which is better if both are given in a black box. -swap elements without using temp,in whic...

read more
Ans.

Questions on array manipulation and logic gates.

  • To reverse an array inplace, swap the first and last elements and continue swapping towards the middle.

  • To implement a -4 input AND gate using 2 input AND gates, use two 2-input AND gates and connect their outputs to a third 2-input AND gate.

  • To compare two black box implementations of an AND gate, test their output for all possible input combinations and compare the results.

  • To swap elements without using temp, use XOR operation. ...read more

Add your answer

Q2. you are given a 32 bit no. two bit positions say m and n are given. extract the pattern between m and n. e.g. 01100111110001011100100101011111 m=10,n=20; from m to n i have "10001011100"......so i had to extrac...

read more
Ans.

Extract a pattern between two given bit positions in a 32-bit number.

  • Convert the number to binary string.

  • Extract the substring between the given positions.

  • Convert the substring back to decimal if needed.

  • Handle edge cases like invalid positions or overlapping positions.

Add your answer

Q3. Where do local variables go? Why is stack used for function calls? Can you perform arithmetic operations directly on data stored in stacks?

Ans.

Local variables go on the stack. Stack is used for function calls due to its LIFO nature. Arithmetic operations can be performed on stack data.

  • Local variables are stored on the stack frame of the function they are declared in.

  • Stack is used for function calls because it allows for easy management of function call frames in a LIFO manner.

  • Arithmetic operations can be performed on data stored in the stack by first popping the operands and then pushing the result back onto the sta...read more

View 1 answer

Q4. -calculation of stack space used by a combination of functions and which used for storage of different data types

Ans.

To calculate stack space used by functions and data types, we need to consider their sizes and memory allocation.

  • Calculate the size of each data type used in the functions

  • Determine the number of variables declared in each function

  • Multiply the size of each variable by the number of times it is declared

  • Add up the total size of all variables in each function

  • Add the sizes of all functions together to get the total stack space used

Add your answer
Discover British Airways interview dos and don'ts from real experiences

Q5. -if you have to AND n inputs,how many AND gates will be required? (I said n-1 and he asked me to prove it mathematically)

Ans.

To AND n inputs, n-1 AND gates are required.

  • Each input needs to be connected to an AND gate except for the last input which is connected to the output.

  • The output of each AND gate is connected to the input of the next AND gate.

  • This results in n-1 AND gates being required for n inputs.

Add your answer

Q6. What is stack? Where is it used? (i said function calls) What exactly happens in function calls?

Ans.

Stack is a data structure used to store and manage function calls.

  • Stack is a LIFO (Last In First Out) data structure.

  • It is used to store function calls, local variables, and return addresses.

  • Pushing onto the stack adds a new element to the top, popping removes the top element.

  • Stack overflow occurs when the stack size exceeds its limit.

  • Example: recursive function calls use the stack to store return addresses and local variables.

Add your answer
Are these interview questions helpful?

Q7. Given numbers in range 1 to 1000000006, find the minimum number such that the product of its digits modulo 1000000007 is equal to itself

Ans.

Find the minimum number whose product of digits modulo 1000000007 is equal to itself.

  • Iterate through numbers from 1 to 1000000006

  • Calculate the product of digits modulo 1000000007 for each number

  • If the product is equal to the number, return the number as the minimum

  • If no such number is found, return -1

Add your answer

Q8. Program to find the number of trailing zeros in a factorial

Ans.

Program to find the number of trailing zeros in a factorial

  • Count the number of 5s in the factorial

  • Divide the number by 5 and add the quotient to the answer

  • Repeat until quotient is less than 5

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Find the transpose of a 2*2 square matrix(in place)

Ans.

Transpose a 2*2 square matrix in place

  • Swap the elements at (0,1) and (1,0) indices

  • No need to swap elements at (0,0) and (1,1) indices

  • Example: [[1,2],[3,4]] -> [[1,3],[2,4]]

Add your answer

Q10. Program to invert all bits from the leftmost set bit in an integer

Ans.

Program to invert all bits from the leftmost set bit in an integer

  • Find the leftmost set bit using bitwise operations

  • Create a mask with all bits set to 1 from the leftmost set bit

  • XOR the mask with the integer to invert all bits from the leftmost set bit

  • Repeat the above steps until all bits are inverted

Add your answer

Q11. Program to invert the case of the last letter in each word of a sentence

Ans.

Program to invert the case of the last letter in each word of a sentence

  • Split the sentence into an array of words

  • Loop through each word and get the last letter

  • Invert the case of the last letter using toUpperCase() and toLowerCase()

  • Replace the last letter in the word with the inverted case letter

  • Join the array of words back into a sentence

Add your answer

Q12. Can I increment a void pointer?

Ans.

No, incrementing a void pointer is not allowed.

  • Void pointers do not have a data type, so incrementing them is not possible.

  • Attempting to increment a void pointer will result in a compilation error.

  • To increment a pointer, it must be of a specific data type.

Add your answer

Q13. Time complexity of various operations on hashmap

Ans.

Time complexity of hashmap operations

  • Insertion and deletion: O(1) on average, O(n) in worst case

  • Search: O(1) on average, O(n) in worst case

  • Traversing: O(n)

  • Resizing: O(n)

Add your answer

Q14. Design a data structure for dictionary

Ans.

Design a data structure for dictionary

  • Use hash table or trie data structure

  • Each key maps to a value

  • Keys should be unique

  • Support operations like insert, delete, search

View 1 answer

Q15. -AND gate using multiplexer

Ans.

AND gate can be implemented using a 2:1 multiplexer.

  • Connect both inputs of the AND gate to the select line of the multiplexer.

  • Connect one input of the multiplexer to 0 and the other input to the second input of the AND gate.

  • The output of the multiplexer is the output of the AND gate.

Add your answer

Q16. Implement memcopy in C

Ans.

Implementing memcopy in C

  • Use a loop to copy each byte from the source to the destination

  • Handle overlapping memory regions correctly

  • Return a pointer to the destination

  • Ensure proper null termination for string copies

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at British Airways

based on 2 interviews
2 Interview rounds
Technical Round - 1
Technical Round - 2
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

1.9
 • 30 Interview Questions
3.6
 • 25 Interview Questions
3.9
 • 11 Interview Questions
3.5
 • 10 Interview Questions
3.9
 • 10 Interview Questions
3.8
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter