Juniper Networks
10+ Interview Questions and Answers
Write a program to generate the reverse of a given number N. Print the corresponding reverse number.
Note : If a number has trailing zeros, then its reverse will not include them. For e.g., reve...read more
You are given a Singly Linked List of integers. You need to reverse the Linked List by changing the links between nodes.
Input Format :
The first line of input contains a single integer T, ...read more
What's the difference in C++ between "new int[5]" and "malloc(5 * sizeof(int))"?
Q4. What is the difference between into arr [5] and malloc (5*sizeof (int))
The difference is that 'int arr[5]' creates an array on the stack, while 'malloc(5*sizeof(int))' allocates memory on the heap.
int arr[5] creates an array of 5 integers on the stack, which is a fixed-size memory allocation.
malloc(5*sizeof(int)) dynamically allocates memory on the heap, allowing for variable-size memory allocation.
The memory allocated with malloc must be explicitly freed with free() to avoid memory leaks.
Q5. Explain me about all the data structures you know, tell me their advantages over others and applications
Data structures are fundamental concepts in software engineering that organize and store data efficiently.
Arrays: Simple and efficient for storing and accessing elements.
Linked Lists: Dynamic and flexible, efficient for insertion and deletion.
Stacks: LIFO structure, useful for managing function calls and undo operations.
Queues: FIFO structure, ideal for managing tasks and scheduling.
Trees: Hierarchical structure, used for organizing data like file systems or search algorithms...read more
Q6. Reverse a linked list without using extra memory
Reverse a linked list without using extra memory
Iterate through the linked list and change the next pointers to reverse the list
Use three pointers - prev, current, and next - to keep track of the reversed list
Start with prev and current pointing to null and the head of the linked list respectively
While traversing the list, update the next pointer of the current node to point to the previous node
Move prev and current pointers one step forward
Repeat until the end of the list is...read more
Q7. give the elements of an array that sum up to given number.
Find elements in array that sum up to given number
Use a nested loop to iterate through each pair of elements in the array
Check if the sum of the pair equals the given number
Return the pair of elements if found, otherwise continue iterating
Q8. Write a program to reverse a n integer
Program to reverse an integer
Convert the integer to a string
Reverse the string
Convert the reversed string back to an integer
Q9. Explain which are IPC mechanism
IPC mechanisms are used for inter-process communication in software development.
IPC mechanisms allow processes to communicate with each other, either on the same machine or across a network.
Common IPC mechanisms include pipes, message queues, shared memory, sockets, and signals.
Examples of IPC mechanisms include using sockets for network communication between client and server applications, or using shared memory for communication between processes on the same machine.
Q10. Explain the Socket communication
Socket communication is a method of communication between two processes on a network using sockets.
Socket communication involves a client and a server communicating over a network.
It uses TCP or UDP protocols to establish a connection.
Data is exchanged through sockets using read and write operations.
Sockets can be used for various applications like web browsing, email, and file transfer.
Q11. I2c Spi protocol implementation
I2C and SPI are serial communication protocols used for connecting microcontrollers to peripherals.
I2C (Inter-Integrated Circuit) is a synchronous, multi-master, multi-slave, packet-switched protocol commonly used for communication between integrated circuits.
SPI (Serial Peripheral Interface) is a synchronous, full-duplex, master-slave communication protocol commonly used for communication between microcontrollers and peripheral devices.
I2C uses two wires (SDA and SCL) for co...read more
Q12. DSA - One problem on shopping cart
Implement a shopping cart system using data structures and algorithms.
Use a data structure like a hash map to store items and their quantities in the cart.
Implement functions to add, remove, and update items in the cart.
Consider implementing functions to calculate total price, apply discounts, and handle checkout process.
Q13. Binary search using recursion.
Binary search is a search algorithm that finds the position of a target value within a sorted array.
Divide the array into two halves and compare the target value with the middle element.
If the target value is equal to the middle element, return the index.
If the target value is less than the middle element, recursively search the left half.
If the target value is greater than the middle element, recursively search the right half.
Q14. Create your own hashmap
Implement a custom hashmap in Java
Create a class to represent the hashmap
Use an array to store the key-value pairs
Implement methods for put, get, and remove operations
Q15. Subarray Sum divisible by K
Find the number of subarrays whose sum is divisible by K.
Use prefix sum technique to calculate the sum of subarrays efficiently.
Keep track of the remainders of prefix sums when divided by K.
Use a hashmap to store the count of each remainder.
For each prefix sum, check how many previous prefix sums have the same remainder.
Add the count of subarrays with the same remainder to the total count.
Q16. Arrays from neetcode
Arrays are a collection of strings in programming used to store multiple values under a single variable name.
Arrays are declared using square brackets []
Each element in an array is accessed by its index, starting from 0
Example: var fruits = ['apple', 'banana', 'orange']
Q17. Trees in neet code
Trees in neet code refer to the implementation of tree data structures in coding challenges on the platform NeetCode.
Trees are a common data structure used in coding challenges to represent hierarchical relationships between data.
Common tree operations include traversal (inorder, preorder, postorder), insertion, deletion, and searching.
Examples of tree-related coding challenges on NeetCode include implementing a binary search tree, finding the lowest common ancestor of two no...read more
Q18. Trees in leet code
Trees in leetcode are a common topic for coding interviews, involving various tree traversal and manipulation techniques.
Understand different tree traversal methods like inorder, preorder, and postorder.
Learn about common tree algorithms like finding the height, diameter, and lowest common ancestor.
Practice solving tree-related problems on leetcode to improve your skills.
More about working at Juniper Networks
Interview Process at null
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month