100% found this document useful (1 vote)
14K views34 pages

Primer Main 2

For a modular software design, the ideal combination is high cohesion and low coupling (option b). A logically cohesive module should implement activities from within the module itself (option d is true). A while loop is used when the exact number of code executions is unknown (option b).

Uploaded by

Yashika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
14K views34 pages

Primer Main 2

For a modular software design, the ideal combination is high cohesion and low coupling (option b). A logically cohesive module should implement activities from within the module itself (option d is true). A while loop is used when the exact number of code executions is unknown (option b).

Uploaded by

Yashika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

PRIMMER DUMP

1. If you are asked to do a modular software design, which combination of coupling and cohesions
should you use for designing the software?

a. High cohesion and high coupling

b. High cohesion and low coupling

c. Low cohesion and high coupling

d. Low cohesion and low coupling

2. Statement: For a logically cohesive module, there are some activities to be implemented. These
activities are preferred from inside the module itself. Is the above given statement true? If not,
choose the correct option to make it true.

a. The activities are selected from outside the module.

b. The activities are selected in a random manner.

c. The activities are selected in a sorted manner.

d. The given statement is true.

3. What kind of controlled structure is used when we don’t know the exact number of times a
code needs to be executed?

a. switch

b. while

c. for

d. if-else

4. Which of the given statements is true about XP?

a. XP narrows down towards a single project developed and numbered by a single team.

b. XP will not work in environment where the manager insists on complete documentation before
the team begins to code

c. XP will work in the environment where programmers are separated geographically.

d. XP is best suited to work with systems that have scalability issues.


5. testing is done by client in the real world environment.

a. Alpha

b. beta

c. system

d. gamma

6. Which two phases of feature driven development are repeated until no more feature exist?

a. Develop an overall model


b. Plan by feature
c. Design by feature
d. Build a feature list
e. Build by feature
a. b and c
b. c and e
c. b and e
d. d and b

7. Predict the output

What will be the output for the given code snippet

startprogram

public class Main {

public static void main(String[] args) {

try {

System.out.println(4/0);

try{

Int[] a={1,2,3};

System.out.println(a[3]);

} catch(ArrayIndexOutOfBoundsException e) {

System.out.println(“Out of bounds”);

}catch(ArthmeticException e){

System.out.println(“ArithmaticException : divide by 0”);

endprogram
a. out of bounds ArithmaticException : divide by 0

b. runtime error

c. out of bounds

d. ArithmaticException: divide by 0

8. Which of the following declarations will cause a compile time error?

a. int[] scores = null;

b. int[] scores =new int[5];

c. String[] nameArray = new String[10];

d. String[] nameArray = (5,3,2);

9. Arrow symbols in the flowchart is used to show the sequence of steps and the relationship
among them. State true and false

a. True

b. False

10. Information hiding is achieved through which OOP principle?

a. Inheritance

b. Encapsulation

c. Typing

d. Hierarchy

11. In multibranch, the pipeline names should not contain .

a. spaces

b. special characters

c. numerics

d. variables

12. Which are the phases of CI/CD pipeline?

a. Source

b. Operate

c. Monitor

d. Deploy
13. is a conceptual framework where software is developed is iterations

a. Agile

b. prototyping

c. extreme programming

d. DSDM

14. Predict the output of the following statement. Select substr(“Yellow is A colour”,1,5) from
dual;

a. Yellow

b. Yel

c. Yello

d. elow

15. column header is referred as

a. domain

b. attribute

c. table

d. tuples

16. At which level of testing the non-functional requirements are tested?

a. Unit testing

b. system testing

c. Integration testing

d. Acceptance testing

17. Agile methodology does not accepts change of requirements at any stage

a. false

b. true

18. In a relational database a referential integrity constraint can be done using

a. primary key

b. foreign key

c. secondary key
d. compose key
19. Which of the given options are true with respect to arrays?

a. Array size is fixed

b. The element of an array can be accessed using index.

c. Array element can be sorted by decreasing order

d. Negative values cannot be placed in an array.

20. Name the type of join used to include rows that do not have matching values

a. Cartesian product

b. inner join

c. non equi-join

d. outer join

21. Expand DSDM

a. Dynamic System Development Method

b. Dynamic State Development Method

c. Dynamic System Design Method

d. Data System Development Method

22. A primary key can have null values. State True and False.

a. True

b. False

23. Meta data is declared as in SQL?

a. Data Dictionary

b. Meta Dictionary

c. Meta Information

d. Data Information

24. Which of the following is true about Continuous Integration?

a. It is performed immediately after the developers check-in.

b. Development team sends continuous code merging requests even when the testing process is
running

c. It emphasis on the change in all stages of your production pipeline


d. It is an approach of testing each code to codebase automatically.
25. The practice of automatically provisioning a new environment at the time of deployment is
referred to as

a. Continuous Integration

b. Continuous Development

c. Infrastructure-as-Code

d. Configuration Management

26. Scrum divides the development into short cycles called .

a. Sprints

b. Tracks

c. Lanes

d. Spirals

26. Which of the following is a correct declaration in java?

a. char[] Tic = new char();

b. char[] Tic = new char[19];

c. char[] Tic = new char(14);

d. char[] Tic = new char[];

27. Raghav has developed an application to automate the billing process of the Aarvee
Departmental Store. When the product is in operation, the client found that the place of the phone
number, it prints the Customer ID. So he approaches Raghav to fix the issue. What type of
Maintenance does the above scenario depict?

a. Corrective

b. Adaptive

c. Predictive

d. Preventive

28. Consider the scenario: You have written a code to display a menu on the screen and some
operation are preformed based on the given user input. Which control structure would you use, so
that the menu is guaranteed to show/display at least once on the screen, before performing the
operation.

a. for loop

b. While loop

c. Do-While loop
d. Case
29. Predict the output for the given pseudo code snippet. SET count = 1

While count less than or equal to 5

Print “Hello, world”

Count = count + 1

END WHILE

a. Prints” Hello, world” 5 times

b. Prints “Hello, world” 6 times

c. loop goes on infinitely

d. Prints “Hello, world” 4 times

30. Pinky and Raju are working on an insurance project. They are not aware of SVN. So they created
a common project on the server. Both retrieved the project from the server. They made relevant
changes to the life. First Raju saved the changes to the server. Next Pinky saved her project identify
which of the given statements are true.

a. Both their changes get updated on the server.


b. Pinky’s changes alone are stored and when Raju tries the upload, the server notifies the
differences.

c. Both Pinky and Raju’s changes get rolled back.

d. Pinky’s project over writes the changes done by Raju.

31. Statement: For a logically cohesive module, there are some activities to be implemented. These
activities are preferred from inside the module itself.

Is the above given Statement true? If not, choose the correct option to make it true.

a. The activities are selected from outside the module.

b. The activities are selected in a random manner.

c. The activities are selected in a sorted manner.

d. The given statement is true.

32. does the special group or group 0 is included while coupling groups using the groupCount in
java.

a. True

b. False
33. Many are delivered in an agile process.

a. Builds

b. Software

c. Programs

d. Tests

34. Predict the output

startprogram

class Product

String productName;

class Mobile extends Product

String mobileName;

void display()

super.productName = mobileName + “Brand New !”;

System.out.println(mobileName +” “ + productName);

}
}
class Main

public Static void main(String args[])

Mobile obj = new Mobile();

obj.productName=”1”;

obj.mobileName=”2”;

obj.display();

endprogram
a. 2 2Brand New !
b. 1 2Brand New !
c. 1 1Brand New !
d. Brand New !

35. Predict the output

import java.util.Scanner;

class WeightLimitExceeded extends Exception {

WeightLimitExceeded(int x) {

System.out.print(Math.abs(15-x) + "kg: ");

public class Main{

void validWeight(int weight) throws WeightLimitExceeded {

if(weight > 15)

throw new WeightLimitExceeded(weight);

else

System.out.println("You are ready to fly!");

public static void main(String[] args)

Main ob = new Main();

Scanner in=new Scanner(System.in);

for(int i=0;i<2;i++) {

try {

ob.validWeight(in.nextInt());

catch(WeightLimitExceeded e)

System.out.println(e);

}
}

What will be the output for the given code snippet

a. 5kg : WeightLimitExceeded

You are ready to fly!

b. NumberFormatException

c. 5kg :

You are ready to fly!

d. Cannot find symbol Math.abs

36. Predict the output

What will be the output for the given code snippet

Startprogram

Public class Main{

public static void main(String args[])

try {

System.out.println(4 / 0);

try {

int[] a = {1,2,3};

System.out.println(a[3]);

} catch(ArrayIndexOutOfBoundsException e){

System.out.println(“Out of bounds”);

} catch (AritjmeticException e) {

System.out.println(“AritjmeticException : divide by 0”);

endprogram

a. Out of bounds AritjmeticException : divide by 0

b. Runtime error

c. Out of bounds

d. AritjmeticException : divide by 0
37. Predict the output

What will be the output for the given code snippet

startprogram

Public class Main{

public static void main(String args[])

int a =10;

for(int i=3;1>=0;1++)

try{

System.out.println(a / i);

System.out.println(“End of try”);

catch(ArithmaticException e) {

System.out.println(e);

endprogram

a. 3
5
10
Java.lang.ArithmeticException: / by zero
b. 3
End of try
5
End of try
10
End of try
Java.lang.ArithmeticException: / by zero

c. Compiletimeerror

d.runtimeerror

38. Predict the output

What will be the output for the given code snippet

Startprogram

Import java.util.regex;

Public class Main{


public static void main(String args[])
{

String s=”ABC”;

Pattern p=Pattern.compile(s);

String r=”ABCABCABCABC”;

Matcher m=p.matcher(r);
System.out.println(m.lookingAt());

endprogram

a. true

b. false

c. ABC

d. 0

39. Predict the output

What will be the output for the given code snippet

startprogram

Import java.util.regex;

Public class Main{

public static void main(String args[])

Pattern p=Pattern.compile(“\\d”);

String test=”India123”;

Matcher m=p.matcher(test);

If(m!null)

{
System.out.println(m.find());

System.out.println(m.matches());

endprogram

a. true
true

b. false

true

c. true

false

d. false

false

40. Predict the output

What will be the output for the given code snippet

startprogram

Public class Main{

public static void main(String args[])

int arr[] = new int[] {0,1,2,3,4,5,6,7,8,9};

int n=6;

n = arr[arr[n] / 2];

System.out.println(arr[n] / 2);

endprogram

a. 2

b. 1

c. 6

d. 0

41. Predict the output

public class Main{

public static void main(String args[])

int[]m = new int[13];

System.out.println("m[0] is " +m[0]);

}
}

(a.) Program has a compiler error

(b.) Program has a compiler error

(c.) The program runs fine and displays m[0] is 0.

(d.) None

42. Predict the output

import java.util.regex.*;

public class Hello {

public static void main(String args[])

String s="REGULAREXPRESSION";

String r="";

s=s.replaceAll(r,",");

System.out.println(s);

(a.) ,R,E,G,U,L,A,R,E,X,P,R,E,S,S,I,O,N,

(b.) REGULAREXPRESSION

(c.) None
(d.) All

43. Predict the output

import java.util.Scanner;

public class Main {

static void func(int a,int b) throws ArithmeticException, ArrayIndexOutOfBoundsException

System.out.println(10/a);

int[] arr={1,2,3};

System.out.println(arr[b]);

public static void main(String[] args)

{
Scanner in=new Scanner(System.in);

for(int i=0;i<3;i++)

try{

func(in.nextInt(),in.nextInt());

catch(ArithmeticException e){

System.out.println("can't divide by zero");

}
catch(ArrayIndexOutOfBoundsException e)

System.out.println("Out of bounds");

a) 5

can't divide by zero

out of bounds
b) 5

can't divide by zero

out of bounds
c) Compile TimeError

d) Results in recursion

44. Which plugin are the appropriate functionality plugins used in multibranch pipelines for
validating the pull or change requests. (Select any two)

*) GitHub Branch Source


*) GitHub Main Source
*) Bitbucket Branch Source

*) Bitbucket Main Source

45. In code phase, requirements and feedback are gathered from customers and stakeholders.

a) True

b) False

46. Agile is useful when the client requirements are not clear or requirement frequently changes.

a) True

b) False

47. Many are delivered in an agile process

a) Builds

b) Softwares

c) Programs

d) Tests

48. Assume we have created a table employees with the columns: employee_id, employee_name,
salary, designation and manager_id. Here employee_id is set as primary key and manager_id is a
foreign key which refers to employee_id in the employees. Manju wants to display the employee
details along with the manager id and manager name. Select which query suits the above
requirement.

a) select employee_id, employee_name, salary, employee_id "Mgr-id", employee_name "Mgr-


name" FROM employees;

b) select e.employee_id, e.employee_name, e.salary, m.employee_id "Mgr-id", m.employee_name


"Mgr-name" FROM employees e, employees m Where e.manager_id = m.manager_id;

c) select e.employee_id, e.employee_name, e.salary, m.employee_id "Mgr-id", m.employee_name


"Mgr-name" FROM employees e, employees m Where e.manager_id = m.employee_id;

d) select e.employee_id, e.employee_name, e.salary, m.manager_id "Mgr-id", m.employee_name


"Mgr-name" FROM employees e, employees m Where e.manager_id = m.employee_id;

49. Predict the output

What will be the output for the given code snippet

startprogram

import java.util.Scanner;

public class Main{


public static void throwit(){

System.out.println("throwit");

throw new RunTimeException();

public static void main(String[] args){

try{

System.out.println("Hello");

throwit();

}catch(Exception re){

System.out.println("Caught");

}finally{

System.out.println("Finally");

System.out.println("After");

a) Hello

throwit

Caught

Finally

After

b) Finally

After

c) CompileTimeError

d) throwit

Caught

After

Finally

mock
50) which file contains field value pair where can be strig, integer,float or Boolean
Ans: YAML

51) continuous delivery pipeline is a process which involves building the software in reliable and
repeatable manner.
ANS: TRUE

52) Predict the output of the program.

startprogram

public class Program { public static void main(String args[]) {

String input="Programming"; char c=input.charAt(11);

System.out.println(c);
}
}

endprogram
ANS: RUN TIME ERROR

53) Predict the output of the program. startprogram

class X

public void callinta) ( System.out.printinca 100)

public void call double d) { System.out.println(d/2)

public class demo (

public static void main(String[] args) { new X().ca(100.0)

endprogram
ANS: 50.0

54) Which is not a role in dsdm


Ans: ACCOUNTANT

SAP
1) Classification attributes data is saved in the same table as data modeling attribute Ans: FALSE
2) How many extension are generated for 'ant extgen' command

Ans: 1

3) Which of the following congiguration overrides all other properties?

Ans: Config/local.properties

4) Syncronization is done between

Ans: catalog version

5) Deployement tag is always required for many-to-many relationship

Ans: True

6) The list of extensions included in the ant build defined in

Ans: config/localextensions.xml

7) Dynamic attributes are to be stored in database

Ans: false

8) ImpEx uses files of type

Ans: .csv

9) Which of the following steps needs to be executed to generate java model classes after adding new
'itemtype' in <extension>-items.xml

Ans: Ant all

10) A page can be created without content catalog version

Ans: False

11) Which of the following Statments is true regarding the use of inheritence in the hybris itemType
defination

Ans: if you specify a deplyoment for your type,you will get one table which contains all of the
attributes from your type and its ancestors

12) Why do you need to execute.......

Ans: to configure ANT_HOME


13) Which of the following statement is false

Ans: Models are live representation of data from database

14) Given items.xml type

1. itemtypes
2.enumtype
3.relationships
4.atomictypes
5.maptype
6.collections
Please identify the correct order in <extension>-items.xml
Ans: 4,6,2,5,3,1

15) Given enumtype

<enumtype generate="true" code="ColorEnum" autocreate="true" dynamic="true"


<value code = "BLUE" />
<value code = "GREEN" />
<value code = "ORANGE" />
<value code = "RED" />
<value code = "YELLOW" />
</enumtype>
How to use this type while defining an attribute.....
Ans: < attribute qualifier=”color” type=”colorEnum”>
<modifiers optional =”false”/>
<persistence type =”property”/>
<attribute>

16) Given many-to-many relationship b/w 'Book' and 'Author' item type which of the following code
successfully defines the relationship

Ans: <relation code=”book2AuthorRelation” generate =”True” localized =”false”>


<deployment table= “BookAuthor” typecode =”12345”/
<sourceElement type = “book” qualifier=”boks” cardinality =”many”/>
<targetElement type =”User” qualifier=”authors “ cardinally=”many”/>
</relation>

Or
<relation code=”book2AuthorRelation” generate =”True”
localized =”false”>
<deployment table= “BookAuthor” typecode =”10001”/
<sourceElement type = “book” qualifier=”books”
cardinality =”many”/>
<targetElement type =”User” qualifier=”authors “
cardinally=”many”/>
</relation>

17) How to activate backoffice application.....

Ans: press F4

18) We can initialize Hybris System using backoffice

Ans: False

19) What is the default database used in SAP Hybris Commerece?

Ans: HsqlDB

20) <col Style="width:276pt;"width="368">

Given the data modeling snippet

<itemtype code="Training" extends="Product" generate=" "


autocreate=" "

....
</itemType/>
Considering above item is being created for the first time fill up the blanks with appropriate options.
Ans: true true

21) What is Apache Tomcat

Ans: Web Server

22) Which of the following is configuration file of Maven

Ans: Pom.xml
23) Which of the following declaration would get Compilation Error

Ans: List <String> List=newList<>();

24) Which Object is used to Create Session object in hibernate

Ans: SESSION FACTORY

25) Which tag is used for setter injection in the bean configuration file

Ans: Property

26) Which of the following implementation class is known for removing duplicates from given
Collection

Ans: HashSet<E>

27) A bean is Spring Container by default shows which behavior?

Ans: Eager Loading

28) How to <ref> in Spring framework

Ans: <ref> is use with bean id


29) Which of the following is configuration file in hibernate
Ans: hibernate-cfg.xml

30) Which of the following annotation does not ensure a bean would be created in spring
container

Ans: @Autowired
31) @Autowired annotation ensure that a bean would be created in the spring Container

Ans: False

32) In the JSP which of the following attribute can be used in form tag to bind a model class and
form?

Ans: Model attributes

33) Class Current Account is derived from the below Account class
Which of the following is the correct Syntax for Current Account Constructor?

Public class Account

int acc No;

double balance;

public Account (int accNo, double balance);

Super();

this. accNo=accNo;

This balance=balance;

Ans: Public Current Account (int accNo, double balance ) {

Super ( acc No, balance);

}
34) Which Amongst the following is not avalid @Autowired Usage?

Ans: @service

Class AccountService|
}

@service

Class employeeservice {

AccountService AccountService;

@autowired

EmployeService(){

@Autowired

EmployeeServiceservice(AccountService accountService){

This.accountService=accountService

35) Class Minimum Balance Exception extends exception { }


Which type of Exception is Minimum Balance Exception class?

Ans: UNCHECKED Exception

36) Which is the correct Syntax for annotation Wiring

Ans: <Context : annotation – config/> to bean configuration

37) Find import statements are from Java Persistence package


@Entity

@Table (name= “Employetable”)

Public class Employee {

@ id

@Generaled value (Strategy = Generation Type. IDENTITY)

@Column (name= “Employee id”)

Private int empid;

@Column(name=”employeeFirstName”)
Private String firstName;

Which of the following is true regarding corresponding table in database as aresult of above
mapping?
Ans: The table name would be Employeetable and column names would be employeid and
empid would be the primary key of the table

38) Class Employee {


}

Class Manager extends Employee{

Which of the following statements is valid?

Ans: MANAGER IS A EMPLOYEE

39) Give following servlet mapping in web.xml

<servlet>

<servlet-name>test</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>test</servlet-name>

<url-pattern>/</url-pattern>

</servlet-mapping>

Which of the following file would be loaded by default?


Ans: test-servlets.xml

40) Class Account {


Private int accounted;

//getters and setters for properties

Class Employee {

Private int empid;


Private Account account;

//getters and setters for properties

//default constructor

//paramterized constructor

Which amongst the following is correct bean definition?

Ans: <beanid=”account”class=”Account”>
<propertyname=”account”value=123”/>
</bean>
<beanid=”employee”class=”Employee”>
<property name=”empid”value=”10001”/>
<property name=”account”ref=”account/”>
</bean>

<bean class=”Account”id=”account”><property name=”accounted”value=”123”></property


<bean class=”Employee”id=”employee”><property name=”empid”value=”10001”>
Name=”account”ref=”account></property></property></bean>

Mock questions :

Mock -1
1) A bean can be created any number of times in which scope?
Ans) prototype
2) which annotation is used to mark a coulomn as aprimary key while doing hibernate mapping?
Ans) @Id
3) A bean in spring container, by default , shows behavior?
Ans) Eager loading
4) annotations work as metadata for classes and spring uses annotations as an alternative to XML for
declarative configuration. Is it true or false ?
Ans) true
5) what is bean in spring ?
Ans) object
6) which attribute is used to specify classname of the bean ?
Ans) class
7) which of the following statements is false?
Ans) throws keyword is used to explicity raise an exception
8)which property is used in hibernate to configure driver class?
Ans) hibernate.connection.driver_class
9) which of the following relationship is depicted by inheritance ?
Ans) Is-A
10) which annotation can be used to make a DAO class method transactional?
Ans) @transactional

Mock-2

1) which of the following cannot be specified for <persisitance type=” “/>


Ans) attribute
2) impex uses files of type
Ans) .CSV
3) deployment tag is always required for one to many relationship
Ans) false
4) which of the following configuration overrides all other properties?
Ans) Config/local.properties
5) synchronization is done between
Ans) catalog version
6) <cool style=”width: 236pt;”width=”314”>
Which of the following is not generated after ‘ant modulegen’ command using default template ?
Ans) <extension>payment
7) a page can be created without content catalog version.
Ans) false
8) how many extensions are generated for ‘ant extgen’ command ?
Ans) 1
9) how is catalog and catalogversion related ?
Ans) one catalog can have many catalogVersion
10)which of the following statement is false?
Ans) models are live representation of data from the database

You might also like