Cognizant
Bird Worldwide Flight Services Interview Questions and Answers
Q1. What is opps ?, Difference between java and python?
OOPs is Object Oriented Programming. Java and Python are both OOPs languages, but differ in syntax and usage.
Java is statically typed, while Python is dynamically typed
Java requires more verbose syntax, while Python is more concise
Java is better suited for large-scale enterprise applications, while Python is better for scripting and data analysis
Java has a stronger emphasis on performance, while Python prioritizes ease of use and readability
Both languages support inheritance,...read more
Q2. How to implement stack? How does real analysis work?
Stack can be implemented using arrays or linked lists. It follows LIFO (Last In First Out) principle.
Create an empty array or linked list
Push elements onto the stack
Pop elements from the stack
Check if the stack is empty
Example: Infix to Postfix conversion using stack
Example: Undo/Redo functionality in text editors
Q3. What is the Friend function in C++?
Friend function in C++ is a non-member function that has access to the private and protected members of a class.
Declared inside the class but defined outside the class scope
Can access private and protected members of the class
Can be used to overload operators
Example: friend void display(A obj) { cout << obj.num; }
Example: class A { friend void display(A obj); };
Q4. what is list and dictionary
List and dictionary are data structures in programming.
List is an ordered collection of elements, accessed by index. Example: [1, 2, 3]
Dictionary is an unordered collection of key-value pairs. Example: {'name': 'John', 'age': 30}
Lists use square brackets [] while dictionaries use curly braces {}
Lists can contain duplicate values while dictionaries cannot have duplicate keys
Q5. Write a java program of palindrome
A Java program to check if a given string is a palindrome or not.
Create a function that takes a string as input
Use two pointers, one starting from the beginning and one from the end, to compare characters
Ignore spaces and punctuation while checking for palindrome
Example: 'racecar' is a palindrome, 'hello' is not
Q6. Reverse string in java
Use StringBuilder class to reverse a string in Java.
Create a StringBuilder object with the input string.
Use the reverse() method of StringBuilder to reverse the string.
Convert the StringBuilder back to a string using toString() method.
Q7. Java Programs on palindrom
Java programs to check if a given string is a palindrome or not.
Create a function to reverse the input string and compare it with the original string to check for palindrome.
Use built-in methods like StringBuilder.reverse() or manually iterate through the string to reverse it.
Handle edge cases like empty string or single character input.
Consider ignoring spaces and punctuation while checking for palindrome.
More about working at Cognizant
Top HR Questions asked in Bird Worldwide Flight Services
Interview Process at Bird Worldwide Flight Services
Reviews
Interviews
Salaries
Users/Month