Netcracker Technology
Codelogicx Technologies Interview Questions and Answers
Q1. check if thelinkedlist has a cycle exceptions threads arrays - reverse pattern matching
To check if a linked list has a cycle, use Floyd's Tortoise and Hare algorithm.
Use two pointers, slow and fast, to traverse the linked list.
If there is a cycle, the fast pointer will eventually meet the slow pointer.
Example: 1->2->3->4->2 (cycle exists between 4 and 2)
Q2. Difference between comprable and comparator in java
Comparable is an interface used for natural ordering of objects, while Comparator is an interface used for custom ordering of objects.
Comparable interface is used to define the natural ordering of objects in a class by implementing the compareTo() method.
Comparator interface is used to define custom ordering of objects in a class by implementing the compare() method.
Example: Comparable interface is used in classes like String, Integer for default sorting. Comparator interface...read more
Q3. Given an array of integers, return thr largest subbaray sum
Find the largest subarray sum in an array of integers
Use Kadane's algorithm to find the maximum subarray sum
Iterate through the array and keep track of the current sum and maximum sum
Reset the current sum to 0 if it becomes negative
Q4. V table and V pointer difference?
V table is a table of function pointers used in object-oriented programming, while V pointer is a pointer to the V table.
V table is a table of function pointers used for dynamic dispatch in object-oriented programming.
V pointer is a pointer to the V table, allowing objects to call the correct functions at runtime.
Example: In C++ virtual functions are implemented using V tables and V pointers.
Q5. Explain friend function with syntax?
Friend function is a function that is not a member of a class but has access to its private and protected members.
Friend functions are declared inside a class with the 'friend' keyword.
They can access private and protected members of the class.
They are not member functions of the class.
Example: class MyClass { private: int x; friend void myFriendFunction(MyClass obj); };
Q6. A program to swap variables
A program to swap variables
Declare two variables and assign values to them
Use a third variable to store the value of the first variable
Assign the value of the second variable to the first variable
Assign the value of the third variable to the second variable
Q7. Scope resolution with syntax ?
Scope resolution refers to the process of specifying which scope a particular variable or function belongs to in a programming language.
Scope resolution is typically denoted by the double colon (::) operator in languages like C++ and PHP.
It is used to access static members, constants, and overridden methods in a class.
Example: ClassName::staticMember
Example: Namespace::functionName
Q8. Oops concepts in C Language?
Oops concepts in C Language include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: struct in C.
Inheritance: Allowing a class to inherit properties and behavior from another class. Example: using struct to mimic inheritance.
Polymorphism: Ability to present the same interface for different data types. Example: function overloading in C.
Abstraction: Hiding the complex implem...read more
Q9. File handling classes?
File handling classes are used in programming to read, write, and manipulate files.
File handling classes provide methods to open, read, write, and close files.
Examples include FileInputStream, FileOutputStream, FileReader, FileWriter in Java.
These classes help in managing file operations efficiently and securely.
Interview Process at Codelogicx Technologies
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month