Add office photos
Premium Employer

Juniper Networks

4.2
based on 410 Reviews
Video summary
Filter interviews by

10+ Knack Global Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Swap Adjacent Bit Pairs Problem Statement

Given an integer N, your task is to compute the number that results from swapping each even position bit of N's binary representation with its adjacent odd bit to the r...read more

Ans.

Swap each even position bit of an integer with its adjacent odd bit to the right in binary representation.

  • Iterate through the binary representation of the integer and swap adjacent bits at even positions with odd positions.

  • Convert the modified binary representation back to an integer to get the final result.

  • Handle edge cases like leading zeros in binary representation.

Add your answer

Q2. Level Order Traversal of Binary Tree

Given a Binary Tree of integers, your task is to return the level order traversal of the tree.

Input:

The first line contains an integer 'T' which denotes the number of test...read more
Ans.

Return the level order traversal of a Binary Tree of integers.

  • Perform a level order traversal using a queue data structure

  • Start by pushing the root node into the queue

  • Pop each node from the queue, print its value, and push its children into the queue

Add your answer
Q3. What are the various components of an IP packet header?
Ans.

Components of an IP packet header

  • Version

  • Header Length

  • Type of Service

  • Total Length

  • Identification

  • Flags

  • Fragment Offset

  • Time to Live

  • Protocol

  • Header Checksum

  • Source IP Address

  • Destination IP Address

  • Options

Add your answer
Q4. What are the various components of a TCP segment header?
Ans.

The TCP segment header consists of various components that help in the transmission of data over a network.

  • Source Port

  • Destination Port

  • Sequence Number

  • Acknowledgment Number

  • Data Offset

  • Reserved

  • Flags

  • Window Size

  • Checksum

  • Urgent Pointer

Add your answer
Discover Knack Global interview dos and don'ts from real experiences

Q5. how do you swap two particular bits of an integer program?

Ans.

Swapping two particular bits of an integer program.

  • Use bitwise operators to get the values of the two bits to be swapped

  • Use XOR operator to swap the bits

  • Shift the bits back to their original positions

  • Example: Swapping 2nd and 5th bits of 8 (1000) gives 32 (100000)

  • Example code: num ^= (1 << bit1) | (1 << bit2);

Add your answer
Q6. What is the difference between TCP and UDP?
Ans.

TCP is connection-oriented, reliable, and slower, while UDP is connectionless, unreliable, and faster.

  • TCP is connection-oriented, meaning it establishes a connection before sending data, while UDP is connectionless and does not establish a connection.

  • TCP is reliable as it ensures all data packets are received in order and retransmits any lost packets, while UDP does not guarantee delivery or order of packets.

  • TCP is slower than UDP due to the overhead of error-checking, flow c...read more

Add your answer
Are these interview questions helpful?

Q7. IP packet header and meaning of each field and usage of each field

Ans.

IP packet header fields and their usage

  • Version: indicates the IP version being used (IPv4 or IPv6)

  • Header Length: specifies the length of the IP header

  • Type of Service: used to prioritize packets

  • Total Length: specifies the total length of the IP packet

  • Identification: used to identify fragments of a larger packet

  • Flags: used to control fragmentation

  • Fragment Offset: used to reassemble fragmented packets

  • Time to Live: specifies the maximum number of hops a packet can take

  • Protocol: s...read more

Add your answer

Q8. TCP packet header and meaning of each field and usage of each field

Ans.

TCP packet header fields and their usage

  • TCP packet header consists of 20 bytes

  • Fields include source and destination ports, sequence and acknowledgement numbers, flags, window size, and checksum

  • Source and destination ports identify the endpoints of the connection

  • Sequence and acknowledgement numbers are used for reliable data transfer

  • Flags indicate the purpose of the packet, such as SYN, ACK, FIN, RST

  • Window size is used for flow control

  • Checksum is used for error detection

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

Q9. why security is important in a system?

Ans.

Security is important in a system to protect against unauthorized access, data breaches, and cyber attacks.

  • Prevents unauthorized access to sensitive data

  • Protects against data breaches and cyber attacks

  • Ensures confidentiality, integrity, and availability of data

  • Compliance with regulations and standards

  • Maintains trust and confidence of customers and stakeholders

Add your answer

Q10. Telephone directory implementation program

Ans.

Implement a telephone directory program using an array of strings.

  • Create an array of strings to store the directory

  • Implement functions to add, delete, and search for entries

  • Consider using a hash table for faster search times

  • Include error handling for invalid input

Add your answer

Q11. level printing of a tree program

Ans.

Printing a tree in level order

  • Use a queue to store nodes in level order

  • Enqueue root node and print its value

  • Dequeue the node and enqueue its children

  • Repeat until queue is empty

Add your answer

Q12. Dictionary implementation program

Ans.

A program to implement a dictionary using an array of strings.

  • Use an array of strings to store the words and their definitions.

  • Implement functions to add, delete, and search for words.

  • Consider using a hash table for faster search times.

Add your answer

Q13. tcp Vs udp

Ans.

TCP is a reliable, connection-oriented protocol while UDP is a faster, unreliable, connectionless protocol.

  • TCP ensures data delivery and error checking while UDP does not.

  • TCP establishes a connection before data transfer while UDP does not.

  • TCP is used for applications that require reliable data transfer like email, file transfer, etc. while UDP is used for applications that require speed like online gaming, video streaming, etc.

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

Interview Process at Knack Global

based on 1 interviews
Interview experience
5.0
Excellent
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Staff Engineer Interview Questions from Similar Companies

4.0
 • 18 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