Sunday, July 4, 2021

DSA collections

1). Remove all adjacent duplicate character.
abbac: Input
ac : Output

Use stack.

2). find nth element of Febnocci number.
Use recursion

1 1 2 3 5 8 13 21..

3).print inverted Tree.

4). Police and Thief : 
How many max thieves can be cought?
(P T T P P P T P T P)

One P can catch only one Thief.
One police can catch a thief at a distance K.
K=1.

5).  Evaluate reverse police notation.

Use stack to push operand and then pop and do operations if operand is found.

6). Find and delete nth node from the end in the singly Linked List.

7). Merge two sorted Arrays.


Wednesday, December 13, 2017

LTE Interview questions

Here are some of the basic question that are asked in LTE interview:
  1. Questions related to cat-m like ack/Nack in UL/DL, half duplex
  2. Pucch and pusch can go in same tti?
  3. Who triggers handover
  4. Cell reselection how it happens
  5. Can intracell handover happens
  6. Handovers scenarios
  7. Handover types in LTE, What is difference between X2 and S1 HO?
  8. Who triggers handover
  9. Interface between different entity
  10. Turbo coading and rate matching 
  11. How will you design interface between two modules?
  12. Questions related to cat-m like ack/Nack in UL/DL, half duplex
  13. Pucch and pusch can go in same tti?
  14. Cell reselection how it happens
  15. Can intracell handover happens
  16. TA update
  17. CAT-M UEs
  18. Rach procedure
  19. Compelete attach flow
  20. Pucch formats
  21. Catm DCI formats
  22. Channels added n removed in catm
  23. Cell reselection how it happena
  24. Can intracell handover happens
  25. Tell us about LTE Frame Structure?
  26. What is Subcarrier Bandwidth in LTE?
  27. What is BLER? What’s Target value?
  28. How to investigate low throughput?
  29. What are important LTE KPIs ?
  30. How can we calculate LTE DL/UL throughput?
  31. What Maximum LTE throughput can be achieved in the field?
  32. What is difference between HO , Redirection, Cell Selection / Re-Selection?
  33. What is RRC Reconfiguration?
  34. What is Difference between MIB and SIB?
  35. How many types of SIBs are available in LTE?
  36. What does SIB1/SIB2/ … /SIB13 do?
  37. On which channels SIBs are transmitted?
  38. Which SIBs are essential?
  39. Message flow during LTE Call?
  40. Can you tell us about Prach/PCI/Pusch/Pucch Planning?
  41. Explain Handover signalling messages?
  42. Explain Events measurements in LTE
  43. Which event trigger during the reselection from LTE to 3G and vice versa
  44. What is ANR? types of ANR? Which one is better?
  45. What is QCI?
  46. What is LTE modulation?AMC?
  47. What is TM? TM1? TM2? TM3? TM4?
  48. Mapping of MIB and SIB messages?
  49. Explain SIB messages?
  50. What Message will be observed on layer-3 During handover stage?
  51. Which channel carries CQI information to enodB?
  52. What other info PUCCH carries?
  53. What is DRX?
  54. What is the Location of PUCCH in the UL Spectrum?
  55. CS Fall back criteria and event, Explain CSFallback signalling?
  56. Explain PCI (Physical Cell id) 

Tuesday, September 26, 2017

Frequently asked Operating System questions

Below are some of the important subjective questions in Operating system.

Explain Compiler/Linker/Loader
What is semaphore and how its different from Mutex, Where to use what.
What is Pthread, How to implement threads, Conditional variables etc.
User Level thread Vs Kernel Level thread



Frequently asked C Programming Questions

Below are the list of some of the questions:

CFAQ:
http://c-faq.com



Some of the good links for Bit Manipulations:
1).  Check if the number is power of two.

If we subtract 1 from a power of 2 what we get is 1s till the last unset bit and if we apply Bitwise AND operator we should get only zeros.

/* Function to check if x is power of 2*/
bool isPowerOfTwo (int x)
{
  /* First x in the below expression is for the case when x is 0 */
  return x && (!(x&(x-1)));
}


2). Check if he number is even of Add using Bitwise operator:
The idea is to check whether the last bit of the number is set or not. If the last bit is set then the number is odd, otherwise even. 

A). bitwise XOR Operation of the Number by 1 increment the value of the number by 1 if the number is even otherwise it decrements the value of the number by 1 if the value is odd.

// Returns true if n is even, else odd
bool isEven(int n)
{
 
    // n^1 is n+1, then even, else odd
    if (n ^ 1 == n + 1)
        return true;
    else
        return false;
}

B).  Biwise And
// Returns true if n is even, else odd
bool isEven(int n)
{
    // n&1 is 1, then odd, else even
    return (!(n & 1));
}
  
c). W know bitwise OR Operation of the Number by 1 increment
the value of the number by 1 if the number is even otherwise
it will remain unchanged.

// Returns true if n is even, else odd
bool isEven(int n)
{
 
    // n|1 is greater than n, then even, else odd
    if ((n | 1) > n)
        return true;
    else
        return false;
} 


3). // C program to check if k-th bit
// of a given number is set or not
#include <stdio.h>
 
void isKthBitSet(int n, int k)
{
    if (n & (1 << (k - 1)))
        printf("SET");
    else
        printf("NOT SET");
}

1).Bit Twiddling Hacks
2).Bitwise Operators from GeekforGeeks
3). 



Strings


Pointers

  1. Implementing system calls by yourself (sizeof, strcpy, strcmp etc)
  2. Implement your own sizeof and explain




Function Pointers


Structures/Unions/Bit fields/ Structure padding


Memory allocations and APIs (Malloc/calloc/realloc/heap)
 

  1. What is the point of using malloc(0)?

Various Keyword (Static, Volatile etc)
  1. Can static variables be declared in a header file?
  2. Can a variable be both const and volatile?


Make Files


Libraries (Static/Dynamic)


GCC Flags




Some  popular questions:
  1. Difference between malloc and new?
  2. How will you design interface between two modules?
  3. Where variables sits In memory
  4. Diff between Vector and list .
  5. Volatile keyword
  6. Diff between Structure and union 
  7. How to get size for union and structure
  8. Memory allocation in c
  9. Heap or variable which memory is fast
  10. Diff between link list and and vector
  11. Bit field, how these stored in memory
  12. Big endian and little endian
  13. If 1000 of integer linklist and array is present which would be faster and why
  14. Synchronisation in thread
  15. Diff in mutex and binary semaphore
  16. C memory management
  17. C Storage class
  18. Gdb
  19. Binary search
  20. Multi dimensional array
  21. IPC mechanism
  22. Which storage class is fast
  23. Write your own strtok function where each call return one token separated by delimiter  passed in the string passed. 
  24. Reverse string in place. 
  25. What are different gcc compiler options to secure your code. 
  26. How malloc works behind the scene.
  27. How can you protect the same. 
  28. What is memory corruption. Different types. 
  29. How printf works and write your own printf which can print all basic data type of c. 
  30. What is the security issue with printf. 
  31. Difference between strlcpy and strncpy. What is the security issue with this. 
  32. Check for Balanced parenthesis.
     - using Stack method how you will implement stack and what are different ways. 
     -above algo using lot of memory. now implement same using minimal use of memory.