Add office photos
Employer?
Claim Account for FREE

Virtusa Software Services

3.4
based on 122 Reviews
Filter interviews by

20+ Thomas Cook Interview Questions and Answers

Updated 14 Oct 2024

Q1. Write a React Class component. Convert this Class to a Functional Component. How can you pass prop from parent to child component? Write code.

Ans.

Answer to a React Developer interview question about class and functional components and passing props.

  • Class component: class MyComponent extends React.Component {}

  • Functional component: const MyComponent = (props) => {}

  • Passing props from parent to child:

Add your answer

Q2. What are export types in ReactJS?

Ans.

Export types in ReactJS allow components, functions, and variables to be accessed and used in other files.

  • Exporting a component allows it to be imported and used in other files

  • Exporting a function allows it to be imported and used in other files

  • Exporting a variable allows it to be imported and used in other files

View 1 answer

Q3. What are Hooks in React? Explain useState, useEffect hooks.

Ans.

Hooks are functions that allow you to use state and other React features without writing a class.

  • useState is a hook that allows you to add state to functional components.

  • useEffect is a hook that allows you to perform side effects in functional components.

  • Hooks can only be used in functional components.

  • Hooks must be called at the top level of a functional component.

  • Hooks can be used to replace lifecycle methods in class components.

Add your answer

Q4. How Promise works? What is Promise.all. Write code for both.

Ans.

Promises are a way to handle asynchronous operations in JavaScript. Promise.all is used to execute multiple promises concurrently.

  • Promises represent a value that may not be available yet

  • They have three states: pending, fulfilled, and rejected

  • Promise.all takes an array of promises and returns a new promise that resolves when all promises in the array have resolved

  • If any promise in the array is rejected, the returned promise is rejected with the reason of the first promise that...read more

Add your answer
Discover Thomas Cook interview dos and don'ts from real experiences

Q5. What is the significance of 'this' keyword in JS?

Ans.

The 'this' keyword in JS refers to the object that is currently executing the code.

  • The value of 'this' depends on how a function is called.

  • In a method, 'this' refers to the object that the method belongs to.

  • In a regular function, 'this' refers to the global object (window in a browser).

  • In an event handler, 'this' refers to the element that triggered the event.

  • The value of 'this' can be explicitly set using call(), apply(), or bind() methods.

View 1 answer

Q6. Features of ES6. Explain Spread Operator and Rest Parameter by writing code. Give example for Object Destructuring.

Ans.

ES6 features: Spread Operator, Rest Parameter, Object Destructuring

  • Spread Operator: allows an iterable to be expanded into individual elements

  • Rest Parameter: allows a function to accept an indefinite number of arguments as an array

  • Object Destructuring: allows extracting properties from an object and assigning them to variables

Add your answer
Are these interview questions helpful?

Q7. How setState works in React?

Ans.

setState is a method used in React to update the state of a component.

  • setState is asynchronous and batched for performance optimization.

  • It merges the new state with the previous state.

  • It schedules a re-render of the component and its children.

  • Passing a function to setState ensures the previous state is used correctly.

  • Example: this.setState({ count: this.state.count + 1 })

View 1 answer

Q8. 3: Programing languages you're favour with , C or C++ or Java or Python.

Ans.

I am proficient in C++, Java, and Python.

  • Strong understanding of object-oriented programming concepts

  • Experience with data structures and algorithms

  • Proficient in using IDEs such as Eclipse and Visual Studio

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

Q9. What is difference between generator and iterator

Ans.

Generators produce values one at a time, while iterators are objects that allow iteration over a sequence of values.

  • Generators are functions that can pause and resume execution, producing a sequence of values lazily.

  • Iterators are objects that implement the Iterator protocol, allowing iteration over a sequence of values.

  • Generators can be created using function* syntax in JavaScript, while iterators can be created using the Symbol.iterator method.

Add your answer

Q10. Explain the different types of inhertance in python

Ans.

Python supports single, multiple, and multilevel inheritance.

  • Single inheritance: A class can inherit from only one parent class.

  • Multiple inheritance: A class can inherit from multiple parent classes.

  • Multilevel inheritance: A class can inherit from a derived class, creating a hierarchy.

Add your answer

Q11. Write python code to remove duplicates from a list

Ans.

Python code to remove duplicates from a list of strings

  • Use set() to remove duplicates from the list

  • Convert the set back to a list to maintain the order of elements

  • Example: input_list = ['apple', 'banana', 'apple', 'orange']

  • Output: ['apple', 'banana', 'orange']

Add your answer

Q12. Coding syntax why used

Ans.

Coding syntax is used to define the rules and structure of a programming language.

  • Coding syntax ensures that code is written in a consistent and understandable manner.

  • It helps the compiler or interpreter understand and execute the code correctly.

  • Syntax errors can be easily identified and corrected during the development process.

  • Examples: curly braces {} in C/C++, indentation in Python, semicolons ; in many languages.

Add your answer

Q13. What is difference between let const and var

Ans.

let and const are block-scoped while var is function-scoped. const cannot be reassigned, let and var can.

  • let and const are block-scoped, var is function-scoped

  • const cannot be reassigned, let and var can be

  • var can be hoisted, let and const cannot

Add your answer

Q14. Top earning employee in a sql table

Ans.

To find the top earning employee in a SQL table, you can use a SQL query with the MAX function on the salary column.

  • Use a SQL query with the MAX function on the salary column to retrieve the highest salary in the table.

  • Join the result with the employee table to get the details of the top earning employee.

  • Example: SELECT * FROM employees WHERE salary = (SELECT MAX(salary) FROM employees);

Add your answer

Q15. What are declarative rules?

Ans.

Declarative rules are statements that define the desired outcome without specifying the steps to achieve it.

  • Declarative rules focus on what needs to be done rather than how to do it

  • They are commonly used in programming languages like SQL and Prolog

  • Example: SQL SELECT statement specifies what data to retrieve without specifying how to retrieve it

Add your answer

Q16. What is hoisting in js

Ans.

Hoisting is a JavaScript behavior where variable and function declarations are moved to the top of their containing scope during compilation.

  • Variable and function declarations are hoisted to the top of their scope.

  • Only declarations are hoisted, not initializations.

  • Function declarations take precedence over variable declarations.

Add your answer

Q17. What is role and responsiblity

Ans.

The role and responsibility of a Senior Software Engineer is to design, develop, and maintain software applications, lead a team of developers, and ensure the quality and efficiency of the software development process.

  • Designing and developing software applications

  • Leading a team of developers

  • Ensuring the quality and efficiency of the software development process

  • Collaborating with stakeholders to gather requirements and provide technical solutions

  • Mentoring junior developers and...read more

Add your answer

Q18. What is the Workflow for documentation

Ans.

Documentation workflow involves planning, writing, reviewing, editing, and publishing content.

  • Plan the documentation by identifying the audience and purpose

  • Write the content following a structured format

  • Review the content for accuracy, clarity, and completeness

  • Edit the content for grammar, style, and consistency

  • Publish the documentation in the appropriate format

Add your answer

Q19. Multiply two tuples

Ans.

Multiplying two tuples involves multiplying corresponding elements of each tuple and summing the results.

  • Multiply the first element of the first tuple with the first element of the second tuple, then multiply the second element of the first tuple with the second element of the second tuple, and so on.

  • Sum the results of the multiplications to get the final result.

  • Example: (2, 3) * (4, 5) = (2*4) + (3*5) = 8 + 15 = 23

Add your answer

Q20. What is Project Management

Ans.

Project Management is the practice of planning, organizing, and executing projects to achieve specific goals within defined constraints.

  • Project Management involves defining project objectives, creating a project plan, and allocating resources.

  • It includes coordinating and communicating with team members, stakeholders, and clients.

  • Project Managers monitor progress, manage risks, and make adjustments to ensure successful project completion.

  • Examples of projects can range from bui...read more

Add your answer

Q21. what are collections

Ans.

Collections are data structures used to store and manipulate groups of related objects.

  • Collections can be of various types such as lists, sets, maps, etc.

  • They allow for easy manipulation and retrieval of data.

  • Examples include ArrayList, HashSet, and HashMap.

Add your answer

Q22. Non repeating char from a string

Ans.

Find the first non-repeating character in a string

  • Iterate through the string and count the frequency of each character

  • Return the first character with a frequency of 1

Add your answer

Q23. What is currying

Ans.

Currying is a technique in functional programming where a function with multiple arguments is transformed into a sequence of nested functions, each taking a single argument.

  • Currying helps in creating reusable functions and partial application.

  • It allows for better code organization and readability.

  • Example: const add = a => b => a + b; add(2)(3) will return 5.

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

Interview Process at Thomas Cook

based on 29 interviews
Interview experience
3.9
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.7
 • 2.8k Interview Questions
3.8
 • 364 Interview Questions
4.2
 • 361 Interview Questions
3.8
 • 299 Interview Questions
3.9
 • 207 Interview Questions
View all
Top Virtusa Software Services Interview Questions And Answers
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