Premium Employer

Publicis Sapient

3.5
based on 3.2k Reviews
Filter interviews by

10+ McCain Foods Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. What is limit for no of arguments passed to functions? if limit is 10 den how to pass more parameters? Ans:- either Array or Structure

Ans.

The limit for the number of arguments passed to functions is not fixed. Arrays or structures can be used to pass more parameters.

  • The limit for the number of arguments passed to functions is not fixed and depends on the programming language and system architecture.

  • In C programming language, there is no limit on the number of arguments that can be passed to a function.

  • In Java, the maximum number of arguments that can be passed to a method is 255.

  • To pass more parameters than the...read more

Add your answer

Q2. There is 2 pot one red and one blue. one pot contains tressure. Two statement are given 1. only one of the statement is correct. 2. Blue pot has the tressure. Find the tressure?

Ans.

The treasure is in the red pot.

  • The statement 'only one of the statement is correct' means that one statement is true and the other is false.

  • If the blue pot has the treasure, then both statements would be true, which contradicts the given information.

  • Therefore, the statement 'Blue pot has the treasure' must be false, and the treasure must be in the other pot, which is the red pot.

Add your answer

Q3. What is difference between Static and Global Vaiable?

Ans.

Static variables have local scope but retain their value between function calls, while global variables have global scope.

  • Static variables are declared inside a function and retain their value between function calls

  • Global variables are declared outside of any function and can be accessed from any part of the program

  • Static variables have local scope, while global variables have global scope

  • Static variables are initialized only once, while global variables are initialized at th...read more

Add your answer

Q4. What is difference between if else and switch case statements?

Ans.

if else is used for simple conditions while switch case is used for multiple conditions.

  • if else is a sequential decision-making statement while switch case is a multi-branch decision-making statement

  • if else is used when there are only a few conditions to be checked while switch case is used when there are multiple conditions to be checked

  • if else can have multiple conditions in a single statement while switch case can only have one condition per case

  • if else is more readable an...read more

Add your answer
Discover McCain Foods interview dos and don'ts from real experiences

Q5. Plant 10 plants in 5 rows such that each row has 4 plants

Ans.

10 plants can be planted in 5 rows with 4 plants in each row.

  • Divide the plants into groups of 4.

  • Arrange the groups in 5 rows.

  • Each row will have 4 plants.

Add your answer

Q6. what are 3 steps for using function in c?

Ans.

Three steps for using functions in C.

  • Declare the function with its return type, name, and parameters.

  • Define the function by writing the code for it.

  • Call the function by using its name and passing arguments if necessary.

Add your answer
Are these interview questions helpful?

Q7. What is a stack and various operations on it?

Ans.

A stack is a data structure that follows the Last In First Out (LIFO) principle.

  • Push: adds an element to the top of the stack

  • Pop: removes the top element from the stack

  • Peek: returns the top element without removing it

  • IsEmpty: checks if the stack is empty

  • Size: returns the number of elements in the stack

Add your answer

Q8. What is Difference between C,C++?

Ans.

C is a procedural programming language while C++ is an object-oriented programming language.

  • C is a low-level language while C++ is a high-level language.

  • C++ supports object-oriented programming concepts like classes, inheritance, and polymorphism.

  • C++ has better support for exception handling and templates.

  • C++ is more complex than C and requires more memory.

  • C++ is used for developing applications like video games, while C is used for developing operating systems and system sof...read more

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

Q9. Find the output:- a=5;b=4;c=++a+b--; find c?

Ans.

Find the output of c=++a+b-- where a=5 and b=4.

  • The value of a is incremented by 1 before the addition operation

  • The value of b is decremented by 1 after the addition operation

  • The final value of c is 10

  • The value of a becomes 6 and the value of b becomes 3

Add your answer

Q10. What is static variable?

Ans.

A variable that is associated with a class rather than with instances of the class.

  • Static variables are declared using the static keyword.

  • They are initialized only once, at the start of the program execution.

  • They retain their value throughout the program's execution.

  • They can be accessed without creating an instance of the class.

  • Example: public static int count = 0;

Add your answer

Q11. What are member functions?

Ans.

Member functions are functions that are defined inside a class and can access the class's private and protected members.

  • Member functions are also known as methods.

  • They can be used to manipulate the data members of an object.

  • They can be overloaded, meaning multiple functions with the same name but different parameters can exist within a class.

  • They can be declared as const, meaning they do not modify the object's state.

  • Example: class Car { void start(); void stop(); };

  • Example: ...read more

Add your answer

Q12. What is a class?

Ans.

A class is a blueprint for creating objects that have similar attributes and behaviors.

  • Classes are used in object-oriented programming.

  • They define the properties and methods that objects of that class will have.

  • Objects are instances of a class.

  • Classes can inherit properties and methods from other classes.

  • Examples of classes include 'Person', 'Car', and 'Animal'.

Add your answer

Q13. What is an object?

Ans.

An object is a self-contained entity that contains data and behavior.

  • An object is an instance of a class.

  • It has attributes (data) and methods (behavior).

  • Objects can interact with each other through their methods.

  • Examples include a car object with attributes like color and model, and methods like start and stop.

  • Another example is a person object with attributes like name and age, and methods like walk and talk.

Add your answer

Q14. What are pointers?

Ans.

Pointers are variables that store memory addresses of other variables.

  • Pointers allow for dynamic memory allocation and manipulation.

  • They are commonly used in programming languages like C and C++.

  • Example: int *ptr; // declares a pointer to an integer variable

  • Example: ptr = # // assigns the memory address of num to ptr

  • Example: *ptr = 5; // assigns the value 5 to the variable pointed to by ptr

Add your answer

Q15. what are structures?

Ans.

Structures are arrangements of elements that form a framework or framework-like support.

  • Structures can be found in various fields such as engineering, architecture, and biology.

  • They can be made of different materials such as steel, wood, or bone.

  • Examples include bridges, buildings, and the skeletal system.

  • Structures can be designed to withstand different types of forces such as compression, tension, or bending.

Add your answer

Q16. What is union?

Ans.

A union is an organization formed by workers to protect their rights and interests in the workplace.

  • Unions negotiate with employers for better wages, benefits, and working conditions.

  • They also provide support and representation for workers in disputes with management.

  • Membership in a union is voluntary, but members pay dues to support the union's activities.

  • Unions can be industry-specific, such as the United Auto Workers, or general, such as the AFL-CIO.

  • Unions have played a si...read more

Add your answer

Q17. Exceptions handling in java?

Ans.

Exceptions handling is a mechanism to handle runtime errors in Java programs.

  • Exceptions are objects that are thrown at runtime when an error occurs

  • Java provides try-catch-finally blocks to handle exceptions

  • Checked exceptions must be handled or declared in the method signature

  • Unchecked exceptions can be handled or left unhandled

  • Custom exceptions can be created by extending the Exception class

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Consultant Interview Questions from Similar Companies

3.4
 • 78 Interview Questions
3.4
 • 45 Interview Questions
3.8
 • 38 Interview Questions
4.0
 • 19 Interview Questions
3.9
 • 12 Interview Questions
3.1
 • 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