FICO
20+ Dozco Interview Questions and Answers
Q1. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Q2. Sort array containing 0s, 1s and 2s
Sort an array of 0s, 1s, and 2s in linear time complexity.
Use three pointers to keep track of the positions of 0s, 1s, and 2s.
Traverse the array and swap elements to their respective positions.
Time complexity: O(n), Space complexity: O(1).
Q3. What is polymorphism and its types. Explain concept of stack using queues
Polymorphism is the ability of a single function or method to operate on different data types. Types include compile-time and runtime polymorphism.
Polymorphism allows a single function to work with different data types.
Compile-time polymorphism is achieved through method overloading.
Runtime polymorphism is achieved through method overriding.
Example: Overloading a method with different parameter types.
Example: Overriding a method in a subclass to provide specific implementatio...read more
Q4. Why is string immutable in java?
String is immutable in Java to ensure security, thread safety, and optimization.
Immutable strings are thread-safe as they cannot be modified concurrently by multiple threads.
String pooling allows Java to optimize memory usage by reusing common string literals.
Immutable strings prevent security vulnerabilities like SQL injection attacks.
Q5. Explain me how would you handle a ddos attack on an apache server in AWS?
I would mitigate a DDoS attack on an Apache server in AWS by implementing various security measures and utilizing AWS services.
Implementing rate limiting and access control lists to filter out malicious traffic
Utilizing AWS Shield for DDoS protection
Scaling up the server capacity to handle the increased traffic
Monitoring server logs and traffic patterns to identify and block suspicious activity
Utilizing AWS WAF (Web Application Firewall) to filter out malicious requests
Q6. Abstract class vs interface
Abstract class is a class that cannot be instantiated, while an interface is a contract that a class must implement.
Abstract classes can have implemented methods, while interfaces cannot
A class can implement multiple interfaces, but can only inherit from one abstract class
Interfaces are used for achieving multiple inheritance in Java
Abstract classes are used for creating a base class for other classes to inherit from
Example of abstract class: public abstract class Animal { pu...read more
Q7. How would you manage the fast pace and dynamic 24*7 environment
I would manage the fast pace and dynamic 24*7 environment by prioritizing tasks, staying organized, and effectively communicating with team members.
Prioritize tasks based on urgency and impact on security
Stay organized by using tools like task management software and creating a schedule
Communicate effectively with team members to ensure everyone is on the same page and can quickly address any security incidents
Be adaptable and able to quickly respond to changing situations
Q8. How to improve the performance of the web application & how to identify & resolve memory leaks
To improve web application performance, optimize code, use caching, minimize network requests. To identify memory leaks, use profiling tools, monitor memory usage.
Optimize code by reducing unnecessary loops, improving algorithms
Use caching to store frequently accessed data and reduce database calls
Minimize network requests by combining multiple requests into one
Use profiling tools like Chrome DevTools or VisualVM to identify memory leaks
Monitor memory usage over time to detec...read more
Q9. Spiral order traversal of BST.
Spiral order traversal of BST
Use two stacks to traverse the tree in a spiral order
Push the root node into the first stack
While the first stack is not empty, pop a node and print its value
Push its left and right children into the second stack
Once the first stack is empty, swap the stacks and repeat the process
Continue until both stacks are empty
Q10. How to resolve CORS issue between microservices and microfrontend
To resolve CORS issue between microservices and microfrontend, configure CORS headers and use a proxy server.
Configure CORS headers on microservices to allow requests from microfrontend domain
Use a proxy server to route requests from microfrontend to microservices
Implement a reverse proxy like Nginx or Apache to handle CORS headers
Q11. Palindrome string by all Efficient methods
A palindrome string is a string that reads the same backward as forward. Efficient methods include using two pointers and reversing the string.
Use two pointers, one starting from the beginning and the other from the end, and compare the characters at each position until they meet in the middle.
Reverse the string and compare it to the original string. If they are the same, it is a palindrome.
Use recursion to check if the first and last characters are the same, and then check t...read more
Q12. Hashmap vs hashset
Hashmap is a key-value pair data structure while Hashset is a set of unique values.
Hashmap allows duplicate values but not duplicate keys.
Hashset does not allow duplicate values.
Hashmap is implemented using a combination of hash table and linked list.
Hashset is implemented using only a hash table.
Example of Hashmap: {1:'one', 2:'two', 3:'three'}
Example of Hashset: {'apple', 'banana', 'orange'}
Q13. How would you triage a security incident?
Triage a security incident by assessing severity, containing the threat, and investigating the root cause.
Assess the severity of the incident based on impact and likelihood of exploitation.
Contain the threat by isolating affected systems, changing credentials, or blocking malicious traffic.
Investigate the root cause by analyzing logs, conducting forensics, and identifying vulnerabilities.
Prioritize response actions based on criticality and potential impact on the organization...read more
Q14. Arraylist vs hashmap
ArrayList is a resizable array while HashMap is a key-value pair data structure.
ArrayList is ordered and allows duplicates while HashMap is unordered and does not allow duplicate keys.
ArrayList is accessed by index while HashMap is accessed by key.
ArrayList is suitable for storing and accessing elements sequentially while HashMap is suitable for fast lookup of values by key.
Example: ArrayList - List
names = new ArrayList<>(); names.add("John"); names.add("Jane"); Example: Hash...read more
Q15. What is the difference between var let and const
var, let, and const are all used for variable declaration in JavaScript, but they have different scopes and mutability.
var is function-scoped and can be redeclared and reassigned
let is block-scoped and can be reassigned but not redeclared
const is block-scoped and cannot be reassigned or redeclared
Q16. what is a red black tree
A red-black tree is a self-balancing binary search tree with additional properties to ensure balance and efficient operations.
Red-black trees have nodes colored red or black, with rules to maintain balance during insertion and deletion.
Each node has an extra bit for color, and the tree must satisfy properties like no two red nodes in a row.
Operations like insertion and deletion involve rotations and color changes to maintain balance.
Red-black trees are commonly used in data s...read more
Q17. Is JS singlethreaded or multithreaded
JS is singlethreaded
JavaScript is singlethreaded, meaning it can only execute one piece of code at a time
This is because of the event loop in JavaScript which manages the execution of code
However, JavaScript can still handle asynchronous operations using callbacks, promises, and async/await
Q18. Binary Search on Linked List
Binary search on a linked list involves dividing the list into halves and searching for the target value.
Linked list must be sorted before binary search can be performed.
Binary search on linked list has a time complexity of O(log n).
The middle element of the linked list is found using slow and fast pointers.
If the target value is less than the middle element, search the left half of the list. If it's greater, search the right half.
Repeat until the target value is found or the...read more
Q19. What is functional programming
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing state and mutable data.
Focuses on pure functions that do not have side effects
Avoids mutable data and state changes
Uses higher-order functions and function composition
Supports recursion and immutability
Examples include languages like Haskell, Scala, and Clojure
Q20. How to create graph
To create a graph, you can use software tools like Microsoft Excel, Google Sheets, or programming languages like Python with libraries such as Matplotlib or Seaborn.
Use software tools like Microsoft Excel or Google Sheets to input data and create a graph visually.
For more customization and automation, use programming languages like Python with libraries such as Matplotlib or Seaborn.
Specify the type of graph (e.g. bar graph, line graph, pie chart) and input the data points ac...read more
Q21. difference between let ,var,const
let, var, and const are all used to declare variables in JavaScript, but they have different scopes and behaviors.
let: block-scoped variable, can be reassigned
var: function-scoped variable, can be reassigned
const: block-scoped variable, cannot be reassigned, but its properties can be modified
Q22. Intersection of linked list
Intersection of linked list is finding the common node where two linked lists meet.
Traverse both linked lists and find the lengths
Align the longer list's head to match the length of the shorter list
Iterate through both lists and compare nodes to find intersection
Q23. what is main method
Main method is the entry point of a Java program where the execution begins.
Main method must be declared as public, static, and void.
It must accept an array of strings as arguments.
It is the method where the program starts execution.
Q24. What is javascript
JavaScript is a programming language commonly used for creating interactive effects within web browsers.
JavaScript is a high-level, interpreted programming language.
It is primarily used for enhancing user interfaces and adding dynamic functionality to websites.
JavaScript can be embedded directly into HTML pages or included as external scripts.
Common use cases include form validation, interactive maps, and animations.
Popular JavaScript libraries/frameworks include jQuery, Reac...read more
Q25. Hashmap working
Hashmap is a data structure that stores key-value pairs and allows for fast retrieval of values based on keys.
Hashmap uses a hashing function to map keys to indices in an array.
It allows for constant time complexity O(1) for insertion, deletion, and retrieval operations.
In Java, HashMap is a commonly used implementation of the Map interface.
Q26. Design an elevator system
Design an elevator system for efficient and safe transportation of people between floors
Consider the number of floors in the building and the traffic flow during peak hours
Implement algorithms for efficient elevator scheduling to minimize wait times
Include safety features such as emergency stop buttons and sensors to prevent accidents
Design user-friendly interfaces for passengers to select their desired floors
Consider implementing destination dispatch system for improved effi...read more
Interview Process at Dozco
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month